Wednesday, 15 August 2012

When attempting run a python script from within another python script, I get 'permission denied'! -


So, I was writing a dragon script, and it automatically downloads updates in the beginning of the script. OK then? So when I try to overwrite it, I sh: /Users/<user>/Desktop/<scriptname>.py: permission denied CodeRunner 2.0.2, IDLE 2.7.9 , And the Python launcher is the affected snapshot here:

  cwd = os.getcwd () cwd = (str (cwd) + "/<scriptname>+.py") update = Urlib.URLopener () cwd = str (Cwd) Print "Downloading update ..." update.retrieve ("http: //  gt; /" lt; scriptname & gt; .py "," Cwd) time.sleep (1.25) Print "Downloaded updated! Please wait .." time sleep (2.5) os.system (cwd)  

It sounds weird because people say that it should not write any problem, though, when there was no brother, I find it strange .pyc , which means that it reads at the same time And may be trying to write, it does not mention that it works fine, then suddenly went cotton.

os.system (cmd) will call [current directory ] / & Lt; Scriptname & gt; / Py .

"& Lt; scriptname & gt; .py") ... os.system ('{} {}'. Format ('Python', CMD))


No comments:

Post a Comment