Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > conversion between (OS native) paths and urls

Reply
Thread Tools

conversion between (OS native) paths and urls

 
 
Stefan Seefeld
Guest
Posts: n/a
 
      07-05-2004
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

 
Reply With Quote
 
 
 
 
Peter Otten
Guest
Posts: n/a
 
      07-05-2004
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JDBC URLs ...not really URLs? Adam Monsen Java 11 02-08-2009 08:14 PM
Converting Relative URLs into Absolute URLs Nathan Sokalski ASP .Net 1 08-12-2008 07:03 AM
URLs and Paths and stuff David ASP .Net 2 02-12-2007 07:31 PM
Distinguish text URLs from non-text URLs? Kaidi Java 5 01-04-2004 10:15 AM
Convert between Windows style paths and POSIX style paths Noah Python 5 07-11-2003 09:25 PM



Advertisments