orange123
New Member
- Messages
- 3
- Reaction score
- 0
- Points
- 0
Hi,
I am trying to teach myself Python from scratch.
To even get started, I have spent the best part of 5 hours reading tutorials on the web, trying to figure out how to get even one line of Python running on my website. No luck.
So so far, I haven't even tested one line of code.
The tutorials show me how to write script, but (since they assume I am running the script on my PC) not how to get that script to run on my website.
How do I do this?
My file is called myfirstpage.py
It's just one line, to at least get me started.
I put the file in the directory /cgi-bin/
I then tried to invoke the Python script from a html file, index.html:
It doesn't work. When I click the link, it tells me I have a 500 Internal Server Error. Needless to say, I haven't a clue what I'm doing - and I can't teach myself if I can't get even one line to run!
I have looked on other threads.
This inspired me to add one line to my python page:
but that didn't help.
Some of the advice given was
"Move file to cgi-bin directory and chmod it 755"
I don't know what 'chmod' means, so I have no idea what 'chmod it 755' means either. Can anyone help me and tell me what to do in layman's terms?
p.s. I'm a complete beginner, the only languages I know are html, xhtml, css and maybe 2 or 3 bits of php.
Thank you very much in advance!! :grouphug:
I am trying to teach myself Python from scratch.
To even get started, I have spent the best part of 5 hours reading tutorials on the web, trying to figure out how to get even one line of Python running on my website. No luck.
So so far, I haven't even tested one line of code.
The tutorials show me how to write script, but (since they assume I am running the script on my PC) not how to get that script to run on my website.
How do I do this?
My file is called myfirstpage.py
Code:
print 1 + 1
I put the file in the directory /cgi-bin/
I then tried to invoke the Python script from a html file, index.html:
Code:
<html>
<head></head>
<body>
<a href="cgi-bin/myfirstpage.py">Click here to run Python script</a>
</body>
</html>
I have looked on other threads.
This inspired me to add one line to my python page:
Code:
#!/usr/bin/python
print 1 + 1
Some of the advice given was
"Move file to cgi-bin directory and chmod it 755"
I don't know what 'chmod' means, so I have no idea what 'chmod it 755' means either. Can anyone help me and tell me what to do in layman's terms?
p.s. I'm a complete beginner, the only languages I know are html, xhtml, css and maybe 2 or 3 bits of php.
Thank you very much in advance!! :grouphug: