Re: Bad Interpreter

2005-01-03 Thread Simon John
[EMAIL PROTECTED] wrote:

> the script i have sock.py runs if i say something like :
>
> python sock.py
>
> but ./sock.py results in a :bad interpreter error
> how do i troubleshoot something like this?

sounds like you've been editting the script on a windows machine, and
it's inserted it's evil linefeeds.

on the unix machine run 'dos2unix sock.py', or load sock.py into vi and
remove the ^M characters

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python Installation

2005-01-08 Thread Simon John
brolewis wrote:
> I need to install Python on a number of laptop computers (at least a
> dozen). I am needing to install Python 2.4, pycrypto, win32all,
> wxPython, and pyCurl.

You could try the recently-announced MOVPY, or NSIS/InnoSetup as you
say.

Or simply put the five installers on a disk - if it's only a dozen
machines, it's not going to take long if you don't have to download
each time. They are simple .exe installers, it's not as if you have to
compile and deal with dependancies etc. like on Linux.

I would say install on one machine, then just copy the C:\Python24
directory, but then you'd have to deal with the missing Registry
entries

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python and Excel

2005-01-19 Thread Simon John
Hmm, sounds interesting, I've always resorted to using CSV (or even
HTML!) when exporting to Excel.

As far as how to open it up, have a look at creating a project on
www.sourceforge.net or just zip it up and bung it on your own website
if you have one. I've got the feeling there are also Python-specific
repositories too. Or you could just paste the code into a blog or
something free like Livejournal.

Good luck on the France thing, that's where my folks live now (I'm an
Englishman who retreated to the US!)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pystone benchmark: Win vs. Linux (again)

2005-01-28 Thread Simon John
Franco Fiorese wrote:

> Is there any way, that you know, to get better performance under
Linux?

Build Python yourself, using relevant CFLAGS and TARGET for your
processor?

I've always noticed that Windows Python takes a lot longer to startup
than Linux, but never really looked at runtime performance.

-- 
http://mail.python.org/mailman/listinfo/python-list


WYSIWYG wxPython "IDE"....?

2005-02-04 Thread Simon John
I'm writing my 2nd large wxPython program, and after the problems I
found doing the first's layout in code, I'd like to look at using a
'WYSIWYG' IDE, like VisualStudio does for MFC.

I've tried a few that I found, wxGlade is probably the best, although
it seems to be not 100% WYSIWYG (like the widgets in the preview are
not much like the final program), wxDesigner has a horrid GUI for a GUI
designer! VisualWX gave me the 'now what?' feeling when I started a new
project.

I find the sizer layout thing is what's holding these programs back, is
there another wxWidgets layout system, so that I could just drag'n'drop
widgets wherever I want in a window, more like Qt or MFC?

I'd like to just put a TextCtrl with a few buttons underneath it
without having to create two boxsizers or a gridsizer!

I'd like to create something like the main XMMS (or Winamp) window:

http://xmms.org/files/Skins/images/winamp_x_xmms.png

But that would be a 3-way vertical sizer, a 2-way horizontal and a
2-way vertical at least just for the main (top left) window.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Getting tired with py2exe

2005-09-20 Thread Simon John
James Stroud wrote:

[snip]
> > http://pyinstaller.hpcf.upr.edu/pyinstaller

> That's one short "indefinitely":
>
> Not Found
> The requested URL /pyinstaller was not found on this server.
> Apache/2.0.53 (Fedora) Server at pyinstaller.hpcf.upr.edu Port 80

It seems that the URL is http://pyinstaller.hpcf.upr.edu

>From the website it seems this is a continuation of McMillan Installer,
which they claim is "far superior" to py2exe! Personally I gave up on
MMI, prefering py2exe on Windows and cx_Freeze on UNIX.

And if they want to use UPX, well that's up to them, but I've had some
problems with it and don't particularly like the thought of runtime
decompression and the two process thing. And when you can compress the
distributable using 7zip or whatever, why bother keeping it compressed
once downloaded?

Ah well, I wish you, whoever takes over py2exe and the PyInstaller guys
the best of luck!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WYSIWYG wxPython "IDE"....?

2005-02-06 Thread Simon John
Tim Hoffman wrote:
> Have you tried Boa Constructor ?
>
> http://boa-constructor.sourceforge.net/

Yeah, I was never very impressed with it either. The current version
doesn't seem to work with wxPython 2.5.3.1 though

I guess there isn't a GUI builder that does what I want, back to the
manual way of doing things I guess, unless I use Qt for this project
maybe, and keep it to myself (due to the stupid Qt licensing).

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: WYSIWYG wxPython "IDE"....?

2005-02-07 Thread Simon John
With the news of a GPL Qt4 for Windows, I decided to go with PyQt:

http://mats.imk.fraunhofer.de/pipermail/pykde/2005-February/009527.html

I just knocked up my application (GUI, backend is still in progress)
using QtDesigner in about 5 minutes, and it's layout is just how I want
it!

-- 
http://mail.python.org/mailman/listinfo/python-list


PyQt and Python 2.4 - also WinXP LnF?

2005-02-09 Thread Simon John
After quite a while of wxPython I'm getting back into PyQt, mainly due
to the announcement by Trolltech that they will make a GPL version of
Qt4 for Windows (and Phil-T said he will make a PyQt to go with it
eventually!)

I'm currently using PyQt 3.12 that comes with the BlackAdder demo, it
seems to work fine with Python 2.3.5 except that it doesn't support the
WinXP look'n'feel, the QStyle "WindowsXP" isn't included, and using a
manifest file doesn't seem to fix this.

Does anyone know if the latest PyQt (3.13?) is built with this support?
I thought this had been supported since 3.10 or earlier, is it just the
BlackAdder build that's "broken"?

I'm writing an XMMS remote control program, so it will be GPL when
released (if it's ever good enough to release!) so I'm looking at
buying the commercial PyQt3 or BlackAdder whilst waiting for the GPL
PyQt4

Can I use the commercial PyQt without a commercial Qt - I guess I could
as long as I don't distribute the qt-mt333.dll? I have no use for Qt
itself, not interested in C++, so it seems a bit much to have to buy a
license just for a DLL!

Also, would I have to build it all myself or does Riverbank/TheKompany
provide binaries like PyQt 3.13 for Python 2.4, as I don't have Visual
Studio I can't build it myself.

OK, I'm off to check on my build of PyQt on my Fedora2/Python 2.4
machine ;-)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt and Python 2.4 - also WinXP LnF?

2005-02-09 Thread Simon John
Yeah I had a look at the Qt Free/Win project, but I think it offers me
less than the current official 3.12 from BlackAdder, which is only $80
without the hassle of following those convoluted build instructions (I
did try yesterday).

As far as XMMS/Gtk goes, it's a remote client for XMMS, designed to be
run across a network, so it doesn't really matter about using the same
toolkit. Plus all the problems with XMMS seem to lie with Gtk1
(whenever it crashes, the errors always come from Gtk!)

I was looking at the Gtk2 fork XMMS2, which seems to provide network
control like the InetCtrl plugin for XMMS1, but I'm still not keen on
Gtk as it looks so weird outside of Linux.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt and Python 2.4 - also WinXP LnF?

2005-02-10 Thread Simon John
I've just read the Qt4 GPL for Windows will only support gcc (and maybe
MinGW) anyway, not BCC or VisualC++ (or it's free equivalents), so it
looks like it would be a daunting task to actually build PyQt

See http://osnews.com/comment.php?news_id=9675

I guess the Qt used in PyQt from BlackAdder just wasn't built with XP
support, and if I can't use it to compile PyQt properly, then it's
worthless to me.

I guess a lot of this licensing crap will change when Qt4 GPL is
actually released, but it's still looking like commercial Qt is the
only "easy" way to go, and the Trolls are just making a "difficult" GPL
version to shut people up!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt and Python 2.4 - also WinXP LnF?

2005-02-10 Thread Simon John
I've just read the Qt4 GPL for Windows will only support gcc (and maybe
MinGW) anyway, not BCC or VisualC++ (or it's free equivalents), so it
looks like it would be a daunting task to actually build PyQt

See http://osnews.com/comment.php?news_id=9675

I guess the Qt used in PyQt from BlackAdder just wasn't built with XP
support, and if I can't use it to compile PyQt properly, then it's
worthless to me.

I guess a lot of this licensing crap will change when Qt4 GPL is
actually released, but it's still looking like commercial Qt is the
only "easy" way to go, and the Trolls are just making a "difficult" GPL
version to shut people up!

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Multi-Platform installer generator

2005-02-11 Thread Simon John
if you're referring to the installshield x/mp products, forget it, they
are really bad.

the last company i worked for who used x/mp actually went back to shell
scripts for unix and installshield pro for windows, as the java thing
was abismall, and even the ide was written in java, so horribly slow.

personally i'd stick with shell scripts for unix, and innosetup for
windows.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt and Python 2.4 - also WinXP LnF?

2005-02-11 Thread Simon John
I've just got Qt 3.3.3 and PyQt 3.1.3 compiled for Python 2.4 using the
instructions for MinGW here:

http://kscraft.sourceforge.net/convert_xhtml.php?doc=pyqt-windows-install.xhtml

It was a pretty nasty experience, hacking python24.dll and patching
sip/PyQt, but i got it all working after about 4 hours! It still
doesn't support the XP LnF, but at least I have a non-limited
QtDesigner etc. now, and something I can distribute for Windows which
supports Python 2.4/QScintilla.

I couldn't get it to work with the free MS compiler (VC2003 command
line tools and 1.1 SDK) as they were missing libraries etc. I guess the
docs are referring to a full Visual Studio .NET 2003

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: ANN: pyMinGW support for Python 2.3.5 (final) is available

2005-02-12 Thread Simon John
[snip]
> Ha anyone tried cross compiling python with mingw?  At work we
compile
> our software for lots of platforms (including windows) on a linux
> build host.  The windows builds are done with a mingw cross compiler.
> It would be interesting if we could do this with python + extensions
> also.

Yes, I was thinking of setting up a cross-compiling system, but why
would you use mingw instead of just gcc on Linux? Only cross-compiling
I've ever done is on RISC OS.

I use VMWare to accomplish a similar goal though, compiling stuff for
old 64Mb P233's running RedHat7 is a lot faster when done on a
1Gb/2.5GHz VMWare machine!

I just finished compiling Qt/PyQt/QScintilla/SIP for Python 2.4 using
MinGW on Windows, and can say that MSVC6 was at least twice as fast,
and required less patching to get it working, plus it's one less DLL
and the binaries are about 20% smaller. I also can't seem to get PyQt
apps working on Win98SE when using the MinGW build (2000 and XP work
fine).

Maybe I'll fork out the 100usd for Visual Studio .NET 2003 after all

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt and Python 2.4 - also WinXP LnF?

2005-02-13 Thread Simon John
After building with MSVC6 (Python 2.3.5 and 2.4 versions) I've noticed
that the ToolTips don't seem to work in the GPL version.

MSVC6 is about twice as fast to build as MinGW.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Help with C extensions under VC6 / WinXP and Python 2.4

2005-02-16 Thread Simon John
What's the difference between ctypes, SWIG and SIP?

I've used SWIG to "convert" C source to Python (as I believe SIP
does?), so does ctypes wrap functions from binaries (e.g. DLL's)?

-- 
http://mail.python.org/mailman/listinfo/python-list


Pausing a program - poll/sleep/threads?

2005-02-16 Thread Simon John
I'm writing a PyQt network client for XMMS, using the InetCtrl plugin,
that on connection receives a track length.

To save on bandwidth, I don't want to be continually querying the
server for updates (e.g. has the current track finished yet?) so I
figured the best thing to do is just update after the track length has
expired.

So, how would I make a Python program automatically call a function
after a preset period of time, without the Python process running in
the foreground (effectively single-tasking)?

I think that sleep() would work in the foreground (kind of like a while
loop does, I've come across that issue with wxPython!) does Python have
any polling capabilities?

What about threading - if I launched a thread to just "wait" until a
time has expired, could I then get that thread to make the main program
call a function, or would the main program sit there waiting for the
thread to end? I really have no experience with threads in Python, any
hints/tutorials, the docs are pretty limited?

I'm looking to make this program cross-platform, it has to run on at
least Windows and Linux (hopefully MacOSX too) so the solution would
have to be portable (does Windows even have threading without POSIX?)

If you want to check out what I've done so far (GUI, track info,
controls etc.) you'll need XMMS, http://inetctrl.sourceforge.net and my
source from http://www.the-jedi.co.uk/downloads/xmmsclient there's also
some Windows binaries built with the Cygwin/KDE port.

[InetCtrl seems to segfault if you don't have a playlist loaded, so
load a playlist first, then enable the general plugin. I must submit a
bug report to the author, maybe I could convince him to broadcast when
a track ends...]

Any help would be excellent, as playlist support and these "timed
updates" are about all that's left needing to be done

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pausing a program - poll/sleep/threads?

2005-02-17 Thread Simon John
I don't think time.sleep() will work too well, I think it will cause
the program to hang around in the foreground, and prevent the GUI
updating.

I'll give it a try just to make sure, as I can't figure out the
signal/alarm thing (the alarm only seems to trigger when I click a
button, not after n-seconds

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pausing a program - poll/sleep/threads?

2005-02-17 Thread Simon John
Damn! signal is not supported on Windows.

time.sleep() doesn't work, as I suspected::

def info(self):
   sleep(5)
   self.info()

Basically causes the function to pause, then call itself again, all in
the foreground :-(

I'm thinking some sort of thread timer is the way to go, but really
don't understand threads

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pausing a program - poll/sleep/threads?

2005-02-17 Thread Simon John
Hmm, yes I had thought of looking around PyQt for a timer, forgot about
it though.

As far as querying the server every few seconds, it does make sense
(you don't miss events) and is the recommended way of doing things with
InetCtrl, but I'd prefer to save the bandwidth/server load than have
realtime status updates.

The status also updates whenever you send a command (like play/pause).

I'm really stuck on how to implement this now

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pausing a program - poll/sleep/threads?

2005-02-17 Thread Simon John
Jeff Shannon wrote:

[snip]
> The amount of bandwidth and server load that will be used by a
> once-a-second query is probably pretty trivial (unless you're
> expecting this to run over internet or dialup networks -- and even
> then, it's probably not going to be worth worrying about).  Even on
an
> old 10Mbit ethernet connection, a couple of extra packets every
second
> will not make a notable difference.  This (IMO) is premature
> optimization.  :)

It is designed to work over 802.11b (so under 11Mbit).

I'm going to fire up Ethereal later and see how much traffic this would
cause, most of the commands are only about 30bytes long, and the
longest response would be the filename, it just seems to me that
polling a server once every second or two, is kinda like a DDoS

[...]
> But does the server push events to the client?  If there's a
> filesystem error while a track is playing, how does your client know
> about it?  In addition, what happens if XMMS segfaults, or the server

> machine loses power?

No, this is not server push, the client must query the server. Plus the
InetCtrl plugin does seem to segfault quite a lot, resulting in a
socket exception - I'll have to make sure that the client stops
querying the server after a socket excption, and doesn't keep trying
(resulting in lots of error dialogs!)

[...]
> One of the big questions here is whether your client will have
> exclusive access to the XMMS server.  That is, will it be possible
for
> more than one such client to connect to the same XMMS, and/or for
XMMS
> to have direct interaction on its host machine?

No, you can have multiple connections to the server, and you can use
XMMS directly, so it would be possible for the client to miss events.

[...]
> I really think that you *do* want to do fairly frequent status checks

> with your server.  The cost is small, and the gains in responsiveness

> and robustness are potentially very significant.

Yes, I'm coming around to this POV too, but I still don't know how to
implement it (querying every 2 seconds say) in a multi-tasking manor -
as I said, sleep() hangs up the GUI, and alarm() is not portable

Thanks for your suggestions.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pausing a program - poll/sleep/threads?

2005-02-19 Thread Simon John
OK, I've implemented the 2sec threaded update, but I'm having some
problems with it.

Basically the thread will have to just run constantly, never exiting
(just sleeping for 2secs), which seems to work OK except when I try to
get the thread to do anything with the main program's window.

As the thread doesn't end, it doesn't return a result, so on every pass
of the thread's while loop, I write the current track info to the
mainWindow directly, however this causes the program to hang. Here is a
snippet of the current method:

class ThreadedInfo(Thread):
"""overloads init and defines run"""
def __init__(self):
Thread.__init__(self)

def run(self):
# runs the whole time
while 1:
self.info()
time.sleep(2)

def info(self):
"""referencing window kills linux here"""

# get track info, returned as dictionary
self.info_dict = backend.getInfo(config.server, config.port)

I was thinking of getting the thread to just run once, then getting the
main program to write the result (using join() ) to the mainWindow.
That method would be something like this, but it's almost totally
pointless using a thread then, as the while loop will singletask the
program:

while 1:
# start thread
self.infothread.start()

# when thread ends, get result
self.result = self.infothread.join()

# write result to window
window.mainTextarea.setText(self.result)

# pause for 2secs before starting again
sleep(2)

I made sure that I built PyQt using threads, so that's not the issue.
Any other ideas?

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pausing a program - poll/sleep/threads?

2005-02-19 Thread Simon John
Damn, seems Qt GUI objects (windgets) aren't thread-safe:

http://doc.trolltech.com/3.3/threads.html#11

So I'm going to have to find a way of using a thread to fetch the data,
and then using the main program to update the GUI... Someone suggested
using events:

http://mail.python.org/pipermail/python-list/2002-February/089360.html

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt Python Bindings for Qt v3.14 Released

2005-02-20 Thread Simon John
All looks like good news, especially PyQt4 - one question, if it's
statically linked with Qt4, will it still work with things like py2exe?
I guess it just won't need qt-mt4.dll?

I'm getting a 404 on the new SIP:

http://www.river-bank.demon.co.uk/download/QScintilla/qscintilla-1.61-gpl-1.5.tar.gz

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Pausing a program - poll/sleep/threads?

2005-02-20 Thread Simon John
Ah yes, that Informit article helped endlessly - I'm all done now - got
the backend to fetch the info from the server every 2secs using a
QThread, then it pass the data back to the GUI frontend by raising a
custom event!

Thanks for all the help folks, now I'm off to compile the new PyQt 3.14
;-)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Considering python - have a few questions.

2005-02-21 Thread Simon John
I'd go with a MySQL / Python / Apache route, but if it's Windows, maybe
not.

Also, you shouldn't store images in a database - images should be on
the filesystem with their paths stored in the database.

I'd definitely say going the web application route would be easier (and
more portable) than the GUI route, and a free Windows PyQt is still a
long way off, so stick with wxPython if you want a non-web GUI.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Gordon McMillan installer and Python 2.4

2005-03-02 Thread Simon John
Seriously, if you're only interested in Windows, just use py2exe, or if
you want Linux+Windows, try cx_Freeze.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: About Databases...

2005-03-11 Thread Simon John
Tom Willis wrote:

[snip]
> Whoa, you are asking alot. Without knowing anything about your
> requirements except what was mentioned in your post. I would say you
> would quite possibly want the functionality of a relational database.

I'm not sure I agree with that.

If the data is likely to be large, binary and floats/integers, I'd
probably say a database is sub-par. I'd probably go with a filesystem
approach - like a directory structure (not just a single file) that
your can do an os.walk() on.

You could have some unique directory naming convention (maybe based on
oil facility name, plus a timestamp) and within each of these
directories store your binary as one file, and your statistics
(integers/floats) as another, maybe in some standard-ish format, such
as CSV, .ini (ConfigParser style) or heaven's forbid, even XML (using
sgmlop).

You'd have to research an optimal filesystem based on your needs, for
example ext3 is good for writing large files and Reiser is good for
reading small files (I think that's how it goes).

But otherwise, yeah you can connect to MySQL (using MySQLdb/adodb),
PostgreSQL (using psycopg), MSSQL, Oracle etc. using Python.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Adapting code to multiple platforms

2005-03-11 Thread Simon John
If you're using a GUI, then that may help you decode the platform too -
for example wxPython has wx.Platform, there's also platform.platform()
, sys.platform and os.name

You could try import win32api and checking for an exception ;-)

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: wxPython vs. pyQt

2005-03-16 Thread Simon John
I used to be a wxPython lover, but it was mainly due to the crappy PyQt
licensing terms, rather than any merits of wx (although I like the
native LnF).

After trying to do a large-ish project using wxPython, I found that I
was limited by the lack of widgets and the layout system.

My latest project was in PyQt, after Trolltech announced that Qt4 will
have a GPL version for Windows (and Riverbank said they will make a
PyQt to go with it eventually).

I usually hate visual GUI IDEs, but I found QtDesigner to be a real
asset, much better than wxDesigner or VisualStudio. The threading
implementation also seems superior (easier?) to Python's own too, and
making custom widgets is easy enough, even with a Python wrapper.

Also, the Cygwin guys have ported the GPL/Linux Qt to Windows, so you
can use that for Qt3.3 until Trolltech come up with Qt4.

Links:
http://kscraft.sourceforge.net/convert_xhtml.php?doc=pyqt-windows-install.xhtml
http://kde-cygwin.sourceforge.net/qt3-win32/
http://www.pycs.net/lateral/stories/27.html

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: wxPython vs. pyQt

2005-03-17 Thread Simon John
"so is there already a binary for qt/pyqt/eric3 available or when can i
excpect qt4 to be released? "

I think that pyqt4 is going to be a long way off, obviously further
away than qt4.

i have compiled qt 3.3.3/pyqt 3.1.3 using mingw/vcc6 for windows using
the instructions i linked to in my previous post, both for python 2.3
and 2.4, when the kde-cygwin guys finish porting qt 3.3.4, i'm going to
have a go at pyqt 3.1.4

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PIL for Python 2.4 ?

2004-12-01 Thread Simon John
Michel Claveau - abstraction méta-galactique non triviale en fuite
perpétuelle. wrote:
> Hi !
>
> I can't install PIL on Python 2.4 ; the soft search Python 2.3 ;
gh
> !
> Do you know if the great F.L. want to make, soon, a P24 version ?

Yes, this kind of thing is stopping me trying 2.4 for a while, as I
need at least py2exe (has a 0.54beta 2.4 version), wxPython 2.5 and
cxFreeze3 for 2.4, and PyQt, Tkinter etc. would be nice too ;-)

--
http://mail.python.org/mailman/listinfo/python-list


Re: installing wxPython on Linux and Windows

2004-12-02 Thread Simon John
I have used the Fedora2 RPM's of wxPython 2.5.3.1 successfully on SUSE
9.1 Pro, 9.2 Pro and SLES 9 (and Fedora 3 for that matter) so you don't
need to get a specific RPM for SUSE.

I even built wxPython 2.5.3.1 with Python 2.4 on Fedora 2 today, it was
not that hard - just followed http://wxpython.org/BUILD.html

I have no way to build it on Windows though, as I don't have Visual C++
7.1, for that we must wait for Robin Dunn.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: exec size

2004-12-03 Thread Simon John
yeah i noticed that when i built it - and strip/upx etc. don't help
much.

i made sure i disabled debugging too.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Jython & IronPython Under Active Development?

2004-12-25 Thread Simon John

Haibao Tang wrote:
> This question may be a bit weird but I really want to know if these
two
> hybrid projects are still active.

they're both by the same guy, and i think jython just had a new
release, although i expect ironpython will turn into microsoft visual
python.net instead of reaching v1.0

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: McMillan Installer vs. Python 2.4

2005-03-30 Thread Simon John
[EMAIL PROTECTED] wrote:

> 1. Does anyone know why McMillan Installer 5b5 does not work with
> Python 2.4 under Linux (works with Python 2.3 just fine), and how to
> fix it?

