Python Forum
Is it possible to have a script call itself?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it possible to have a script call itself?
#6
I want my script to execute, call itself, then quit. The idea is to have the program execute, call itself to re-open the file, then the old program quits and the newly opened program executes and repeats the process. Is this possible?

For example:

I open example.py
the code executes
at the end example.py is called within the script to open it again
quit()


The purpose is to have example.py loop itself continuously without me having to manually close and open it again and again.
**Something to keep in mind is that the program MUST close and re-open, not just loop the code inside.
Reply


Messages In This Thread
Is it possible to have a script call itself? - by treycoxiii - Feb-04-2017, 10:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Is possible to run the python command to call python script on linux? cuten222 6 931 Jan-30-2024, 09:05 PM
Last Post: DeaD_EyE
  Call a bash script from within a Python programme Pedroski55 6 2,577 Dec-06-2021, 01:53 PM
Last Post: DeaD_EyE
  Using VBA to Call a Python script causes error in pyodbc connector pcarra 1 2,918 Jun-11-2019, 04:14 PM
Last Post: pcarra
  How to call a variable declared in a function in another python script lravikumarvsp 2 3,011 Jun-04-2018, 08:45 AM
Last Post: Larz60+
  How to call one python script and use its output in another python script lravikumarvsp 3 32,581 May-16-2018, 02:08 AM
Last Post: lravikumarvsp
  Python cmd function call from script John_O 10 10,004 Feb-18-2017, 04:45 PM
Last Post: John_O
  Windows: python script call over ssh -> output jb7731 2 5,473 Feb-08-2017, 01:13 PM
Last Post: jb7731

Forum Jump:

User Panel Messages

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