Re: About alternatives to Matlab

2006-11-29 Thread aap

John Henry wrote:
> Bill Gates will have you jailed! :-)
>
> On a more serious note, is there any alternative to Simulink though?
>
It's called SciCos, and as far as I've seen it not only covers Simulink
but also PowerSim.

I found only 1 major disadvantage inSciLab, ...
... it has no ActiveX

cheers,
Stef Mientki

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


Re: py2exe / Tkinter problem

2006-12-06 Thread Kleine Aap
[EMAIL PROTECTED] wrote:

> I've got a python GUI working with Tkinter, and I need to package it as
> an executable file, preferably a single file. 

Why not use an installer to bundle the python interpreter (with TKinter) and
your code in a single executable file? If you don't want to distribute
source code then .pyc or .pyo files can be used?

An example of (freeware) installer software:

http://www.jrsoftware.org/isinfo.php
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: True Division in Python

2006-12-06 Thread Kleine Aap
[EMAIL PROTECTED] wrote:

> Use ./ for true division.

syntax error...

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


Re: (newbie) class with a single instance ?!

2006-12-15 Thread Kleine Aap
Andrea Tomadin wrote:

> This works, but isn't it weird to define a class if I know from the
> very beginning that there will be no more than an instance of that
> class?

Singleton

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52558
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Control-C alternative in Windows

2006-12-17 Thread Kleine Aap
Vlad Dogaru wrote:

> I've written a simple, standalone wiki server in Python. It runs a
> BaseHTTPServer's serve_forever() method until a KeyboardInterrupt is
> caught, at which point it writes changes to a file and exits. This
> works as expected in Linux. However, in Windows I cannot stop the
> script with Control-C. I've only been able to stop it with Ctrl-Break,
> which does not send KeyboardInterrupt. This means no saving to the file
> and effectively a useless script. Any ideas as to how I might make this
> work in Windows?

(http://www.python.org/download/releases/2.2.2/NEWS.txt):

The signal module now supports SIGBREAK on Windows, thanks to Steven
Scott.  Note that SIGBREAK is unique to Windows.  The default SIGBREAK
action remains to call Win32 ExitProcess().  This can be changed via
signal.signal().  For example:

# Make Ctrl+Break raise KeyboardInterrupt, like Python's default Ctrl+C
# (SIGINT) behavior.
import signal
signal.signal(signal.SIGBREAK,
  signal.default_int_handler)

try:
while 1:
pass
except KeyboardInterrupt:
# We get here on Ctrl+C or Ctrl+Break now; if we had not changed
# SIGBREAK, only on Ctrl+C (and Ctrl+Break would terminate the
# program without the possibility for any Python-level cleanup).
print "Clean exit"
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: regular expression

2006-12-19 Thread Kleine Aap
Asper Faner wrote:

> I seem to always have hard time understaing how this regular expression
> works, especially how on earth do people bring it up as part of
> computer programming language. Natural language processing seems not
> enough to explain by the way. Why no eliminate it ?

I.M.H.O. anyone that is not capable to grasp the concept of regular
expressions should not attempt to write computer programs at all! My
suggestion to you would be to find a job that involves working with your
hands...

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