These are chat archives for spyder-ide/public

31st
Aug 2018
Carlos Cordoba
@ccordoba12
Aug 31 2018 11:31
@hofingermarkus, and the locale changes in our IPython consoles? I mean, from the one defined in a system terminal?
billy19murahmi
@billy19murahmi
Aug 31 2018 18:56

hey.. I'm new to spyder. Have a quick question, how do we pass environment variables as a parameter to the script?
I did some exploring and found that we can pass parameters using "Command line options" under "Run configuration per file". I'm able to run it ,if I pass it as a string. But I'm not sure how to pass the env variable.

Eg:
--problem=%PROBLEM%
(%PROBLEM% is the environment variable which i want to pass as a parameter)

someprog.py --problem=%PROBLEM%
Carlos Cordoba
@ccordoba12
Aug 31 2018 19:12
@billy19murahmi, right now we don't have a way to do that, sorry
billy19murahmi
@billy19murahmi
Aug 31 2018 19:52
Hey Carlos, thank you for the reply.
Do you know if i can restart the Ipython console automatically everytime I run the script?
Carlos Cordoba
@ccordoba12
Aug 31 2018 19:55
No, you can't, but you can reset the console (i.e. remove all your variables) before running a file. For that you need to activate the option called Remove all variables before execution in the menu Run > Configuration per file
billy19murahmi
@billy19murahmi
Aug 31 2018 20:06
Got it. Thank you. When we run a prog from command line a new session is created every time, i was trying to find what is the equivalent way to set up in spyder.
CAM Gerlach
@CAM-Gerlach
Aug 31 2018 20:34
@billy19murahmi There's also been a few issues requesting that. However, since Spyder's UMR feature, enabled by default, will automatically reload any modified code, clearing all variables + UMR will have nearly the same affect (other than that unchanged and non-re-imported libraries will stay loaded until the next console restart).