Go to advanced search

by rodink
Thu Jan 23, 2020 12:55 pm
Forum: General discussion
Topic: start up automatically
Replies: 2
Views: 234

start up automatically

Hello, I would like to automatically start a python script when the raspberry pi starts. This python script opens an interface where you must enter information. Once it has been entered, the script should no longer start automatically after the raspberry pi starts. Does anyone know how i could do th...
by rodink
Mon Dec 23, 2019 2:01 pm
Forum: General discussion
Topic: change a script when a value is entered in a GUI
Replies: 1
Views: 160

change a script when a value is entered in a GUI

Hey,
I would like to create an interface with python in which someone can enter his / her data.
this data must be placed/ changed in a different python script.
does anyone know if this is possible?
if so? how can I best do this?
by rodink
Thu Dec 12, 2019 1:17 pm
Forum: General discussion
Topic: 2 script auto start
Replies: 7
Views: 536

Re: 2 script auto start

RaTTuS wrote:
Thu Dec 12, 2019 1:01 pm
make sure you have the correct path to bash and python
do a

Code: Select all

which python3
from the command line


..possibly /usr/bin/python3
it worked!
thank you for helping me out!
:) :)
by rodink
Thu Dec 12, 2019 1:00 pm
Forum: General discussion
Topic: 2 script auto start
Replies: 7
Views: 536

Re: 2 script auto start

cd /home/pi/Desktop /bin/bash /home/pi/Desktop/myfile& /bin/python3 /home/pi/Desktop/myfile.py& rc.local is not the best way to do things now however as rc.local runs as root - then you don't need sudo and the best way is full paths to everything then use & to mean run in the background...
by rodink
Thu Dec 12, 2019 12:09 pm
Forum: General discussion
Topic: 2 script auto start
Replies: 7
Views: 536

Re: 2 script auto start

RaTTuS wrote:
Thu Dec 12, 2019 11:24 am
how are you starting them now.

bash blah &
python blah &

Code: Select all

sudo nano /etc/rc.local.

Code: Select all

cd /home/pi/Desktop
sudo bash myfile
sudo python3 myfile.py
by rodink
Thu Dec 12, 2019 11:02 am
Forum: General discussion
Topic: 2 script auto start
Replies: 7
Views: 536

2 script auto start

Hello,
I would like a bash script with an infinite loop and a python script with an infinite loop to run automatically when my raspberry starts.
I always get one of the 2 working but the other is unable to execute it at the same time.
does anyone know how i can solve this problem?
by rodink
Wed Dec 11, 2019 10:09 am
Forum: General discussion
Topic: Open terminal with python
Replies: 9
Views: 558

Re: Open terminal with python

It works now!
thank you for helping me out!!
:)
by rodink
Tue Dec 10, 2019 1:30 pm
Forum: General discussion
Topic: Open terminal with python
Replies: 9
Views: 558

Re: Open terminal with python

I would like when the raspberry starts up that it is checked whether there is a connection to the internet. true: a code must be executed to get the time off the internet. false: wait until there is a connection and then execute the code to retrieve the time from the internet Well that's a complete...
by rodink
Tue Dec 10, 2019 1:20 pm
Forum: General discussion
Topic: Open terminal with python
Replies: 9
Views: 558

Re: Open terminal with python

You have not explained how you want to run your python program ? but assuming you just want to double click on the file name in the file manager, first you need to make sure your program has this as the first line #!/usr/bin/env python3 then you need to make the file executable chmod 740 filename n...
by rodink
Tue Dec 10, 2019 12:43 pm
Forum: General discussion
Topic: Open terminal with python
Replies: 9
Views: 558

Re: Open terminal with python

Are you wanting your python code to run at pi boot ? if so you need to use the " /etc/xdg/lxsession/LXDE-pi/autostart " file to run the terminal and your python program after the GUI has loaded. so open the file with the following command sudo nano /etc/xdg/lxsession/LXDE-pi/autostart and...
by rodink
Tue Dec 10, 2019 12:34 pm
Forum: Nederlands
Topic: met python de terminal openen
Replies: 1
Views: 647

met python de terminal openen

wanneer ik een pythonscript uitvoer, wil ik dat het de terminal opent en in de terminal wil ik dat een code automatisch wordt uitgevoerd.

