how can I execute a Python 3.3 script in a Spyder console, and which has variables?
My sample code (C: /test/myfile.py)
from sys import argv script, first, second, third = argv print("The script is called:", script) print("Your first variable is:", first) print("Your second variable is:", second) print("Your third variable is:", third)
I tried exec (open ("C: \ test \ myfile.py"). Read ()), and the error I get is "ValueError: requires more than 1 value to unpack. I want to provide the variables first =" 1st " , second = "2nd", third = "3rd". How can I write exec () so that it can handle inputs?
I am using Python 3.3, 64-bit installation, Windows OS, installation: WinPython.
uday
source share