Error when running PySimpleGUI code through linux terminal - python-3.x

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.

Related

Running Python in VSCode on Mac pro

I used to use vscode before on my mac pro and there was no issue. After a few months, I decided to code again but now when I run my code I get the following error:
[Running] python -u "/var/folders/29/bhp2ctqx2g72kd6xph6018cr0000gn/T/tempCodeRunnerFile.python"
/bin/sh: python: command not found
[Done] exited with code=127 in 0.01 seconds
If I try to run the code in the terminal with python filename.py I get the same issue. Whats the fix, Im new to Linux and working with directories.

cmd not showing from spyder script

I have a python script that I run using spyder. It execute other scripts with os.system("...").
My problem is that the cmd windows are not poping (the code is executed, but I can't monitor it, eg see print() or errors).
it was working before I updated spyder recently.
I tried unchecking the "Hide command line output windows generated by the subprocess module" in Tools > Preferences > IPython console > Advanced settings > Windows adjustments
but nothing changed. How can I changed that?
Thanks

Python Windows Run Bash Commands

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!

Opening Python IDLE from Raspberry Pi

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.

Terminal unavailable in Jupyter

I installed Jupyter notebook with Python 3, It works fine and I point to my python3 from the New. Then I close it and when I open it again the option terminal is changed to Terminal unavailable and python3 is appeared as python[root]. Any idea why?
This link says it's because windows does not have TTY-based terminal support
https://github.com/jupyter/notebook/issues/172

Resources