I'm using spyder for python programing. I've a file.py and I want to run code like:
--model=RNN --optimizer=SGD
but when I run it in the spyder console it gives this error:
SyntaxError: can't assign to operator
So how can I run this?
I'm using spyder for python programing. I've a file.py and I want to run code like:
--model=RNN --optimizer=SGD
but when I run it in the spyder console it gives this error:
SyntaxError: can't assign to operator
So how can I run this?
In Spyder, if you go into the Run menu, you'll find an option named Configuration per file. On my system, you can get directly to that entry with CTRL+F6 (the shortcut key may be different on other OSs).
Once you select the menu item, you'll get a dialog window with several options. The one you want is about halfway down, named Command line options. You will want to check the box, and put the arguments you showed above into the adjacent text field. Now when you run the file, the code will behave as if those options were passed to it on the command line (it will see them in sys.argv
).