how to run a script with parameters in spyder in debug mode?

9,041 views
Skip to first unread message

Shaohua Zhang

unread,
Mar 29, 2014, 10:22:38 PM3/29/14
to spyd...@googlegroups.com
I am working on some python scripts which can be run in cmd.exe in Windows by typing this:
how can i run this script with parameters in spyder in debug mode?
thanks very much!

Roberto Rosati

unread,
Apr 1, 2014, 11:13:32 PM4/1/14
to spyd...@googlegroups.com
Hello! I'm not an expert, but logically, since when you hit "debug" with the script in Spyder, you should see on the console something like:

debugfile('C:/some_folder/convnet.py', wdir=r'C:/some_folder')

then I think you just have to add the arguments to the runfile method call (as per the docstring), i.e.:

debugfile('C:/some_folder/convnet.py', args='--epochs=300 --data-path=G:\zsh\data\cifar-10-py-colmajor --save-path=G:\zsh\2paper\source-code\save --test-range=6', wdir=r'C:/some_folder')

See if this works!

Roberto

Carlos Córdoba

unread,
Apr 2, 2014, 11:25:52 AM4/2/14
to spyd...@googlegroups.com

Hi,

You can set parameters for your script using the Run config dialog, which is opened using F6. Then look for

General Settings > Command line options

Cheers,
Carlos

El 29/03/14 21:22, Shaohua Zhang escribió:

--
You received this message because you are subscribed to the Google Groups "spyder" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spyderlib+...@googlegroups.com.
To post to this group, send email to spyd...@googlegroups.com.
Visit this group at http://groups.google.com/group/spyderlib.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

CHONG DUAN

unread,
Mar 17, 2019, 10:25:04 AM3/17/19
to spyder
Worked for me! Thank you!
Reply all
Reply to author
Forward
0 new messages