Re: any() and all() on empty list?

2006-03-30 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Think of it this way: if all(seq) is true, shouldn't it be the case > that you can point to a specific element in seq that is true? No, all(seq) is true if you can't point to a specific element in seq that's false. -- http://mail.python.org/mailman/li

Re: GUI in python

2006-03-30 Thread peter . mosley
See this thread http://groups.google.co.uk/group/comp.lang.python/browse_thread/thread/989b957f244d48e0/429378d911ba4357?hl=en#429378d911ba4357 Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: ldap usage

2006-03-30 Thread Michael Ströder
Jed Parsons wrote: > > As an addendum, I discovered one little gotcha, namely that this: > > l.bind_s(username, password, ldap.AUTH_SIMPLE) > > throws an ldap.INVALID_CREDENTIALS error if the password contains the > wrong text, but works if the password is empty. I guess this is > tantamoun

Re: Free Python IDE ?

2006-03-30 Thread bruno at modulix
Ernesto wrote: > I'm looking for a tool that I can use to "step through" python software > (debugging environment). This is not an 'IDE', it's a debugger. > Is there a good FREE one http://www.python.org/doc/2.4.2/lib/module-pdb.html Strange enough, I almost never had a use for a debugger in

Re: Creating COM server Events?

2006-03-30 Thread Roger Upole
You'll need to implement the IConnectionPoint and IConnectionPointContainer interfaces with your server. See \win32com\demos\connect.py and \win32com\server\connect.py for some sample code. Roger "Dan" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have need to create a com

Re: tkinter question

2006-03-30 Thread Eric Brunel
(Please quote a part of the message you're replying to; I had problems figuring out you were replying to my post...) On 29 Mar 2006 14:08:02 -0800, <[EMAIL PROTECTED]> wrote: > Ultimately what I am trying to is create a public computer session > manager. > > 1) User logs in and main application

Re: does python could support sequence of short or int?

2006-03-30 Thread Diez B. Roggisch
momobear schrieb: > hi, is there a way to let python operate on sequence of int or short? > In C, we just need declare a point, then I could get the point value, > just like: > short* k = buffer, //k is a point to a sequence point of short. > short i = *k++, > but python is a dynamic language, > a

Re: Free Python IDE ?

2006-03-30 Thread Joel Hedlund
Ernesto wrote: > I'm looking for a tool that I can use to "step through" python software > (debugging environment). Is there a good FREE one (or one which is > excellent and moderately priced ) ? > Try searching this newsgroup for "python ide", "editor" and such and you'll get plenty of good ad

Re: win32com: error 80004005

2006-03-30 Thread Roger Upole
The only thing I see wrong is that the Hello method doesn't take any arguments, but the VB code is passing one. It works fine for me if I remove the arg. When registered with --debug, you should still be able to see the output in Pythonwin's trace collector window even when the object is instantiat

Re: GUI in python

2006-03-30 Thread Eric Brunel
On 29 Mar 2006 14:20:03 -0800, <[EMAIL PROTECTED]> wrote: > Hi, > > I am a python newbie and have used it for about a month. I want to make > a simple GUI app in Python ( I take input form user and do processing > and show results). > > Which gui package is good for me. I need to do it quick and I

Re: GUI in python

2006-03-30 Thread Nicolay A. Vasiliev
Hello! I think this library is enough old, isn't it? Version 0.72 was released on 2004-06-20. Nicolay [EMAIL PROTECTED] wrote: > For quick, no learning curve, simple: > > http://www.ferg.org/easygui/ > > -- http://mail.python.org/mailman/listinfo/python-list

Re: Try Python!

2006-03-30 Thread bruno at modulix
Michael Tobis wrote: > We had some discussion of this in the edu-sig meeting at PyCon. > > I alleged that I had read that there is no such thing as a Python > sandbox. And yet Zope 2 has some restricted environment for TTW scripts... -- bruno desthuilliers python -c "print '@'.join(['.'.join([

Re: symbolic links, aliases, cls clear

2006-03-30 Thread Michael Paoli
mp wrote: > i have a python program which attempts to call 'cls' but fails: > sh: line 1: cls: command not found > i'm using os x. [Note Followup-to: severely trimmed] I'd guestimate (those more familiar with python can probably fill in more relevant python specific details) that the python progr

How to run python program on the embeded system?

2006-03-30 Thread boyeestudio
How to run python program on the embeded system? My mobile phone support J2ME,CLDC-1.1,midp-2.0  and I want to let it run python program,but I have no idea how to. Maybe I need write a python compiler which can run on my phone,But it is a complex work. Please help and tell me What can I do,

Re: any() and all() on empty list?

2006-03-30 Thread Steven D'Aprano
Paul Rubin wrote: > Steven D'Aprano <[EMAIL PROTECTED]> writes: > >>Think of it this way: if all(seq) is true, shouldn't it be the case >>that you can point to a specific element in seq that is true? > > > No, all(seq) is true if you can't point to a specific element in seq > that's false. No,

Re: any() and all() on empty list?

2006-03-30 Thread Steven D'Aprano
Duncan Booth wrote: > Ron Adam wrote: > > >>Where we are assembling widgets in a manufacturing plant. Where we don't >>want to go to the next step until *all* the sub parts are present. >> >>if all(part.status == 'present' for part in unit): >> do_release() >> >>Oops! Some empty bins showe

Re: List conversion

2006-03-30 Thread bruno at modulix
yawgmoth7 wrote: > Hello, I have a piece of code: > >command = raw_input("command> ") >words = string.split(command, ' ') >temparg = words >if len(words)<= 3: >temparg = words[4:] >else: >

Re: any() and all() on empty list?

2006-03-30 Thread Carl Banks
Steven D'Aprano wrote: > Paul Rubin wrote: > > > Steven D'Aprano <[EMAIL PROTECTED]> writes: > > > >>Think of it this way: if all(seq) is true, shouldn't it be the case > >>that you can point to a specific element in seq that is true? > > > > > > No, all(seq) is true if you can't point to a specif

Re: any() and all() on empty list?

2006-03-30 Thread Peter Otten
Steven D'Aprano wrote: > Okay, Ron's example wasn't the best. How about this > one, from chess: > > The intention is to play cautiously if all threatened > pieces are valuable, and daringly otherwise. Isn't that example even worse? Compare: - You have one of your valuable pieces threatened. You

Re: dynamic construction of variables / function names

2006-03-30 Thread bruno at modulix
Steven D'Aprano wrote: > Sakcee wrote: > >> python provides a great way of dynamically creating fuctions calls and >> class names from string >> (snip) > Personally, I think the best way is: find another way to solve your > problem. > See Duncan's post for a pretty clean and pythonic solution.

Re: any() and all() on empty list?

2006-03-30 Thread Georg Brandl
Steven D'Aprano wrote: > Paul Rubin wrote: > >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >> >>>Think of it this way: if all(seq) is true, shouldn't it be the case >>>that you can point to a specific element in seq that is true? >> >> >> No, all(seq) is true if you can't point to a specific e

Re: does python could support sequence of short or int?

2006-03-30 Thread bruno at modulix
momobear wrote: > hi, is there a way to let python operate on sequence of int or short? > In C, we just need declare a point, I assume you mean a 'pointer'. > then I could get the point value, > just like: > short* k = buffer, //k is a point to a sequence point of short. > short i = *k++, > but

regular expressions and matches

2006-03-30 Thread Johhny
Hello, I have recently written a small function that will verify that an IP address is valid. ==SNIP== import re ipAddress = raw_input('IP Address : ') def validateIP(ipAddress): ipRegex = r"^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5])\.([

Re: regular expressions and matches

2006-03-30 Thread Fredrik Lundh
"Johhny" wrote: > I was having issues trying to get my code working so that I could pass > the IP addresses and it would return a true or false. When it matches I > get something that looks like this. > > python ip_valid.py > IP Address : 192.158.1.1 > <_sre.SRE_Match object at 0xb7de8c80> > > As

Re: regular expressions and matches

2006-03-30 Thread bruno at modulix
Johhny wrote: > Hello, > > I have recently written a small function that will verify that an IP > address is valid. (snip re.match() based solution - just one remark: compiling the regexp on each function call is more than useless) > I was having issues trying to get my code working so that I c

Re: any() and all() on empty list?

2006-03-30 Thread Ron Adam
Duncan Booth wrote: > Ron Adam wrote: > >> Where we are assembling widgets in a manufacturing plant. Where we don't >> want to go to the next step until *all* the sub parts are present. >> >> if all(part.status == 'present' for part in unit): >> do_release() >> >> Oops! Some empty bins show

Re: does python could support sequence of short or int?

2006-03-30 Thread momobear
but what about buffer is not be declared in python program, it comes from a C function. and what about I want to treat a string as a short list? buffer = foobur() // a invoke from C function, it is encapsulated as a string but I want to treat it as a short list. how can I? -- http://mail.python.

Re: does python could support sequence of short or int?

2006-03-30 Thread bruno at modulix
momobear wrote: > but what about buffer is not be declared in python program, it comes > from a C function. and what about I want to treat a string as a short > list? There are no "short" in Python. An integer is an integer is an integer... > buffer = foobur() // a invoke from C function, it is

Re: does python could support sequence of short or int?

2006-03-30 Thread Fuzzyman
momobear wrote: > hi, is there a way to let python operate on sequence of int or short? > In C, we just need declare a point, then I could get the point value, > just like: > short* k = buffer, //k is a point to a sequence point of short. > short i = *k++, > but python is a dynamic language, > a =

Re: LDTP 0.4.0 released !!!

2006-03-30 Thread Paul Boddie
Ben Finney wrote: > "A Nagappan" <[EMAIL PROTECTED]> writes: > > > Welcome to the seventh issue of LDTP Newsletter! > > Nowhere in this newsletter do I see anything germane to a forum about > Python. Why post it here, rather than somewhere more related to Linux > or Desktops or Testing? > > And no,

Re: Apache and Python and Ubuntu

2006-03-30 Thread Paul Boddie
[EMAIL PROTECTED] wrote: > Thanx a lot for your input and advice. I went through the > documentation on httpd.apache.org/docs/2.2/howto/cgi.html and added the > following: > AddModule cgi-script .cgi .py > > Options +ExecCGI > Does Apache actually support "DIRECTORY" as opposed to "Directory"?

Connecting to gnuplot with Popen?

2006-03-30 Thread Anton81
Hi, it seems to be a FAQ, but I still haven't found a solution. I want to control gnuplot with a python program. The following at least gives me the gnuplot output: subp=Popen("gnuplot",stdin=None,stderr=PIPE,stdout=PIPE) ... subp.stderr.readline() even though I'm not sure how to check if no mor

Re: any() and all() on empty list?

2006-03-30 Thread Ron Adam
Steven D'Aprano wrote: > Paul Rubin wrote: > >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >> >>> Think of it this way: if all(seq) is true, shouldn't it be the case >>> that you can point to a specific element in seq that is true? >> >> >> No, all(seq) is true if you can't point to a specific el

Re: any() and all() on empty list?

2006-03-30 Thread Ron Adam
Ron Adam wrote: > > hasall(S, True, lambda n: n=42) > That was suppose to be: hasall(S, True, lambda n: n==42) -- http://mail.python.org/mailman/listinfo/python-list

Re: any() and all() on empty list?

2006-03-30 Thread Marcin Ciura
Georg Brandl wrote: > Steven D'Aprano wrote: >>all(flying elephants which are pink) => true >>all(flying elephants which are not pink) => true >> >>So, these flying elephants -- are they pink or not? > > No, you ask two different sets whether they are true. No, there is only one empty set. Releva

Re: Connecting to gnuplot with Popen?

2006-03-30 Thread Dan Sommers
On Thu, 30 Mar 2006 12:59:01 +0200, Anton81 <[EMAIL PROTECTED]> wrote: > it seems to be a FAQ, but I still haven't found a solution. I want to > control gnuplot with a python program ... Unfortunately, I don't know how to solve your problem, but try this: http://gnuplot-py.sourceforge.net/

Re: GUI in python

2006-03-30 Thread [EMAIL PROTECTED]
Hi, I readed in python brazilian list, about a Eagle, it's seems like you need... http://www.python.org/pypi/eagle/ http://code.gustavobarbieri.com.br/eagle/ []s Luciano Pacheco -- http://mail.python.org/mailman/listinfo/python-list

Re: any() and all() on empty list?

2006-03-30 Thread Fredrik Lundh
Marcin Ciura wrote: >>>all(flying elephants which are not pink) => true >>> >>>So, these flying elephants -- are they pink or not? >> >> No, you ask two different sets whether they are true. > > No, there is only one empty set. who said anything about empty sets ? -- http://mail.python.org

re.I slowness

2006-03-30 Thread vvikram
We process a lot of messages in a file based on some regex pattern(s) we have in a db. If I compile the regex using re.I, the processing time is substantially more than if I don't i.e using re.I is slow. However, more surprisingly, if we do something on the lines of : s = s = s.lower() t = dict(

Re: regular expressions and matches

2006-03-30 Thread johnzenger
Johhny wrote: > Hello, > > I have recently written a small function that will verify that an IP > address is valid. > > ==SNIP== > > import re > ipAddress = raw_input('IP Address : ') > > def validateIP(ipAddress): > ipRegex = > r"^([01]?\d\d?|2[0-4]\d|25[0-5])\.([01]?\d\d?|2[0-4]\d|25[0-5

Re: Try Python!

2006-03-30 Thread Cyril Bazin
Now, you can try "laszlo in 10 minutes" http://www.laszlosystems.com/lps/laszlo-in-ten-minutes/ . Reference: http://www.openlaszlo.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: i have error then use ftplib

2006-03-30 Thread Stefan Schwarzer
Hello nazarianin, On 2006-03-30 09:35, 5>=>2 ;5:A59 wrote: > from ftplib import FTP > def handleDownload(block): > file.write(block) > print "." > > file = open('1', 'wb') > ftp = FTP('ftp.utk.ru') > ftp.set_pasv(1) > ftp.login() > ftp.retrlines('LIST') > [...] > and have this error mes

Re: does python could support sequence of short or int?

2006-03-30 Thread momobear
then how can I convert it to a int list? I read about struct and array, I think they are not suitable, since I don't know how long will the buffer is. I know if I write a plugins modules in C should works, but that's really upset to tell to myself there is no way in Python. -- http://mail.python.

Re: LDTP 0.4.0 released !!!

2006-03-30 Thread Ben Finney
"Paul Boddie" <[EMAIL PROTECTED]> writes: > Ben Finney wrote: >> "A Nagappan" <[EMAIL PROTECTED]> writes: >> > Welcome to the seventh issue of LDTP Newsletter! >> Nowhere in this newsletter do I see anything germane to a forum >> about Python. Why post it here, rather than somewhere more related >

Re: does python could support sequence of short or int?

2006-03-30 Thread Mirco Wahab
Hi momobear > then how can I convert it to a int list? I read about struct and array, > I think they are not suitable, since I don't know how long will the > buffer is. I know if I write a plugins modules in C should works, but > that's really upset to tell to myself there is no way in Python. th

Re: Looking for a language/framework

2006-03-30 Thread Magnus Lycka
Steve Juranich wrote: > [EMAIL PROTECTED] wrote: > >> As far as hosting, I also know >> where Zope/Plone hosting from 7.95 a month - although the host doesn't >> list it on their ads, they do use and host it. > > Which host would this be? I'm currently exploring some options for getting > a Zope

Set Windows Environment Variable

2006-03-30 Thread Fuzzyman
Hello all, I would like to set a Windows Environment variable for another (non-child) process. This means that the following *doesn't* work : :: os.environ['NAME'] = value In the ``win32api`` package there is a ``GetEnvironmentVariable`` function, but no ``SetEnvironmentVariable``. Any opti

Re: does python could support sequence of short or int?

2006-03-30 Thread Diez B. Roggisch
momobear wrote: > then how can I convert it to a int list? I read about struct and array, > I think they are not suitable, since I don't know how long will the > buffer is. I know if I write a plugins modules in C should works, but > that's really upset to tell to myself there is no way in Python.

Low Pass Hamming filter design

2006-03-30 Thread LabWINC
Hi all, i have a question for all :-D I would like to design and apply a FIR low pass filter with Hamming window. I'm using scipy module. First I create the windows with the signal.firwin function and after i apply this window to my signal with the signal.lfilter function. I didn't understand wh

Re: Set Windows Environment Variable

2006-03-30 Thread Duncan Booth
Fuzzyman wrote: > Hello all, > > I would like to set a Windows Environment variable for another > (non-child) process. > > This means that the following *doesn't* work : :: > > os.environ['NAME'] = value > > In the ``win32api`` package there is a ``GetEnvironmentVariable`` > function, but

Re: New Python website, new documentation ?

2006-03-30 Thread Tim Parkin
[EMAIL PROTECTED] wrote: >Hi, > >I was wondering : as there has been a change in python.org website with >a new design, is it planned for the documentation section to be >revamped as well ? If yes, would it be just a appearance renewal or >would there also be changes in the doc itself ? > >Martin.

Countdown from 2 minutes - how?

2006-03-30 Thread [EMAIL PROTECTED]
Hi. Can anyone tell me the python code for a simple countdown from eg. 2.00 minutes. It should be printet out to the screen. When it is finished it should write "Time is up" Hope you can help. Henrik -- http://mail.python.org/mailman/listinfo/python-list

Re: does python could support sequence of short or int?

2006-03-30 Thread Richard Brodie
"momobear" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > then how can I convert it to a int list? I read about struct and array, > I think they are not suitable, since I don't know how long will the > buffer is. I know if I write a plugins modules in C should works, but > that's

Non-GUI source code browser with file system tree view

2006-03-30 Thread Stefan Schwarzer
Hello, from time to time I want to inspect the source code of projects on remote computers.(*) I've googled for one or two hours but didn't find anything helpful. :-/ I'm looking for something like IDLE's path browser - i. e. a tree view and file view side-by-side - but with the following differen

ANN: pywinauto 0.3.1 released - Performance tune-ups

2006-03-30 Thread mark . m . mcmahon
Hi, The 0.3.1 release of pywinauto is now available. pywinauto is a set of open-source (LGPL) modules for using Python as a GUI automation 'driver' for Windows NT based Operating Systems (NT/W2K/XP). SourceForge project page: http://sourceforge.net/projects/pywinauto Download from SourceForge h

Re: Non-GUI source code browser with file system tree view

2006-03-30 Thread Fredrik Lundh
Stefan Schwarzer wrote: > (*) Copying the files to the local host is probably rather > impractical because the files sometimes change very frequently. do lots of files change very frequently, or just a small number ? if the latter, I doubt you'll be able to beat rsync+local browsing. -- h

Re: New Python website, new documentation ?

2006-03-30 Thread Armin Ronacher
I paste my idea (original posted in #pythonpaste a few days ago): Chairos: what I really miss is a "go-python.org" page :) which would be what? showing up python gui application, python wsgi applications, a python documentation with a comment section, tutorials and a wiki and everything compac

Re: Countdown from 2 minutes - how?

2006-03-30 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Can anyone tell me the python code for a simple countdown from eg. 2.00 > minutes. > > It should be printet out to the screen. > When it is finished it should write "Time is up" here's a first version: import time time.sleep(2*60) print "Time is up" to imp

Stackless Python for 2.4.3

2006-03-30 Thread Richard Tew
Hi, Stackless Python is now available for the recent release of Python 2.4.3 (final). You can either obtain the source code from the SVN repository or download the precompiled windows binaries. SVN:http://codespeak.net/svn/stackless/Python-2.4.3/dev Download: http://www.stackless.com/dow

How to determine an object is "scriptable"

2006-03-30 Thread abcd
I recently came across a problem where I saw this error: "TypeError: unsubscriptable object" How can I determine if an object is "scriptable" or "unscriptable"? -- http://mail.python.org/mailman/listinfo/python-list

Re: Countdown from 2 minutes - how?

2006-03-30 Thread Fuzzyman
[EMAIL PROTECTED] wrote: > Hi. > > Can anyone tell me the python code for a simple countdown from eg. 2.00 > minutes. > > It should be printet out to the screen. > When it is finished it should write "Time is up" > > Hope you can help. > You need the module ``time`` : import time start = time.ti

Re: Doc suggestions (was: Why "class exceptions" are not deprecated?)

2006-03-30 Thread Fredrik Lundh
Ed Singleton wrote: > I'd suggest adding some sort of guidance page so that people know > roughly what's expected. IE can they just add questions and comments > into the text, hoping that someone more knowledgeable will sort it out > (or delete it). I've added some notes to the front-page. feel

Re: any() and all() on empty list?

2006-03-30 Thread Antoon Pardon
Op 2006-03-30, Steven D'Aprano schreef <[EMAIL PROTECTED]>: > Paul Rubin wrote: > >> Steven D'Aprano <[EMAIL PROTECTED]> writes: >> >>>Think of it this way: if all(seq) is true, shouldn't it be the case >>>that you can point to a specific element in seq that is true? >> >> >> No, all(seq) is tru

Re: Python Debugger / IDE ??

2006-03-30 Thread Magnus Lycka
Don Taylor wrote: > Is there a free or low-cost version of Delphi for Windows available > anywhere? Sure. If my memory serves me correctly, I have several CDs from various computer magazines with previous versions of Delphi at home. I don't know if such offers have been around recently, but you

Re: Stackless Python for 2.4.3

2006-03-30 Thread Fuzzyman
Richard Tew wrote: > Hi, > > Stackless Python is now available for the recent release of Python > 2.4.3 (final). > Does anyone happen to know if Stackless Python is compatible with existing third party extension modules (like e.g. Tkinter and wxPython) ? I'm afraid my internet connection here is

Re: How to determine an object is "scriptable"

2006-03-30 Thread Richard Brodie
"abcd" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I recently came across a problem where I saw this error: > "TypeError: unsubscriptable object" > > How can I determine if an object is "scriptable" or "unscriptable"? subscriptable: supports an indexing operator, like a list do

Re: Looking for a language/framework

2006-03-30 Thread [EMAIL PROTECTED]
Actually I recently went from a managed hosting to a virtual host via XEN, it's been great value for the cost -- http://mail.python.org/mailman/listinfo/python-list

Re: How to determine an object is "scriptable"

2006-03-30 Thread abcd
Richard Brodie wrote: > subscriptable: supports an indexing operator, like a list does. doesn't seem to be a builtin function or module...or is that just your definition of subscriptable? -- http://mail.python.org/mailman/listinfo/python-list

Re: re.I slowness

2006-03-30 Thread Paul McGuire
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > We process a lot of messages in a file based on some regex pattern(s) > we have in a db. > If I compile the regex using re.I, the processing time is substantially > more than if I > don't i.e using re.I is slow. > > However, more surpris

Re: How to determine an object is "scriptable"

2006-03-30 Thread Larry Bates
abcd wrote: > I recently came across a problem where I saw this error: > "TypeError: unsubscriptable object" > > How can I determine if an object is "scriptable" or "unscriptable"? > Simplest answer is to use isinstance to see if it is a string, list, or tuple: if isinstance(variable, (str, list

Re: a hobbyist's dilemma

2006-03-30 Thread Benny
John Salerno wrote: > Anyway, any suggestions are appreciated! What've you got for hobbies? As my first Python based project I wrote something that put up a GUI and allowed me to add and delete records in a file so that I could catalogue my model railway collection. Now I could have used a dB pa

Re: How to determine an object is "scriptable"

2006-03-30 Thread Daniel Evers
Richard Brodie wrote: > subscriptable: supports an indexing operator, like a list does. Right. You can check this e.g. with hasattr(x, "__getitem__") because the __getitem__ method is used for indexing. Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Non-GUI source code browser with file system tree view

2006-03-30 Thread bruno at modulix
Stefan Schwarzer wrote: > Hello, > > from time to time I want to inspect the source code of projects > on remote computers.(*) I've googled for one or two hours but > didn't find anything helpful. :-/ I'm looking for something like > IDLE's path browser - i. e. a tree view and file view > side-by-

Re: How to determine an object is "scriptable"

2006-03-30 Thread abcd
Daniel Evers wrote: > Right. You can check this e.g. with > > hasattr(x, "__getitem__") > > because the __getitem__ method is used for indexing. Thanks...that is what I was looking for! -- http://mail.python.org/mailman/listinfo/python-list

Re: Countdown from 2 minutes - how?

2006-03-30 Thread preved . rly
#!/bin/env python # countdown.py import time import doctest def countdown( time_in_minutes): """ >>> import countdown >>> countdown.countdown(0.1) # doctest:+ELLIPSIS 6 5 ... 1 Time is up """ for i in reversed(xrange(1, int(time_in_minutes * 60) + 1)):

Re: Countdown from 2 minutes - how?

2006-03-30 Thread preved . rly
#!/bin/env python # countdown.py import time import doctest def countdown( time_in_minutes): """ >>> import countdown >>> countdown.countdown(0.1) # doctest:+ELLIPSIS 6 5 ... 1 Time is up """ for i in xrange(int(time_in_minutes * 60 + 0.5), 0, -1):

Re: Why are so many built-in types inheritable?

2006-03-30 Thread Antoon Pardon
Op 2006-03-28, Georg Brandl schreef <[EMAIL PROTECTED]>: > Fabiano Sidler wrote: >> I really wanted to learn the reason for this, nothing else! ;) > > I suspect performance reasons. Can't give you details but function > is used so often that it deserves special treatment. I would find this a bit o

Re: How to determine an object is "scriptable"

2006-03-30 Thread bruno at modulix
Larry Bates wrote: > abcd wrote: > >>I recently came across a problem where I saw this error: >>"TypeError: unsubscriptable object" >> >>How can I determine if an object is "scriptable" or "unscriptable"? >> > > Simplest answer is to use isinstance to see if it is a string, list, > or tuple: > >

Re: How to determine an object is "scriptable"

2006-03-30 Thread Richard Brodie
"abcd" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > doesn't seem to be a builtin function or module...or is that just your > definition of subscriptable? Yes, I figured you were just confused. You were using the wrong words, after all. -- http://mail.python.org/mailman/list

Re: How to determine an object is "scriptable"

2006-03-30 Thread bruno at modulix
abcd wrote: > Richard Brodie wrote: > >>subscriptable: supports an indexing operator, like a list does. > > doesn't seem to be a builtin function or module... It's not. Look no further. > or is that just your > definition of subscriptable? It's a correct definition of 'subscriptable' in the c

Re: Stackless Python for 2.4.3

2006-03-30 Thread Stephan Diehl
On Thu, 30 Mar 2006 06:04:27 -0800, Fuzzyman wrote: > > Richard Tew wrote: >> Hi, >> >> Stackless Python is now available for the recent release of Python >> 2.4.3 (final). >> > > Does anyone happen to know if Stackless Python is compatible with > existing third party extension modules (like e.g

Re: Why are so many built-in types inheritable?

2006-03-30 Thread Georg Brandl
Antoon Pardon wrote: > Op 2006-03-28, Georg Brandl schreef <[EMAIL PROTECTED]>: >> Fabiano Sidler wrote: >>> I really wanted to learn the reason for this, nothing else! ;) >> >> I suspect performance reasons. Can't give you details but function >> is used so often that it deserves special treatment

Re: Why are so many built-in types inheritable?

2006-03-30 Thread Michele Simionato
I cannot find the reference now, but I remember Tim Peters saying some time ago that the only reason why FunctionType is not subclassable is that nobody bothered to write a patch for it. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: does python could support sequence of short or int?

2006-03-30 Thread Magnus Lycka
momobear wrote: > hi, is there a way to let python operate on sequence of int or short? If you want to work with arrays of numbers, you might want to look at NumArray etc. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to determine an object is "scriptable"

2006-03-30 Thread bruno at modulix
abcd wrote: > I recently came across a problem where I saw this error: > "TypeError: unsubscriptable object" > > How can I determine if an object is "scriptable" or "unscriptable"? By trying to apply the subscript operator ('[]'). If it raises a TypeError, then it's not subscriptable. But, as La

Re: Apache and Python and Ubuntu

2006-03-30 Thread msuemnig
Paul, thank you so much for your information and help! That was exactly the issue. I added ExecCGI and addHandler cgi-script .cgi to the sites-available/default file and bounce the service and it's working! Thanx again! -- http://mail.python.org/mailman/listinfo/python-list

Re: a hobbyist's dilemma

2006-03-30 Thread John Salerno
Benny wrote: > John Salerno wrote: > >> Anyway, any suggestions are appreciated! > > What've you got for hobbies? Hmm, my hobbies...well, programming for one. :) Also literature and anything computer-related. I suppose I could try to catalog some books. One like I'd like to learn is how to us

Re: Stackless Python for 2.4.3

2006-03-30 Thread Richard Tew
I would just like to clarify, the windows specific paths do not imply that Stackless compiles only on Windows, or that the tests being run on Windows is all I am interested in. Stackless compiles on a range of non-Windows platforms, including x86 linux, mac os and others. And knowing the port wor

Re: RELEASED Python 2.4.3, final.

2006-03-30 Thread John Salerno
Anthony Baxter wrote: > On behalf of the Python development team and the Python community, > I'm happy to announce the release of Python 2.4.3 (final). Thanks! > Assuming no major bugs pop up, the next release of Python will > be Python 2.5 (alpha 1), with a final 2.4.4 release of Python > shor

Re: RELEASED Python 2.4.3, final.

2006-03-30 Thread Gerhard Häring
John Salerno wrote: > Anthony Baxter wrote: >>On behalf of the Python development team and the Python community, >>I'm happy to announce the release of Python 2.4.3 (final). > > Thanks! > >>Assuming no major bugs pop up, the next release of Python will >>be Python 2.5 (alpha 1), with a final 2.4.

Re: RELEASED Python 2.4.3, final.

2006-03-30 Thread Fredrik Lundh
John Salerno wrote: > > Assuming no major bugs pop up, the next release of Python will > > be Python 2.5 (alpha 1), with a final 2.4.4 release of Python > > shortly after the final version of Python 2.5. > > Why would 2.4.4 come out after the final release of 2.5? the 2.X.Y releases are bugfix re

Re: a hobbyist's dilemma

2006-03-30 Thread benchline
Since you want to learn to use python with a database you may want to try it with SQLite. SQLite is a very easy to use database that stores the whole database in one file. Working with it would be very similar to working with Mysql through python. http://www.sqlite.org http://initd.org/tracker/p

printing under MS win

2006-03-30 Thread Dean Allen Provins
Hi: My Linux-based Python/Tkinter application runs nicely, and printing works just fine (to a user-selected file, or an "lpr" device specified in the Entry box). Alas, the user wants to run it under MS Win, and of course will want to print the canvas for posterity. A Google search turned up a si

Re: a hobbyist's dilemma

2006-03-30 Thread John Salerno
benchline wrote: > Since you want to learn to use python with a database you may want to > try it with SQLite. SQLite is a very easy to use database that stores > the whole database in one file. Working with it would be very similar > to working with Mysql through python. > > http://www.sqlite.o

Re: Doc suggestions (was: Why "class exceptions" are not deprecated?)

2006-03-30 Thread Gerard Flanagan
Fredrik Lundh wrote: > Ed Singleton wrote: > > > I'd suggest adding some sort of guidance page so that people know > > roughly what's expected. IE can they just add questions and comments > > into the text, hoping that someone more knowledgeable will sort it out > > (or delete it). > > I've added

Re: RELEASED Python 2.4.3, final.

2006-03-30 Thread John Salerno
Fredrik Lundh wrote: > John Salerno wrote: > >>> Assuming no major bugs pop up, the next release of Python will >>> be Python 2.5 (alpha 1), with a final 2.4.4 release of Python >>> shortly after the final version of Python 2.5. >> Why would 2.4.4 come out after the final release of 2.5? > > the

Re: a hobbyist's dilemma

2006-03-30 Thread Fredrik Lundh
John Salerno wrote: > One like I'd like to learn is how to use Python with MySQL, but I just > can't get MySQL to work on my computer, so I'm at a dead end there. > Seems like the best option for cataloging though. if you want to play with SQL and Python's DB-API *without* having to install serve

Re: Set Windows Environment Variable

2006-03-30 Thread Magnus Lycka
Duncan Booth wrote: > Fuzzyman wrote: >> In the ``win32api`` package there is a ``GetEnvironmentVariable`` >> function, but no ``SetEnvironmentVariable``. Any options ? > > No, your only option is to find a solution which doesn't involve changing > another process's environment. Surely there mus

Re: does python could support sequence of short or int?

2006-03-30 Thread Magnus Lycka
momobear wrote: > but what about buffer is not be declared in python program, it comes > from a C function. and what about I want to treat a string as a short > list? Python is a high level language with much stronger typing than C. If you want a list of integers, use a list of integers. Strings a

Re: Validating Syntax only with PyParser_SimpleParseString ?

2006-03-30 Thread gaston . gloesener
Thanks for th eanswers so far. But as you can see from the function I use, I do need an interface function to do th ejob from C++. I canno timagine there is no clean way to do this. Calling th epython interpreter to execute a compule function in python and then get the output parsed to get th eerr

  1   2   3   >