Re: [PyQt] Windows/OS X installers for PyQt4 apps

2009-02-07 Thread stan
At least for windows,  code developed in Gentoo/Ubuntu/Python-2.5/ Qt/PyQt4 is 
very efficiently converted to self contained .exe's with pyinstaller and 
seems a little faster executing (smaller loading time) than py2exe. 
 I prefer pyinstaller a little for the moment, as it seemed clearer and runs 
well.  A simple howto with other quirks discussed and proper howto code 
that works out of the box (change to your program name, location...) is at 

http://bytes.com/topic/python/insights/579554-simple-guide-using-pyinstaller

which ran out of the box first time on a 2200 line Python QT application (it 
turned into a 9MB single compressed .exe) 

Not very technical, but this video shows the pyinstaller process quite clearly 

http://showmedo.com/videos/video?name=pythonHollandPyInstaller_german

Don't know about OS X, but people seem to have success with py2app


On Saturday 07 February 2009, Mark Voorhies wrote:
 I am starting work on a Python/Qt4 based GUI and am looking for advice on
 packaging the finished application for Windows XP and OS X.

 The details are:
   * The development is being done on Linux (Ubuntu and Debian), so open
 source packaging tools that run on Linux are preferred.
   * I am using the GPL licensing option for Qt4 (entire application
 distributed under the GPL).
   * The current dependencies are Qt4 and some pure Python libraries.
   * The target audience is non-programmer biologists, so the install
 process should be on the order of download this file and double-click to
 install.

 My initial googling suggests py2exe for Windows and py2app for OS X, but I
 am particularly interested in the quirks of using such tools to package
 PyQt.

 Thank you for your time,

 Mark Voorhies

 ___
 PyQt mailing listPyQt@riverbankcomputing.com
 http://www.riverbankcomputing.com/mailman/listinfo/pyqt
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Windows/OS X installers for PyQt4 apps

2009-02-07 Thread Giovanni Bajo
On sab, 2009-02-07 at 10:58 +0100, stan wrote:
 At least for windows,  code developed in Gentoo/Ubuntu/Python-2.5/ Qt/PyQt4 
 is 
 very efficiently converted to self contained .exe's with pyinstaller and 
 seems a little faster executing (smaller loading time) than py2exe. 
  I prefer pyinstaller a little for the moment, as it seemed clearer and runs 
 well.  A simple howto with other quirks discussed and proper howto code 
 that works out of the box (change to your program name, location...) is at 
 
 http://bytes.com/topic/python/insights/579554-simple-guide-using-pyinstaller
 
 which ran out of the box first time on a 2200 line Python QT application (it 
 turned into a 9MB single compressed .exe) 
 
 Not very technical, but this video shows the pyinstaller process quite 
 clearly 
 
 http://showmedo.com/videos/video?name=pythonHollandPyInstaller_german
 
 Don't know about OS X, but people seem to have success with py2app

PyInstaller SVN trunk is able to package PyQt applications under Mac as
well, though it doesn't build a bundle yet (.app). Work is in progress
as we speak.
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com


___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Windows/OS X installers for PyQt4 apps

2009-02-07 Thread Frédéric
On samedi 07 février 2009, stan wrote:

 At least for windows,  code developed in Gentoo/Ubuntu/Python-2.5/
 Qt/PyQt4 is very efficiently converted to self contained .exe's with
 pyinstaller and seems a little faster executing (smaller loading time)
 than py2exe.

Does it mean you can package a Windows .exe from a linux system?

-- 
Frédéric

http://www.gbiloba.org

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Windows/OS X installers for PyQt4 apps

2009-02-07 Thread Giovanni Bajo
On sab, 2009-02-07 at 11:36 +0100, Frédéric wrote:
 On samedi 07 février 2009, stan wrote:
 
  At least for windows,  code developed in Gentoo/Ubuntu/Python-2.5/
  Qt/PyQt4 is very efficiently converted to self contained .exe's with
  pyinstaller and seems a little faster executing (smaller loading time)
  than py2exe.
 
 Does it mean you can package a Windows .exe from a linux system?

Yes, PyInstaller SVN trunk can do that as well. It's undocumented at the
moment, but it mostly works. To make it work, you need to share a Python
Windows installation and of course all required 3rd party libraries.

Usually, you fire up a VM with Windows, install Python, PyQt and
whatever you need; make sure your application works within the VM with
Windows; then share the disk, go back to Linux, and launch PyInstaller
in cross-compilation mode, and point it to the mount point which maps to
c:\python25.
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com


___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Windows/OS X installers for PyQt4 apps

2009-02-07 Thread Giovanni Bajo
On sab, 2009-02-07 at 13:09 +0100, Frédéric wrote:
 On samedi 07 février 2009, Giovanni Bajo wrote:
 
   Does it mean you can package a Windows .exe from a linux system?
 
  Yes, PyInstaller SVN trunk can do that as well. It's undocumented at the
  moment, but it mostly works. To make it work, you need to share a Python
  Windows installation and of course all required 3rd party libraries.
 
 Very impressive!
 
  Usually, you fire up a VM with Windows, install Python, PyQt and
  whatever you need; make sure your application works within the VM with
  Windows; then share the disk, go back to Linux, and launch PyInstaller
  in cross-compilation mode, and point it to the mount point which maps to
  c:\python25.
 
 Is it possible, once the Windows installation of PyQt and so is done, to 
 move all files to the linux filesystem, and do all things there? My idea 
 is to avoid having a VM running (I use VirtualBox, which takes a lot of 
 resources)...

Possibly, but I haven't tested it personally. You're welcome to
experiment and report your successes or failures on PyInstaller's
mailing list (or anywhere you like to post).

 What files do I need? Only the c:\python25 dir and its content?

I think so.
-- 
Giovanni Bajo
Develer S.r.l.
http://www.develer.com


___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Avoiding freeze of the application

2009-02-07 Thread Geert Vancompernolle

Hi,

I want to achieve the following:

* My (Windows) application is trying to make a connection with a Linux 
server, using another application (plink, part of the Putty distro)
* Since an external application is to be called, I'm using the method 
subprocess in this way:
   retcode = subprocess.call( plink -batch %...@%s echo % 
(self.beqLineEdit.text(), self.linuxmachineComboBox.currentText())

, shell=True
, stderr=errptr
)
* However, that call can take up to 10 seconds (worst case).  In the 
mean time, my main application is frozen, I can't do anything else.


Now, what I would like to do, is to decouple the above call from the 
main thread, such that the main application becomes free again.  I 
also would like to start a one shot timer (using QTimer.singleShot()) to 
create a time-out.  This is to prevent a hang of the application, in 
case something goes wrong during the subprocess call.


So, my intention is to check when the one shot timer elapses, if the 
subprocess call is still busy.  If not, then all is fine and I simply 
ignore the time out.  If the subprocess is still busy, I would like to 
be able to (if needed, forcefully) stop the subprocess call.


I currently started the one shot timer just before I launched the 
subprocess call, but I see that the one shot timer is also blocked by 
the subprocess call.  So, that doesn't do what I in fact want to do.


My questions:

1. How can I decouple the subprocess call?
2. How can I forcefully stop a subprocess call (that should be the case 
if my one shot timer elapses after 10 seconds, and the subprocess call 
is not returned yet)?
3. What's the best approach to achieve the above requirements?  Using a 
kind of a state machine, where I first start the subprocess call 
(decoupled), then start the one shot timer, change the state and then 
check in that state if the subprocess call has indeed ended?  And if 
not, forcefully stop the subprocess call?


Any practical helpful tips much appreciated!


--
Best rgds,

Geert


*Use EcoCho http://www.ecocho.com: environmentally friendly search the 
internet!*

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Avoiding freeze of the application

2009-02-07 Thread Phil Thompson
On Sat, 07 Feb 2009 16:53:27 +0100, Geert Vancompernolle
geert.discussi...@gmail.com wrote:
 Hi,
 
 I want to achieve the following:
 
 * My (Windows) application is trying to make a connection with a Linux 
 server, using another application (plink, part of the Putty distro)
 * Since an external application is to be called, I'm using the method 
 subprocess in this way:
 retcode = subprocess.call( plink -batch %...@%s echo % 
 (self.beqLineEdit.text(), self.linuxmachineComboBox.currentText())
  , shell=True
  , stderr=errptr
  )
 * However, that call can take up to 10 seconds (worst case).  In the 
 mean time, my main application is frozen, I can't do anything else.
 
 Now, what I would like to do, is to decouple the above call from the 
 main thread, such that the main application becomes free again.  I 
 also would like to start a one shot timer (using QTimer.singleShot()) to 
 create a time-out.  This is to prevent a hang of the application, in 
 case something goes wrong during the subprocess call.
 
 So, my intention is to check when the one shot timer elapses, if the 
 subprocess call is still busy.  If not, then all is fine and I simply 
 ignore the time out.  If the subprocess is still busy, I would like to 
 be able to (if needed, forcefully) stop the subprocess call.
 
 I currently started the one shot timer just before I launched the 
 subprocess call, but I see that the one shot timer is also blocked by 
 the subprocess call.  So, that doesn't do what I in fact want to do.
 
 My questions:
 
 1. How can I decouple the subprocess call?
 2. How can I forcefully stop a subprocess call (that should be the case 
 if my one shot timer elapses after 10 seconds, and the subprocess call 
 is not returned yet)?
 3. What's the best approach to achieve the above requirements?  Using a 
 kind of a state machine, where I first start the subprocess call 
 (decoupled), then start the one shot timer, change the state and then 
 check in that state if the subprocess call has indeed ended?  And if 
 not, forcefully stop the subprocess call?
 
 Any practical helpful tips much appreciated!

Use QProcess instead of subprocess.

Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Avoiding freeze of the application

2009-02-07 Thread Roberto Alsina
On Saturday 07 February 2009 13:53:27 Geert Vancompernolle wrote:
 I currently started the one shot timer just before I launched the
 subprocess call, but I see that the one shot timer is also blocked by
 the subprocess call.  So, that doesn't do what I in fact want to do.

Check the docs for subprocess.call:

call(*popenargs, **kwargs):
Run command with arguments.  Wait for command to complete, then
return the returncode attribute.

Since it will wait right there until the process ends, your app blocks.

 My questions:

 1. How can I decouple the subprocess call?

Check the threading or processing modules. Or use Popen instead of call.

 2. How can I forcefully stop a subprocess call (that should be the case
 if my one shot timer elapses after 10 seconds, and the subprocess call
 is not returned yet)?

You kill it. However, if you start it blocking, you can't. If you create the 
subprocess using Popen, then you can poll() it, and then, if needed, get its 
pid and kill it using os.kill.

 3. What's the best approach to achieve the above requirements?  Using a
 kind of a state machine, where I first start the subprocess call
 (decoupled), then start the one shot timer, change the state and then
 check in that state if the subprocess call has indeed ended?  And if
 not, forcefully stop the subprocess call?

Yes, I think.

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Windows/OS X installers for PyQt4 apps

2009-02-07 Thread eliben



stan-54 wrote:
 
 At least for windows,  code developed in Gentoo/Ubuntu/Python-2.5/
 Qt/PyQt4 is 
 very efficiently converted to self contained .exe's with pyinstaller and 
 seems a little faster executing (smaller loading time) than py2exe. 
 

While I've also found both pyinstaller and py2exe work great for PyQt, my
experience re loading speed has been completely different. In my case,
py2exe apps load much faster than pyinstaller's.

Eli
-- 
View this message in context: 
http://www.nabble.com/Windows-OS-X-installers-for-PyQt4-apps-tp21883483p21890549.html
Sent from the PyQt mailing list archive at Nabble.com.

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Avoiding freeze of the application

2009-02-07 Thread Brian Kelley
If you don't want to use QProcess, you can use subprocess.Popen and the poll() 
method.

This would be something like:

popen =  Subprocess.Popen(plink -batch %...@%s echo %
(self.beqLineEdit.text(), self.linuxmachineComboBox.currentText())
  , shell=True
  , stderr=errptr)

And in some QTimer bound method:

retcode = popen.poll()
if retcode is not None:
  # process has finished


QProcess is nice because it already has a signal that it sends when the process 
terminates.  subprocess.Popen also has some quirks like you can't use poll.wait 
or os.wait and popen.poll at the same time.

Brian


On 2/7/09 11:00 AM, Phil Thompson p...@riverbankcomputing.com wrote:

On Sat, 07 Feb 2009 16:53:27 +0100, Geert Vancompernolle
geert.discussi...@gmail.com wrote:
 Hi,

 I want to achieve the following:

 * My (Windows) application is trying to make a connection with a Linux
 server, using another application (plink, part of the Putty distro)
 * Since an external application is to be called, I'm using the method
 subprocess in this way:
 retcode = subprocess.call( plink -batch %...@%s echo %
 (self.beqLineEdit.text(), self.linuxmachineComboBox.currentText())
  , shell=True
  , stderr=errptr
  )
 * However, that call can take up to 10 seconds (worst case).  In the
 mean time, my main application is frozen, I can't do anything else.

 Now, what I would like to do, is to decouple the above call from the
 main thread, such that the main application becomes free again.  I
 also would like to start a one shot timer (using QTimer.singleShot()) to
 create a time-out.  This is to prevent a hang of the application, in
 case something goes wrong during the subprocess call.

 So, my intention is to check when the one shot timer elapses, if the
 subprocess call is still busy.  If not, then all is fine and I simply
 ignore the time out.  If the subprocess is still busy, I would like to
 be able to (if needed, forcefully) stop the subprocess call.

 I currently started the one shot timer just before I launched the
 subprocess call, but I see that the one shot timer is also blocked by
 the subprocess call.  So, that doesn't do what I in fact want to do.

 My questions:

 1. How can I decouple the subprocess call?
 2. How can I forcefully stop a subprocess call (that should be the case
 if my one shot timer elapses after 10 seconds, and the subprocess call
 is not returned yet)?
 3. What's the best approach to achieve the above requirements?  Using a
 kind of a state machine, where I first start the subprocess call
 (decoupled), then start the one shot timer, change the state and then
 check in that state if the subprocess call has indeed ended?  And if
 not, forcefully stop the subprocess call?

 Any practical helpful tips much appreciated!

Use QProcess instead of subprocess.

Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] MatplotLib and PyQt

2009-02-07 Thread projetmbc
Title: Flashmail




Hello,I'm looking for examples of little PyQt applications embending MatplotLib.Best regards.Christophe





___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Mayavi, VTK and PyQt

2009-02-07 Thread projetmbc
Title: Flashmail




Hello,I'm looking for examples of little PyQt applications embending Mayavi.Best regards.Christophe





___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] MatplotLib and PyQt

2009-02-07 Thread Darren Dale
On Sat, Feb 7, 2009 at 6:58 PM, projet...@club-internet.fr wrote:

  Hello,
 I'm looking for examples of little PyQt applications embending MatplotLib.


Here is a good example:
http://matplotlib.sourceforge.net/examples/user_interfaces/embedding_in_qt4.html.
The matplotlib mailing list is probably a better place to follow up if
you
have additional questions specific to matplotlib.

Darren
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt