Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: pop from empty list #42

Open
kylejungbluth opened this issue Mar 16, 2022 · 1 comment
Open

IndexError: pop from empty list #42

kylejungbluth opened this issue Mar 16, 2022 · 1 comment

Comments

@kylejungbluth
Copy link

I seem to get IndexError after running the code below.
switchtemp.txt

The output from the terminal is:
erroroutput.txt

I'm not sure why it only occurs on the second run, as I believe I closed and quit properly before reopening again. Also, I don't know if it is just my system that is not working right, but I cannot run gdx = gdx.gdx() inside of any function. This line only ever works outside of a function or class.

@sswartley
Copy link
Contributor

Hello,

The Index error appears to occur because the read list must be empty. I'm not sure why that is happening on your second run. For troubleshooting I might suggest that you create a program that does not loop your whole data collection program. Instead, just run the whole program once, and then run the whole program a second time. Does the error still occur?

I am curious why you are looping the entire program in the first place? In other words, why connect and disconnect the USB over and over? It would be better if you connect the device and configure your channels one time at the start of your program, and then start collecting data, then stop, perform other tasks..., then start collecting data, then stop, perform other tasks, etc.. and then, at the end of the program, close and quit one time.

I would also suggest that you perform all of the imports and setting gdx = gdx.gdx() at the beginning of your program. This also follows the general Python style guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants