Author Topic: os.execl error  (Read 3202 times)

0 Members and 1 Guest are viewing this topic.

Offline Snake X

  • Ancient Veteran
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 810
  • Rating: +33/-8
    • View Profile
os.execl error
« on: November 01, 2012, 11:33:42 pm »
Alright so my main goal in what I'm currently working on is to get a script file to reload itself (assume there is a trigger because there is one in place for it) whenever the code is updated. Right now I have scriptfilename.py and reload.py.

What I'm trying to do is to execute the reload.py file and after that is executed the program closes itself. After the reload.py file is called, it executes scriptfilename.py and close the reload.py file.

as I just typed the above, I realized that reload.py wouldn't get to be able to close itself because it cant get past the scriptfilename.py program which will be continuously running..

what is the best way to impliment a self update code for a python script file  (NOT a module) after code has been changed? It would be put under a trigger which I'm able to trigger myself as the code is running.

so like for example

if trigger.activated==True:
  #update the Scriptfilename.py file to run new code that's been put into it.

note: I'm using python 3.0 and I've been spending many hours googling on this vastly Lol

EDIT: actually nevermind on this, this can be deleted. I got what I needed.
« Last Edit: November 02, 2012, 08:58:14 am by Snake X »
Loved this place, still the best producers of power metal, and sparked my dreams of coding.