Hi, I was wondering what the syntax is for taking in parameters via command line. In Python, you can just subscript args (args[1]) to grab anything else that the user inputed into the command line as an additional parameter. I know how to grab input from command line using this syntax (Console.readLine), but I need a way to take the input from the beginning when you are telling the console what program to run.
Thanks.
Forums
Command Line Arguments
3 posts
• Page 1 of 1
Re: Command Line Arguments
for arg in CobraCore.commandLineArgs
print arg
To pass in the args, you must run the program separately (e.g., not through cobra.exe):
cobra -c myprog
myprog arg1 arg2
There is a patch to address this which I will be applying soon. After the patch, you'll be able to say:
cobra -r myprog arg1 arg2
or:
cobra myprog -- arg1 arg2
Whichever you prefer.
-Chuck
- Charles
- Posts: 2515
- Location: Los Angeles, CA
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 35 guests