Hi I have bought a Rasberry Pi with Python 3 on it. I can open the Python 3 shell and it works but I can't access an editor. How do I open a Python editor?
cheers
While the standard distribution of Python comes with IDLE, many Linux distributions do not include it. After you launch Python from command line, try the Python command,
>>> from idlelib import idle
That should start up IDLE with the same version of Python you started, regardless of how your symlinks are set up, if you have it installed for that Python version at all. If not, try installing IDLE with your package manager.
In case you are unfamiliar with IDLE, note that unless you open a file with it, IDLE starts with a Python shell window only. You can open a new IDLE editor window from the file menu of the IDLE shell window.
If you are using Python 2 type idle in a command window.
If you are using Python 3 type idle3 in a command window.
If you are using a GUI there should be shortcuts to IDLE and IDLE3 on screen.
Related
I am on a Windows computer, and I have the Ubuntu command line installed. I can access this through the bash command in the Windows command line. I figured I could just call this command through Python:
import os
os.system('bash')
However, the code simply freezes and does not do anything. Is there any way for me to use this bash terminal in Windows using Python? any help would be appreciated!
My python code runs smoothly when I run it through Thonny python IDE but when I try to run it through the linux command terminal this error show up.
_tkinter.TclError: couldn't connect to display ":10.0"
I am using PySimpleGUI for the GUI part of my code. Any help on how to run a GUI through the linux terminal would be appreciated.
With Python 3.7.1 (installed with Homebrew) on macOS Mojave 10.14.1, whenever I scroll using the trackpad while using IDLE for python scripting, the IDLE window crashes. So much as moving along the trackpad in any way while in the IDLE window causes it to crash.
I have two Windows 7 machines. On one machine I can run python scripts by double clicking on the .py file, however on the other machine the script does not execute, the command prompt will flash quickly and the script does not execute. I can execute scripts on both machines using the command line. I have the same version of python installed on both machines.
How do I ensure that a python script can be executed by double clicking the script on Windows 7?
Step 1. Check if your .py files are associated with "python launcher" (Not just "python"). You can check that by right clicking the .py file and see:
In my case, I have two machines of Windows 10. The one with Python 3.6 installed by choosing "Install Now" works perfectly. The another one which having the same version of python installed in a customized location has problems. It seems nothing to do with the environment path setting, as I could run python in the console mode correctly. So at the end, I was forced to uninstall the python, (then removing all the related paths manually if needed), and install it again with default setting "Install Now".
I am trying to set up a Python development environment. I have Python 2.7.3 running on Linux Mint 14. I downloaded IDLE and installed it. It clean installs and Python runs just fine.
So how do I invoke IDLE? There isn't any IDLE in my path: which idle returns nothing. man idle returns nothing pertaining to an editor. Nothing in /usr/lib or /usr/local/lib. Calling idle() inside the Python interpreter doesn't work. Invoking python brings up a shell, not IDLE. No menu entry for IDLE in Linux. No import library named IDLE that Python can find. Three O'Reilly books consulted and not a word about invoking IDLE in Linux. YouTube videos of Python favor Windows, not Linux. Web searches have so far been unsuccessful.
I'm not familiar with Mint myself, but since it claims to be Debian-based, try installing the idle package:
sudo apt-get install idle
That should pull in all the appropriate packages for the installed version of Python. Then you should just be able to start IDLE with:
idle
in a terminal window.