Thanks,
So when I make the function call from within the script, it works fine. But I can't seem to use the command line to accomplish this. How can one send parameters to a python function in test.py from the command line?
I am using cygwin so I'm wondering if it's because of that.
I have tried every combination:
python test.py square(3) produces the error:
bash: syntax error...
User Profile
Collapse
-
askalottaqs:
I am having the exact same problem currently. Please let me know if you've found a solution.
Thanks,Leave a comment:
-
Noob needs help on very simple question
Hi All,
Apologies in advance, this question is very rudimentary, but I can't seem to get it right.
I am running python within cygwin. I have a python script called test.py, and inside it a function defined simply as
def square(x):
return x*x
print "hello world"
My question is how do I run this script/call the function inside it?
python test.py does...
No activity results to display
Show More
Leave a comment: