473,394 Members | 1,932 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

build a binary for Windows on Linux, Solaris or Mac OSX?


I'd like to package up my typing watcher script in a bundled form (no
separate Python install required) for use on Windows. (Un)fortunately, I
don't have access to a Windows computer. Do any of the packaging tools
(py2exe, MacMillan's Installer, etc) allow cross-platform bundling?

Failing that, can I coax someone into building such a beast for me so I can
include it on http://sourceforge.net/projects/watch/?

Thanks,

Skip

Jul 18 '05 #1
9 2342
On Tue, 6 Jul 2004, Skip Montanaro wrote:
I'd like to package up my typing watcher script in a bundled form (no
separate Python install required) for use on Windows. (Un)fortunately, I
don't have access to a Windows computer. Do any of the packaging tools
(py2exe, MacMillan's Installer, etc) allow cross-platform bundling?


I've gotten py2exe to work under Wine. It takes a little bit of work,
though, mostly downloading real Windows DLLs (if you don't have copies
lying around). The process is more or less like this:

1) Install Win32 Python under Wine. (Good for cross-platform testing,
too.)

2) Install py2exe under Win32 Python. Run your setup script using Win32
Python.

3) Point Wine to a real copy of imagehlp.dll -- functions needed by py2exe
are stubs in the Wine version.

4) py2exe should now run, but will complain about not being able to find a
DLL. Find the DLL, and dump in in your Wine system directory. If you can't
find the DLL, use the dll_exclude option (not sure what the actual command
line arg is) to tell py2exe to skip it.

5) Repeat step 4 until py2exe doesn't complain.

6) If all goes well, you should have a happy Win32 binary waiting for you.

Note: I've only tested the resulting binary under Wine; I'm not sure if it
actually works in Windows or not! ;)

Jul 18 '05 #2
Skip Montanaro <sk**@pobox.com> writes:
I'd like to package up my typing watcher script in a bundled form (no
separate Python install required) for use on Windows. (Un)fortunately, I
don't have access to a Windows computer. Do any of the packaging tools
(py2exe, MacMillan's Installer, etc) allow cross-platform bundling?

Failing that, can I coax someone into building such a beast for me so
I can include it on http://sourceforge.net/projects/watch/?
I could do it, although it seems a little work is stil required to port
watch to Windows:

C:\watch-1.1>\python23\Scripts\watch.py
Traceback (most recent call last):
File "C:\python23\Scripts\watch.py", line 667, in ?
main(sys.argv[1:])
File "C:\python23\Scripts\watch.py", line 611, in main
server=server, port=port)
File "C:\python23\Scripts\watch.py", line 235, in __init__
self.output = open("/dev/null", "w")
IOError: [Errno 2] No such file or directory: '/dev/null' c:\python23\scripts\watch.py(235)__init__()

-> self.output = open("/dev/null", "w")
(Pdb)

Thomas
Jul 18 '05 #3
Failing that, can I coax someone into building such a beast for me so
I can include it on http://sourceforge.net/projects/watch/?
Thomas> I could do it, although it seems a little work is stil required to port
Thomas> watch to Windows:
...
Thomas> self.output = open("/dev/null", "w")
Thomas> IOError: [Errno 2] No such file or directory: '/dev/null' c:\python23\scripts\watch.py(235)__init__()


That's odd. I've run this lots on Windows in my previous job, and not
always in debug mode. I'll fix that. Is sys.stderr going to be broken on
Windows? That is, should I use something other than sys.stderr for debug
output?

Thx,

Skip
Jul 18 '05 #4
On Tue, 6 Jul 2004, Skip Montanaro wrote:
Thomas> I could do it, although it seems a little work is stil required to port
Thomas> watch to Windows:
...
Thomas> self.output = open("/dev/null", "w")
Thomas> IOError: [Errno 2] No such file or directory: '/dev/null'
>> c:\python23\scripts\watch.py(235)__init__()


That's odd. I've run this lots on Windows in my previous job, and not
always in debug mode. I'll fix that. Is sys.stderr going to be broken on
Windows? That is, should I use something other than sys.stderr for debug
output?


Perhaps you're using a Cygwin- or MinGW-compiled version of Python? These
will simulate /dev/null, but MSVC- or what-have-you compiled versions will
not (ActiveState and I think the vanilla distribution).

Whether or not sys.stderr "works" (i.e. sends output to a descriptor
seperate from sys.stdout) is likely also dependant on the C library used,
but it somehow gets output to the screen in the ActiveState distribution.

Jul 18 '05 #5
Skip Montanaro <sk**@pobox.com> writes:
>> Failing that, can I coax someone into building such a beast for me so
>> I can include it on http://sourceforge.net/projects/watch/?
Thomas> I could do it, although it seems a little work is stil required to port
Thomas> watch to Windows:
...
Thomas> self.output = open("/dev/null", "w")
Thomas> IOError: [Errno 2] No such file or directory: '/dev/null' >> c:\python23\scripts\watch.py(235)__init__()

That's odd. I've run this lots on Windows in my previous job, and not
always in debug mode. I'll fix that. Is sys.stderr going to be broken on
Windows? That is, should I use something other than sys.stderr for debug
output?


Did you use cygwin?

On Windows, sys.stderr works, and is usually connected to a console
window. But "/dev/null" doesn't exist. You could spell it "NUL", or
provide a Python implementation of a "bit sink".

Next problem is that os.spawnvp() doesn't exist on Windows:

c:\>\python23\Scripts\watch.py --debug
Traceback (most recent call last):
File "c:\python23\Scripts\watch.py", line 668, in ?
main(sys.argv[1:])
File "c:\python23\Scripts\watch.py", line 612, in main
server=server, port=port)
File "c:\python23\Scripts\watch.py", line 326, in __init__
self.setup_server(server, port)
File "c:\python23\Scripts\watch.py", line 356, in setup_server
pid = os.spawnvp(os.P_NOWAIT, cmd, args)
AttributeError: 'module' object has no attribute 'spawnvp' c:\python23\scripts\watch.py(356)setup_server()

-> pid = os.spawnvp(os.P_NOWAIT, cmd, args)
(Pdb)

Thomas
Jul 18 '05 #6
On 2004-07-06, Christopher T King <sq******@WPI.EDU> wrote:
On Tue, 6 Jul 2004, Skip Montanaro wrote:
I'd like to package up my typing watcher script in a bundled form (no
separate Python install required) for use on Windows. (Un)fortunately, I
don't have access to a Windows computer. Do any of the packaging tools
(py2exe, MacMillan's Installer, etc) allow cross-platform bundling?


I've gotten py2exe to work under Wine. It takes a little bit of work,
though, mostly downloading real Windows DLLs (if you don't have copies
lying around).


I use Win4Lin to run WinMe under Linux. py2exe and inno setup
both work fine on WinMe under Win4Lin.

--
Grant Edwards grante Yow! He is the
at MELBA-BEING... the ANGEL
visi.com CAKE... XEROX him... XEROX
him --
Jul 18 '05 #7
Thomas> Did you use cygwin?

I have in the past, but I can't recall if when I used watch on Windows I was
running with the binary distro or a cygwin-compiled Python.

Thomas> On Windows, sys.stderr works, and is usually connected to a
Thomas> console window. But "/dev/null" doesn't exist. You could spell
Thomas> it "NUL", or provide a Python implementation of a "bit sink".

This is what I checked in.

Thomas> Next problem is that os.spawnvp() doesn't exist on Windows:

*sigh* I thought the spawn* routines originated in Windows... I'll look
into this.

Thx,

Skip
Jul 18 '05 #8

Thomas> Next problem is that os.spawnvp() doesn't exist on Windows:

I've fixed that (spawnvp->spawnl). (I had never tried starting up the
watch-server on Windows. For my own needs I always started watch up on my
Mac first, which ran the server, then on Windows, which connected to it.)
Peter Hansen offered to run py2exe for me. Unless he and I both get stuck
we'll leave you to more important things, like the next release of
py2exe. ;-)

Thanks,

Skip
Jul 18 '05 #9
Skip Montanaro wrote:

I'd like to package up my typing watcher script in a bundled form (no
separate Python install required) for use on Windows. (Un)fortunately, I
don't have access to a Windows computer. Do any of the packaging tools
(py2exe, MacMillan's Installer, etc) allow cross-platform bundling?


I just writed a doc to do that with MacMillan's Installer... it's in french
here :
http://grossac.org/python.html
I only need shel32.dll from windows dlls

One day, i'll translate to english :)

--
Florent Manens
http://www.starxpert.fr
Jul 18 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
7
by: Tempo | last post by:
Has anyone sucesfully built a *.exe file on a mac operating system before from a *.py file? I have been trying to do this with pyinstaller, but I keep getting errors and I don't know how to install...
5
by: eranshuman | last post by:
Hi, I m very new to perl I m running an API which have the Buil.pl When Im compiling using perl Build.pl I was getting error : Can't locate Module/Build.pm in @INC (@INC contains:...
7
by: plumb and tree | last post by:
I've been trying for days to build 64 bit python with Solaris 10 + Sun Studio 12. Can anyone helpl please. This is how I tried to do build: # ./configure --prefix=/opt/python2.4...
10
by: rory | last post by:
I can't seem to append a string to the end of a binary file. I'm using the following code: fstream outFile("test.exe", ios::in | ios::out | ios::binary | ios::ate | ios::app)...
16
by: Erwin Moller | last post by:
Why is a binary file executable? Is any binary file executable? Is only binary file executable? Are all executable files binary? What is the connection between the attribute of binary and that of...
11
by: itdevries | last post by:
Hi, I'm trying to convert some char data I read from a binary file (using ifstream) to a float type. I've managed to convert the int types but now I need to do the float types as well but it...
4
by: M.-A. Lemburg | last post by:
Hi Robin, On 2008-10-23 17:55, Robin Becker wrote: That looks like a classical name clash between C header files. It also suggests that you have 64-bit client libs of MySQL installed. As...
0
by: M.-A. Lemburg | last post by:
On 2008-10-25 20:19, Akira Kitada wrote: Thanks. The errors you are getting appear to be related to either some missing header files or a missing symbol definition to enable these - looking...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.