You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello I am having an issue when running this code. I downloaded the folder and I moved the importer folder only to my sites packages folder within my python folder. I successfully pip installed the importer folder. I successfully imported strategy importer with no errors "import importer.StrategyImporter as StrategyImporter". When running the program i get an index error.
"Traceback (most recent call last):
File "C:\Users\Rashad Powell\workspace\MyTutorial\BlackJack_Simulation.py", line 470, in
importer = StrategyImporter(sys.argv[1])
IndexError: list index out of range
I am using eclipse IDE. Your help will be much appreciated. Thank you.
The text was updated successfully, but these errors were encountered:
This is the expected behavior, the sys object receives arguments when calling the script from the command line.
sys.argv[1] is the first argument passed - it should be the name/path to the Strategy.csv file.
EX: python blackjack_sim.py strategy.csv (assumes csv file in same directory as py file.)
In the alternativve, if you are running from within editor, you can remove the argv[1] and just hard code the file name/path:
EX: importer = StrategyImporter('BS.csv')
Hello I am having an issue when running this code. I downloaded the folder and I moved the importer folder only to my sites packages folder within my python folder. I successfully pip installed the importer folder. I successfully imported strategy importer with no errors "import importer.StrategyImporter as StrategyImporter". When running the program i get an index error.
"Traceback (most recent call last):
File "C:\Users\Rashad Powell\workspace\MyTutorial\BlackJack_Simulation.py", line 470, in
importer = StrategyImporter(sys.argv[1])
IndexError: list index out of range
I am using eclipse IDE. Your help will be much appreciated. Thank you.
The text was updated successfully, but these errors were encountered: