By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,002 Members | 1,171 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,002 IT Pros & Developers. It's quick & easy.

getting the path in a cgi script

P: n/a
I know I've done this once before ... I think ... but now I can't figure out
how to do it

I've set my web server to use an alias similar to this

ScriptAlias /xx/ "/Library/WebServer/CGI-Executables/xxx.cgi/"

which makes it possible for me to write

http://127.0.0.1/xx/some/kind/of/path

my problem is that I don't know how to get the 'some/kind/of/path' part of
the URL in my script.

I know that I can do like this in perl

$documentRoot.path_info();

but how do I do it in python?

Oct 14 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Kalle Anke wrote:
I know I've done this once before ... I think ... but now I can't figure out
how to do it

I've set my web server to use an alias similar to this

ScriptAlias /xx/ "/Library/WebServer/CGI-Executables/xxx.cgi/"

which makes it possible for me to write

http://127.0.0.1/xx/some/kind/of/path

my problem is that I don't know how to get the 'some/kind/of/path' part of
the URL in my script.

I know that I can do like this in perl

$documentRoot.path_info();

but how do I do it in python?


import os
path_info = os.environ.get("PATH_INFO")

</F>

Oct 14 '05 #2

P: n/a
On Fri, 14 Oct 2005 18:20:10 +0200, Fredrik Lundh wrote
(in article <ma*************************************@python.or g>):
import os
path_info = os.environ.get("PATH_INFO")


Tackar ... det var nåt enkelt det mindes jag :-)

Oct 14 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.