简体   繁体   中英

Pycharm Python Console Won't Run Anything from Script

I am unable to get my pycharm console to access anything from my script. Likewise, when I tell a single line of code to execute in the console, an an error like the one shown in the image is thrown. I am sure that something is not configured correctly, and would appreciate any assistance.

在此处输入图像描述

You have a generic console open that doesn't have your script loaded into in automatically. You can tell because the name of the console is "Python Console".

Right click on the code editor window, then at the bottom, click "Run file in Python Console". That will create a new console with the script loaded.

I made that into a key combination (in the Key Bindings in settings) because it's such a common task for me.

You don't need a python console. Just right click on the script name and select run or in pycharm terminal: python script.py It depends on your scrip

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM