kafffee
Posts: 3
Joined: Tue Jan 30, 2018 4:30 pm

Automatic exit from thonny, change of screen resolution, python3 program.py will not work properly

Sat Feb 03, 2018 1:24 pm

Hi everyone,

I just bought a Raspberry Pi3 Model B and wrote my first python application.
However, for programming I just connect it to TV via HDMI. When I run the program though I disconnect the TV and run my Pi standalone.
Problem: After some time, which I havent figured out yet, screen resolution changes and thonny, on which I run the program on, is being quit. Plus to that, when I try to run the py file from the command line, it does not work properly and any command will not be carried out except for the print("") command.

Im really desperate about this so thank you so much in advance for answering.
:-)

User avatar
bensimmo
Posts: 4654
Joined: Sun Dec 28, 2014 3:02 pm
Location: East Yorkshire

Re: Automatic exit from thonny, change of screen resolution, python3 program.py will not work properly

Sat Feb 03, 2018 1:29 pm

Post up the code, remember to use the code tag formatting.

klricks
Posts: 7172
Joined: Sat Jan 12, 2013 3:01 am
Location: Grants Pass, OR, USA
Contact: Website

Re: Automatic exit from thonny, change of screen resolution, python3 program.py will not work properly

Sat Feb 03, 2018 2:24 pm

kafffee wrote:
Sat Feb 03, 2018 1:24 pm
Hi everyone,

I just bought a Raspberry Pi3 Model B and wrote my first python application.
However, for programming I just connect it to TV via HDMI. When I run the program though I disconnect the TV and run my Pi standalone.
Problem: After some time, which I havent figured out yet, screen resolution changes and thonny, on which I run the program on, is being quit. Plus to that, when I try to run the py file from the command line, it does not work properly and any command will not be carried out except for the print("") command.

Im really desperate about this so thank you so much in advance for answering.
:-)
How do you know the screen resolution has changed without a monitor attached? Are you connecting remotely by VNC?
When you run a Python 3 program from the command line then you must use python3 program.py
If you run with python program.py then that will default to python 2 and may not work with a python 3 program.
Unless specified otherwise my response is based on the latest and fully updated RPiOS Buster w/ Desktop OS.

Return to “General discussion”