Is dit mogelijk?
kan iemand me helpen hoe ik dit zal creëren?
by rodink
Tue Dec 10, 2019 12:32 pm
Forum: General discussion
Topic: Open terminal with python
Replies: 9
Views: 558

Open terminal with python

when i run a python script i want it to open the terminal and in the terminal I want a code to run automatically.

is this possible?
can someone help me how i will create this?
by rodink
Thu Dec 05, 2019 12:41 pm
Forum: General discussion
Topic: execute code after connected with internet
Replies: 8
Views: 622

Re: activate code after connected with internet

echmain wrote:
Thu Dec 05, 2019 12:33 pm
Not sure what you mean by “activate a code”.

Can you elaborate?
when i start up my raspberry it has to connect to wifi. when connected, a code must be executed in the terminal.
if it is not connected, the code must not be executed
by rodink
Thu Dec 05, 2019 9:43 am
Forum: General discussion
Topic: execute code after connected with internet
Replies: 8
Views: 622

execute code after connected with internet

I would like to execute a code in the terminal when I start up my raspberry when it is connected to the internet.
anyone have an idea how I could do this?
by rodink
Fri Nov 22, 2019 7:28 am
Forum: General discussion
Topic: automatic activation of a terminal code
Replies: 8
Views: 615

Re: automatic activation of a terminal code

So if you want to set the date/time from google you need this line sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z" to run it from cron on reboot you would need to do it like this use sudo crontab -e to edit the root cron file as setting th...
by rodink
Thu Nov 21, 2019 3:24 pm
Forum: Nederlands
Topic: automatisch uitvoeren code terminal bij opstarten
Replies: 6
Views: 1099

Re: automatisch uitvoeren code terminal bij opstarten

zonstraal wrote:
Thu Nov 21, 2019 2:34 pm

ja geïnstalleerd haha.
ja ik heb verbinding met het internet.
heb mijn timezone goed staan.
maar nogsteeds update hij de tijd niet na het opstarten van de raspberry pi
by rodink
Thu Nov 21, 2019 3:20 pm
Forum: General discussion
Topic: automatic activation of a terminal code
Replies: 8
Views: 615

Re: automatic activation of a terminal code

deepo wrote:
Thu Nov 21, 2019 2:47 pm

i did this

Code: Select all

wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8
and i get

Code: Select all

21 Nov 2019 15:15:27
but this does not update the time automatic when i start the raspberry pi
by rodink
Thu Nov 21, 2019 2:27 pm
Forum: Nederlands
Topic: automatisch uitvoeren code terminal bij opstarten
Replies: 6
Views: 1099

Re: automatisch uitvoeren code terminal bij opstarten

ik heb het bestand 2018-06-27 respian-stretch gedownload.
helaas past hij niet automatisch de tijd aan terwijl ik dit wel wil hebben.
weet iemand een andere oplossing hiervoor?
by rodink
Thu Nov 21, 2019 2:24 pm
Forum: General discussion
Topic: automatic activation of a terminal code
Replies: 8
Views: 615

Re: automatic activation of a terminal code

unfortunately this does not work for me.
now i get 1:00 am when i start up the raspberry.
I have also tried a lot with the NTP stuff.
unfortunately this did not help.
by rodink
Wed Nov 20, 2019 2:51 pm
Forum: Nederlands
Topic: automatisch uitvoeren code terminal bij opstarten
Replies: 6
Views: 1099

automatisch uitvoeren code terminal bij opstarten

hi, ik wil graag de tijd aanpassen naar de actuele tijd op internet. ik heb een code gevonden die de tijd aanpast aan de google.com tijd. sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z" maar hoe kan je deze code activeren als je je raspberr...
by rodink
Wed Nov 20, 2019 2:48 pm
Forum: General discussion
Topic: automatic activation of a terminal code
Replies: 8
Views: 615

automatic activation of a terminal code

Hi, I would like to adjust the time to the current time on the internet. I found a code that adjusts the time to the google.com time. sudo date -s "$(wget -qSO- --max-redirect=0 google.com 2>&1 | grep Date: | cut -d' ' -f5-8)Z" but how can you activate this code when you start your ras...

Go to advanced search