I expect so.

> 2. Will anyone be picking up the maintenance and development ball for
> McMillan Installer?

There was a 6a2 release for Linux and Windows, but I don't think
anyone's developing it further.

> 3. Is there another, better-supported solution for distributing a
> Python executable under Linux/Unix/AIX?  A single-file solution (ala
> Installer's '--onefile') is a requirement for me.

cx_Freeze is good, but makes multiple files, if you need single file
you could just make the files into an RPM or simply tar.bz2 them up,
then your installation is just one file, extracted to many (still just
one directory)

> 4. Installer supports the use of upx for those platforms that support
> it.  AIX does not.  Does anyone have any other solutions for
> compressing a Python executable which still leaves that executable
> executable?  Believe it or not, the biggest impediment to my using
> Python at work is the enormous size of the executable. (Installing
> Python itself on the target platforms is not allowed).

I don't particularly like the way UPX works, it uses more memory in the
end anyway, and disk space is cheaper. You could use strip and python
--OO to remove docstrings etc.

I've written a couple of pretty complex GUI applications and have never
seen them build to anything more than about 7Mb for wxPython or about
3Mb for PyQt.

You could just distribute the source and use movpy as the interpreter.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: McMillan Installer vs. Python 2.4

2005-03-30 Thread Simon John
[EMAIL PROTECTED] wrote:

[snip]
> First, I got the latest Installer, 6a2, from the Vaults of Parnassus.
> This version is listed as the 'Windows' version.  This means two
> things:  The .py files are sprinkled with DOS-style line endings
> (CR/LF) and file endings (^Z), and the runtime support files for
Linux
> are not prebuilt.

I have a Linux version of 6a2 at
http://www.the-jedi.co.uk/downloads/installer/

Could you build that using 2.4 and see if it works (I'm in the middle
of moving house, so don't have my Linux box to hand)?

It should work out of the box I guess, as I assume the Linux version
already has the carriage returns fixed. I'm not sure what else is
different, but it seems to be about half the size of the Windows one
(also on my website).

[...]
> This takes care of the management roadblock of "Your script is only a
> couple K in length, but you turn in into an executable and it takes
HOW
> MANY meg?!!?  Well, Python is obviously too inefficient for our use."

That's unfortunate. Did they never see a C++ program statically linked
with a few libs that comes to something huge? How big are you typically
looking at?

Maybe you need to explain to them your binary (including interpreter)
is the equivalent of shipping the 20Mb JVM with a Java program, or the
200Mb CLR with a C# program!

> At least, on some platforms.  Sadly, no upx on our main delivery
> platform, which is AIX.  Does anyone know of a better
executable-packer
> for AIX than gzexe?

Don't forget the --strip option in Installer, and call it using 'python
-OO', that will take it down a few Kbytes

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Installing Python 2.4 on Linux

2005-04-05 Thread Simon John
Marcin Stepnicki wrote:

> It's rather Fedora related, I have Python 2.2, 2.3 and 2.4 on my
Ubuntu
> box and they seem to coexist without problems.

It's not a Fedora problem at all.

The 2.4.1 RPM's just move the default /usr/bin/python symlink to point
to the new Python24 instead of Python23 that is the system default. You
can move it back and then just point to it in the shebang in your
scripts (#!/usr/bin/python24)

Or you could compile 2.4 from source as I did, then you won't need to
change symlinks, just install it in /usr/local/bin/python24 or
something. I prefer this method, as it means you can have a seperate
2.4 install of wxPython etc (just change the LD_LIBRARY_PATH).

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: py2exe - create one EXE

2005-04-15 Thread Simon John
yeah, the question does come up once a month at least, but you could
try mcmillan installer with it's --onefile option.

i have mirrors at http://www.the-jedi.co.uk/downloads/installer

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python or PHP?

2005-04-23 Thread Simon John
I've been a PHP and Perl programmer (amongst others) for 10 years or
more now, and a Python coder for 3 or so.

I have come to hate PHP now, it's pseudo-OOP is awful, it's dog slow at
handling XML, it's so easy to use that most of the programmers I've had
contact with are very sloppy and do things like extract($_GET); or put
database usernames and passwords in index.php. I also have to agree
that php.net/manual seems to be the main reference that coders use -
which is not good if the comments are wrong!

Python seems to force you to write better code, maybe because of the
indentation, exception handling, proper OOP etc. Plus it's not so tied
into web stuff, in fact most of my Python programming is for the
desktop.

I still love Perl, it's a bit of an art form, as "there's more than one
way to do it", whereas Python usually only allows one way to do it,
which may or may not be a better mantra

I've come to allocate PHP the same standing as ASP, VB or Java - the
language is OK, but the programmers are usually crap.

-- 
http://mail.python.org/mailman/listinfo/python-list