5
In my program, I do the following operation:
import sys
qtd_ponts = int(sys.argv[1])
I would like to know a practical way to run this file .py passing arguments without needing an IDE, using files .bat for example.
5
In my program, I do the following operation:
import sys
qtd_ponts = int(sys.argv[1])
I would like to know a practical way to run this file .py passing arguments without needing an IDE, using files .bat for example.
7
To run a script as bat or directly from the console, simply put the following command:
python arquivo.py [arg1 arg2 ...]
Remembering that in the case of Windows, the folder in which python is installed needs to be in the environment variable (path).
Felipão! knows all about python :)
Far from it, you still have a lot to learn. (:
Browser other questions tagged python batch argument
You are not signed in. Login or sign up in order to post.
In your bat file, just put python.py file [arg1 arg2 ...], no?
– Felipe Avelar
yes! it worked! I didn’t think it was that simple. Put as answer.
– João Paulo