Well,the question is in the title, so what i am going to do is just give you an example and hopefully someone can help! Note: I am using Linux Mint 18.x Here is what i want to be able to do: I know that JavaScrpit itself doesn’t support that kind of a ting but is there something similar in the
Tag: arguments
Call a function from the console as an argument
I have a file1.py: Now I want to call file1.battery() from the linux console with python file1.py battery. But I get the error: Answer You can use eval for compiling string like code or use globals and locals: Also, the module can import itself:
Python command line arguments linux
I have this little program(I know there is a lot of errors): If i start it by typing python file.py testfile.txt the output will be always(even if the file doesn’t exist): If you don’t know what iam want from this program, i want to print “File ‘filename’ wasn’t found” if the file isn’t exist and if it’s exist iam wan’t