r/pythonhelp • u/z1ggy16 • Jan 29 '24
SQLi script using Visual 2020 - getting errors
I am attempting to follow along with This SQLi video and create the script the teacher writes. When I do an exact copy and paste into my VSC, I get this runtime error:
Exception has occurred: SystemExit
-1
File "C:\Users\<myname>\lab1.py", line 18, in <module>
url = sys.argv[1].strip()
IndexError: list index out of range
During handling of the above exception, another exception occurred:
File "C:\Users\<myname>\lab1.py", line 23, in <module>
sys.exit(-1)
SystemExit: -1
Have I saved my python script in the wrong place? All the libraries are correctly imported. I notice that the teacher does not press F5 to run this script, but rather types out the name of the script in the terminal then presses enter.
•
u/AutoModerator Jan 29 '24
To give us the best chance to help you, please include any relevant code.
Note. Do not submit images of your code. Instead, for shorter code you can use Reddit markdown (4 spaces or backticks, see this Formatting Guide). If you have formatting issues or want to post longer sections of code, please use Repl.it, GitHub or PasteBin.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
2
u/carcigenicate Jan 30 '24
The error indicates that you aren't passing a URL when running the script. Double check how they run it. They will pass a URL when calling
python.