python-idle

after pip successful installed: ModuleNotFoundError

╄→尐↘猪︶ㄣ 提交于 2020-07-18 09:35:10
问题 I am trying to install the SimPy module so that I can use it in IDLE. However, everytime I try to import in IDLE, I got an error. I already tried reinstalling Python and Pip and tried to modify the location of the apps. SimPy can be found in the directory of Python 2.7. I'm using python 3.6.1. After I correctly installed simpy in the terminal: pip install simpy Requirement already satisfied: simpy in /Library/Python/2.7/site-packages When I put into IDLE: Import Simpy I got the error:

Run Python in VSCode in python shell like IDLE

 ̄綄美尐妖づ 提交于 2020-07-09 17:44:48
问题 I am well aware of the thread How to execute Python code from within Visual Studio Code But none of them shows how to get the >>> python shell running with the file imported. Cuz I would like to call functions separately. I understand that I can get the python shell going by simply typling python in the terminal but the functions in the python file have to manually imported everytime. Is there a way to run files in VSCode like in IDLE? 回答1: you can run the file in an interactive mode in VSC

Run Python in VSCode in python shell like IDLE

帅比萌擦擦* 提交于 2020-07-09 17:44:12
问题 I am well aware of the thread How to execute Python code from within Visual Studio Code But none of them shows how to get the >>> python shell running with the file imported. Cuz I would like to call functions separately. I understand that I can get the python shell going by simply typling python in the terminal but the functions in the python file have to manually imported everytime. Is there a way to run files in VSCode like in IDLE? 回答1: you can run the file in an interactive mode in VSC

How to set python executable path in IDLE?

冷暖自知 提交于 2020-06-17 09:17:08
问题 I've been using Python only a couple years, primarily through Jupyter notebooks and Spyder, which came with Anaconda. I'm starting to use IDLE some and have problems with loading packages. I'm wondering if the issue stems from the fact I have different Python executables, one used by Jupyter/Spyder and the other by IDLE. In IDLE, I typed import sys; print(sys.executable) which resulted in /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 In both Spyder and in a Jupyter notebook,

Can't run IDLE with pyenv installation: `Python may not be configured for Tk` `ModuleNotFoundError: No module named _tkinter'

北战南征 提交于 2020-06-09 05:37:05
问题 I recently spent couple hours making tkinter and IDLE work on my pyenv Python installation (macOS). Why you are here? You manage Python versions with pyenv on macOS and ( You want IDLE - the development environment for Python - work on your macOS or you want tkinter module work ) What's wrong? You get one of the following errors: Python may not be configured for Tk on import tkinter import _tkinter # If this fails your Python may not be configured for Tk RuntimeError: tk.h version (8.6) doesn

How to correctly use File Explorer browse function - PySimpleGUI

拥有回忆 提交于 2020-04-18 03:57:48
问题 I am trying to use the browse function in PySimpleGUI. I have used PySimpleGUI file browser specific file type to find out how to browse. However there are two file types that I want to choose from and multiple files need to be selected for this to work. My question: How do you use the browse function for browsing two types of files? and also How do you allow multiple files to be browsed? and finally How do you tell each file apart? I know that there is a key function for getting data but how

Is there a horizontal scroll bar in python's idle?

喜你入骨 提交于 2020-02-01 07:22:22
问题 I am using IDLE to learn Python 2.7 on Windows 7. The Vertical scroll bar works fine but I cannot find a way to activate the Horizontal scroll bar. Is there a horizontal scroll bar in Python's IDLE? Thanks 回答1: Horizontal Scroll Bars for IDLE from http://code.activestate.com/lists/python-list/26878/ ( not my code , found it on this site) It is dated Wed, 08 Mar 2000 Works for Python 2.6 but I can't get to work in 2.7. I get an error saying that the file is open some where. For me, the file he

Is there a horizontal scroll bar in python's idle?

给你一囗甜甜゛ 提交于 2020-02-01 07:22:02
问题 I am using IDLE to learn Python 2.7 on Windows 7. The Vertical scroll bar works fine but I cannot find a way to activate the Horizontal scroll bar. Is there a horizontal scroll bar in Python's IDLE? Thanks 回答1: Horizontal Scroll Bars for IDLE from http://code.activestate.com/lists/python-list/26878/ ( not my code , found it on this site) It is dated Wed, 08 Mar 2000 Works for Python 2.6 but I can't get to work in 2.7. I get an error saying that the file is open some where. For me, the file he

Detecting the presence of IDLE / How to tell if __file__ isn't set

南笙酒味 提交于 2020-01-24 16:26:21
问题 I had a script that needed the use of __file__ , and so I learned that IDLE doesn't set this. Is there a way from my script that I can detect the presence of IDLE? 回答1: if '__file__' not in globals(): # __file__ is not set if you want to do something special if __file__ isn't set. Or, try: __file__ except NameError: # __file__ is not set raise if you want to do something then raise an error anyway, or global __file__ __file__ = globals().get('__file__', 'your_default_here') if you want to

IDLE subprocess startup error

痞子三分冷 提交于 2020-01-24 05:51:05
问题 I have the code below in a file called code.py . I am using IDLE to edit the file. When I click Run>Run Module I get the error: "IDLE's subprocess didn't make connection. Either IDLE can't start a subprocess of personal firewall software is blocking the connection." I am using Windows 7 Ultimate 64bit, but I have the 32bit version of Python 2.7 installed. I have looked for a solution on this site as well as others but all of them seem to recommend deleting something called tkinter.py (I have