Ask coding questions

← Back to all posts
1
How call the script (python)
[deleted]

Tell me, please, how to call a script with arguments in python in the console.
I get an error when calling a script:
Python 3.6.1 (default, Dec 2015, 13:05:11)
[GCC 4.8.2] on linux
usage: main.py [-h] {create_db,add,get} ...
main.py -h
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'main' is not defined

Answered by TheDrone7 (518) [earned 5 cycles]
View Answer
Commentshotnewtop
1
TheDrone7 (518)

The console towards the right in repl.it actually acts as the python shell. To run commands like those, you would need to open the normal shell which you can do by pressing the F1 key while focused on the editor and then typing in open shell and then using that command in the new shell that opens up.
If you don't get an immediate answer, please be patient and wait for one instead of spamming repl talk.

If this helps, mark this as the correct answer.

1
[deleted]

@TheDrone7
I did not want to spam, I thought that the first post was not created. Thanks for the answer.