469,929 Members | 1,811 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,929 developers. It's quick & easy.

conversion between (OS native) paths and urls

hi there,

I'm generating a set of html pages that refer to each other
via relative URLs. However, during the generation of these
files I only deal with paths (as generated by the os.path module).
What is the suggested way to generate an url from a path,
dealing with issues such as backslash-to-slash conversion on windows ?

Thanks,
Stefan

Jul 18 '05 #1
1 2166
Stefan Seefeld wrote:
What is the suggested way to generate an url from a path,
dealing with issues such as backslash-to-slash conversion on windows ?

urllib.pathname2url("space jam/index.html") 'space%20jam/index.html'


I'm confident that it will do the right thing on windows, too.

Peter

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Mustafa Aydin | last post: by
reply views Thread by Paul Hatcher | last post: by
9 posts views Thread by Paul Hatcher | last post: by
10 posts views Thread by tom | last post: by
1 post views Thread by Chris Ashley | last post: by
6 posts views Thread by Jon Slaughter | last post: by
15 posts views Thread by Lars Eighner | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.