Python Forum
how to stop and start a script for 30 seconds
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to stop and start a script for 30 seconds
#10
Hi

thank you for the below, yes i want to run for example start.sh and it as above runs it for 30 seconds then pauases for 30 seconds and so on.

then stop.sh to stop it

Is this possible

thanks again

Paul


(Jan-16-2020, 01:18 PM)DeaD_EyE Wrote:
Error:
./s.sh: line 4: import: command not found
I guess you made the file executable and just run it.
Currently you try to run your code as Shell Script with the Bash.
The file extension is also misleading, because it's a Python Script and not a Shell Script.

Linux looks for the shebang, which starts with #!.
Everything after this two chars is a path to an interpreter.

We know it as:

#!/bin/bash
#!/bin/sh
#!/usr/python
#!/usr/python3
#!/usr/env python3
If the shebang is missing, he falls back to your default shell (Bash) and runs the script inside the default Shell.
Add the right shebang or call the file directly with python3.

python3 you_script.py
Do you want to start/stop the script with two different commands like start and stop?
Reply


Messages In This Thread
RE: how to stop and start a script for 30 seconds - by laspaul - Jan-16-2020, 02:13 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Button to stop while loop from another script Absolutewind 5 881 Sep-25-2023, 11:20 PM
Last Post: deanhystad
  ''.join and start:stop:step notation for lists ringgeest11 2 2,420 Jun-24-2023, 06:09 AM
Last Post: ferdnyc
  Problem with module time and leap seconds Pedroski55 3 1,237 Oct-07-2022, 11:27 PM
Last Post: Pedroski55
  non-stop ping script kucingkembar 1 1,358 Aug-23-2022, 06:29 AM
Last Post: menator01
  readline.parse_and_bind() does not work in start-up script of Python interpreter zzzhhh 0 1,520 Jan-18-2022, 11:05 AM
Last Post: zzzhhh
  Store variable data and display sum after 60 seconds the_dude 11 3,443 Dec-16-2021, 07:07 PM
Last Post: deanhystad
  Script stop work after 3 actioins - PLEASE WHERE IS THE PROBLEM? rondon442 0 1,556 Sep-27-2021, 05:40 PM
Last Post: rondon442
  How to calculate time difference between each row of dataframe in seconds Mekala 1 2,563 Jul-16-2020, 12:57 PM
Last Post: Larz60+
  Looking for help on making a script [no idea where to start] Chietnemese 1 1,748 Jun-26-2020, 03:50 AM
Last Post: Larz60+
  How can I stop the script when I run the game on my own computer? StatTark 2 2,218 Jun-19-2020, 11:20 AM
Last Post: StatTark

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020