0

I have an app on my website, and I run it with Python from the Windows Command Prompt.

When I try opening it like this,

python http://www.erickwilts.nl/apps/app.py

it says:

python: can't open file 'http://www.erickwilts.nl/apps/app.py': [Errno 22] Invalid argument

Is there a way I can do this?

1
  • You may need ssh to get to it. Do you want to run the program locally or on the remote machine? Commented Aug 26, 2013 at 16:57

2 Answers 2

2

Since the resource is located on webserver, you must download it first. You can do it with urllib2

import urllib2
exec(urllib2.urlopen("http://www.erickwilts.nl/apps/app.py").read())

executing scripts like this is really dangerous though.

Sign up to request clarification or add additional context in comments.

2 Comments

this will only work if they dont have cgi executing .py files also
I hope it's a lot less dangerous if I put the files there myself, right? :)
0

What I really wanted is to execute the file on the webserver itself. Luckily, I had help from some more experienced guys, who helped me on installing python on the webserver en executing my script from my own computer using ssh.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.