[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] application.py of PyQt5 examples improvement suggestion
From:       Florian Bruhin <me () the-compiler ! org>
Date:       2015-01-20 5:52:14
Message-ID: 20150120055214.GA30488 () tonks
[Download RAW message or body]

This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.

[Attachment #2 (multipart/signed)]
This is a MIME-formatted message.  If you see this text it means that your
E-mail software does not support MIME-formatted messages.


* iMath <2281570025@qq.com> [2015-01-20 13:13:57 +0800]:
> C:\Python34\Lib\site-packages\PyQt5\examples\mainwindows\application\application.py
> 
> 
> change code in line 113        
>    
> root = QFileInfo(__file__).absolutePath()
> 
> 
> to
> #############################
> import os
> root = os.getcwd()
> 
> 
> #############################
> 
> 
> 
> 
> if not,when freezed into executable by cx_Freeze,it will not work for "__file__ is not defined".

I've not looked at that code, but generally that's not the same thing.

The first is the path the file is at, the second is your current
working directory.

They MAY be the same, but then that's luck.

Florian

-- 
http://www.the-compiler.org | me@the-compiler.org (Mail/XMPP)
   GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
         I love long mails! | http://email.is-not-s.ms/

[Attachment #5 (application/pgp-signature)]
[Attachment #6 (text/plain)]

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic