Come posso eseguire lo script Python 3.3 nella console Spyder e questo ha delle variabili?come eseguire lo script Python 3.3 nella console Spyder con le variabili?
mio codice di esempio (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)
ho provato exec: - e (aperta ("C \ test \ myfile.py") read().) L'errore che ottengo è "ValueError: serve più di 1 valore per decomprimere. Voglio fornire le variabili first =" 1st ", second =" 2nd ", third =" 3rd ". Come posso scrivere exec() in modo che è in grado di gestire gli ingressi
sto usando Python 3.3, l'installazione a 64 bit, sistema operativo Windows, l'installazione:?. WinPython
Vuoi dire qualcosa di simile: http://stackoverflow.com/questions/89228/calling-an-external-command-in- python/89243 # 89243 – User