[PyQt] QUrl paths under Windows seem weird

Sergio Jovani lesergi at gmail.com
Fri Feb 6 14:19:11 GMT 2009


A Divendres 06 Febrer 2009 14:48:39, Grzegorz Adam Hankiewicz va escriure:
> Hello.
>
> I'm implementing a drag and drop application where the user drags
> files from the explorer and drops them on a label. The label processes
> the files and loads them.
>
> Under MacOSX this is working all well, but under Windows I am getting
> paths like u"/C:/Documents and Settings/blah blah". Certainly the
> leading slash is not welcome. How come it got into there and how
> should I remove it?
>
> I know I can remove the first slash under Windows (I've just done it
> and works ok), but I would prefer to not have platform specific code.
> Is there any Qt normalization path which will return something I can
> pass to open() without having to parse it first?
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Hi,

Even it is not a Qt method, you can do it with os.path.normcase().

Ciao.


More information about the PyQt mailing list