Hello, i want to pass variables in url with slashes for example if the url is http://host.com/script/2008/05/05
the script would get 2008, 05 and 05 as variables (year,month,day)
i'm using mod_python/publisher.
Thanks in advance
Jump to Post
If the script has access to the URL you could do something like:
>>> url_in = 'http://host.com/script/2008/05/05' >>> match_text = 'script/' >>> index = url_in.find(match_text) + len(match_text) >>> url_in[index:].split('/') ['2008', '05', '05'] >>>
Is that kind of what you were looking for?
All 6 Replies
Be a part of the DaniWeb community
We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.