4

I would like to know if there is a way to run python scripts in spyder-ide using windows cmd or PowerShell instead of IPython console.

Ipython sometimes works differently than if the script is run in cmd specially for plotting packages like matplotlib, etc.

I am using Spyder latest version.

Regards

3
  • to clarify: you want to use your windows cmd to run a script in spyder? why not launch from cmd directly? Commented Aug 31, 2018 at 14:54
  • hi @Cut7er Thanks for the advice, I am wondering if there is a simple click method in spyder itself to make the code runs in cmd instead of IPython console. Commented Aug 31, 2018 at 16:07
  • i would advise opening cmd in the folder where your script lies, there you can then run it with the command python script_name.py ...this way your console won't close after the script execution is finished Commented Aug 31, 2018 at 21:31

2 Answers 2

6

In Spyder, you can click Run > Configuration per file, which will give you plenty of options in where your Spyder-IDE-Script is launched.

enter image description here

Sign up to request clarification or add additional context in comments.

4 Comments

Thank, it works but cmd disappears right after executing the code!. For example if the code is print('hi'), Spyder runs the code in cmd if the option of console is an external system terminal is selected but I cant see the result unless adding a line input('wait').
@KhalilAlHooti, for that, please activate the option called Interact with the Python console after execution, also present in "Run > Configuration per file".
@CarlosCordoba , Thanks, it works perfect, amazing ide for python. regards
Any way to use PowerShell instead of cmd in Windows 10?
2

I think the option you are looking for is "Execute in External System Terminal" in the options found under the menu item of [Tools] / [Preferences] / [Run]

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.