Re: python for *nix system admins

2008-09-28 Thread Lars Stavholm
Thank you all for your input. /Lars Lars Stavholm wrote: > Hi All, > > I'm new to this list and hoping that this is not off-topic. > If it is, please point me in the right direction. > > I seem to recollect a python module or library for *nix sysadmins, > but I can't for the life of me find it a

Re: how to make smtplib.SMTP('localhost') work on window xp

2008-09-28 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, zxo102 wrote: > SMTPServerDisconnected: Connection unexpectedly closed Does the SMTP server on localhost mention anything about the connection attempt in its log? If you telnet/netcat to port 25 on localhost, does anything interesting happen? -- http://mail.python

Re: closures and dynamic binding

2008-09-28 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Aaron "Castironpi" Brady wrote: > [Wikipedia] says: > "dynamic scoping can be dangerous and almost no modern languages use > it", but it sounded like that was what closures use. Closures will use whatever the language says they use. LISP used dynamic binding, but t

Cannot install pysqlite on Cygwin

2008-09-28 Thread Tilman Kispersky
I am trying to install sqlite for use with python on cygwin. I have installed the sqlite packages from cygwin (that is libsqlite3-devel and libsqlite3_0). When attempting to easy_install pysqlite I get: $ easy_install pysqlite Searching for pysqlite Reading http://pypi.python.org/simple/pysqlite/

Re: Web programming in Python.

2008-09-28 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, Sean DiZazzo wrote: > Have you loaded the modpython module in your httpd.conf? Not relevant for CGIs. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is not objects in Python?

2008-09-28 Thread Carl Banks
On Sep 29, 1:44 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Sep 29, 12:08 am, Terry Reedy <[EMAIL PROTECTED]> wrote: > > > > > George Sakkis wrote: > > > On Sep 28, 2:29 pm, process <[EMAIL PROTECTED]> wrote: > > > >> I have heard some criticism about Python, that it is not fully object- > >

Re: Test if list contains another list

2008-09-28 Thread Derek Martin
On Fri, Sep 26, 2008 at 01:39:16PM -0700, [EMAIL PROTECTED] wrote: > # building prefix-function > m = 0 > for i in xrange(1, len_sub): > while m > 0 and sub[m] != sub[i]: > m = table[m - 1] > if sub[m] == sub[i]: > m += 1 > table[i] = m >

Re: Web programming in Python.

2008-09-28 Thread Sean DiZazzo
On Sep 28, 4:51 pm, Kurda Yon <[EMAIL PROTECTED]> wrote: > 1. On my server (in my directory) I found "cgi-bin" subdirectory. > > 2. In the "cgi-bin" I have created a file "test.py". > > 3. In that file I put: > #!/usr/bin/python2.4 python > print "Hello, World!" > (I have checked, I have "/usr/bin/

Re: Web programming in Python.

2008-09-28 Thread James Matthews
If you are considering using a framework try Django. I enjoy using it! On Sun, Sep 28, 2008 at 6:40 PM, Michael Crute <[EMAIL PROTECTED]> wrote: > On Sun, Sep 28, 2008 at 6:39 PM, Kurda Yon <[EMAIL PROTECTED]> wrote: > > I am totaly newbie in the Python's web programming. So, I dont even > > know

Re: What is not objects in Python?

2008-09-28 Thread George Sakkis
On Sep 29, 12:08 am, Terry Reedy <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > On Sep 28, 2:29 pm, process <[EMAIL PROTECTED]> wrote: > > >> I have heard some criticism about Python, that it is not fully object- > >> oriented. > > > That's not a bug, it's a feature ;-) > > >> Why isn't len

Parser Module

2008-09-28 Thread aditya shukla
Hello folks , I wanna create a parser for newick files which generates an ultrametric tree -> every leaf is equidistant from the root eg ->( http://www.icp.be/~opperd/private/upgma.html) as the parse tree.Can this type of a parse tree be constructe

Looking for a Python developer in Austin

2008-09-28 Thread johnc
I’m looking for a python guru to help me and my company grow in this language area. We are native to .net but have found ourselves with a larger python perl project that needs some really good team members. Because this is not our core language I want to make sure this is a good fit. I can discuss

Reportlab - Splitting table by column

2008-09-28 Thread raj
My Zope based application for a client has to generate annual audit reports with too wide tables of account-wise payment details. I turned to reportlab when HTML formatting became a headache for me. Reportlab doc claims it can split by row as well as column but doesn't explain how to. Then I came t

Re: What is not objects in Python?

2008-09-28 Thread Terry Reedy
George Sakkis wrote: On Sep 28, 2:29 pm, process <[EMAIL PROTECTED]> wrote: I have heard some criticism about Python, that it is not fully object- oriented. That's not a bug, it's a feature ;-) Why isn't len implemented as a str.len and list.len method instead of a len(list) function? As

Re: closures and dynamic binding

2008-09-28 Thread Terry Reedy
Aaron "Castironpi" Brady wrote: On Sep 28, 4:47 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: Aaron "Castironpi" Brady wrote: inner = lambda: n when inner is actually compiled outside of outer, it is no longer a closure over outer's 'n' and 'n' will be looked for in globals instead. outer = l

Re: urllib2 and exceptions

2008-09-28 Thread robean
On Sep 28, 5:33 pm, alex23 <[EMAIL PROTECTED]> wrote: > On Sep 29, 5:52 am, robean <[EMAIL PROTECTED]> wrote: > > > Actually, the problem seems to be that IOError is in my namespace, but > > the other error classes are not. So, > > >    except HTTPError, etc. > > > fails, but > > >    except urllib

Re: Web programming in Python.

2008-09-28 Thread Michael Crute
On Sun, Sep 28, 2008 at 6:39 PM, Kurda Yon <[EMAIL PROTECTED]> wrote: > I am totaly newbie in the Python's web programming. So, I dont even > know the basic conceptions (but I have ideas about php-web- > programming). Does it work in a similar way? First, I have to install > a Python-server? There

EARN $$$ IN EVERY MONTH.

2008-09-28 Thread chinu
hai, i am srinu from india. i am sending a blog url for yours use. click on the blog and get more information to choose yours job. the blog url is: http://earnmonthlyincome.blogspot.com/ goodluck -- http://mail.python.org/mailman/listinfo/python-list

Re: standalone buildbot possible/ don't have a remote

2008-09-28 Thread Jean-Paul Calderone
On Sun, 28 Sep 2008 12:15:50 -0700 (PDT), mark <[EMAIL PROTECTED]> wrote: I want to start small and setup a buildbot on one machine (no slaves). I hope this is possible. I assume I only need one master in this case (without slave config)??? from my master.cfg c['slaves'] = [] ... (rest of the s

Re: Hello boys!

2008-09-28 Thread D'Arcy J.M. Cain
On Sat, 27 Sep 2008 18:47:16 -0400 default <[EMAIL PROTECTED]> wrote: > On Sat, 27 Sep 2008 14:56:07 -0700 (PDT), Milenko Stojadinovic Cvrcko > <[EMAIL PROTECTED]> wrote: > > >Hello, this is Milenko Stojadinovic from town Banjaluka, > > Come to the US and park your mouth in front of George Bush -

Re: Odd Errors

2008-09-28 Thread Nathan Seese
> On Sep 28, 7:13 pm, alex23 <[EMAIL PROTECTED]> wrote: >> The problem is with this: >> >> >         lines = lines.append(inLine) >> >> The append method of a list modifies the list in-place, it doesn't >> return a copy of the list with the new element appended. In fact, it >> returns None, which i

Re: Python 3.0 and repr

2008-09-28 Thread Mark Tolonen
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] What are others' opinions? Any insight to this design decision? The intention is that all printable characters in a string get displayed in repr. This was in particular requested by Japanese users (but also by ot

Re: Odd Errors

2008-09-28 Thread alex23
"Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > Do you ever want to scream from the rooftops, "'append' operates by > side-effect!"? "I'm mad as hell, and I'm not going to mutate in-place anymore!" -- http://mail.python.org/mailman/listinfo/python-list

Re: urllib2 and exceptions

2008-09-28 Thread alex23
On Sep 29, 5:52 am, robean <[EMAIL PROTECTED]> wrote: > Actually, the problem seems to be that IOError is in my namespace, but > the other error classes are not. So, > >    except HTTPError, etc. > > fails, but > >    except urllib2.HttpError, etc. > > works fine. Now, I still don't understand why

Re: Odd Errors

2008-09-28 Thread Aaron "Castironpi" Brady
On Sep 28, 7:13 pm, alex23 <[EMAIL PROTECTED]> wrote: > The problem is with this: > > >         lines = lines.append(inLine) > > The append method of a list modifies the list in-place, it doesn't > return a copy of the list with the new element appended. In fact, it > returns None, which it then at

Re: Not fully OO ?

2008-09-28 Thread Aaron "Castironpi" Brady
On Sep 28, 4:41 pm, "Tim Rowe" <[EMAIL PROTECTED]> wrote: > 2008/9/28 Aaron Castironpi Brady <[EMAIL PROTECTED]>: > > > Before I tried wxFormBuilder, I imagined that C# would be vastly > > faster to develop than Python, for anything requiring any non-trivial > > graphical interface.  I've done exte

Re: Spring Python 0.7.0 is released

2008-09-28 Thread Ph.T
the spring framework comes to python? http://forum.springframework.org/ http://springpython.webfactional.com/ http://sourceforge.net/projects/springpython/ http://en.wikipedia.org/wiki/Spring_Python On Thu, Sep 25, 2008 at 4:21 AM, Goldfish <[EMAIL PROTECTED]> wrote: > Release 0.7.0 was complete

Re: Odd Errors

2008-09-28 Thread alex23
The problem is with this: >         lines = lines.append(inLine) The append method of a list modifies the list in-place, it doesn't return a copy of the list with the new element appended. In fact, it returns None, which it then attaches the label 'lines' to, so the next iteration through it trie

Re: Not fully OO ?

2008-09-28 Thread Patrick Mullen
On Fri, Sep 26, 2008 at 1:11 PM, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Steven D'Aprano a écrit : >> >> On Fri, 26 Sep 2008 17:00:59 +0200, Bruno Desthuilliers wrote: >> >>> Patrick Mullen a écrit : Depending on the scale of the website I am making, how much I care about

Re: [wxpython-users] ANN: wxPython 2.8.9.0

2008-09-28 Thread Clay Hobbs
On Sun, 2008-09-28 at 12:01 -0700, Robin Dunn wrote: > Announcing > -- > > The 2.8.9.0 release of wxPython is now available for download at > http://wxpython.org/download.php. This release adds support for using > Cairo for drawing on wx windows, adds a Win64 build, and various other > f

Odd Errors

2008-09-28 Thread Nathan Seese
When I run: #!/usr/bin/python lines = list() while 1: try: inLine = raw_input() lines = lines.append(inLine) except EOFError: break I get: Traceback (most recent call last): File "./foobar.py", line 7, in lines = lines.append(inLine) AttributeError: 'NoneTyp

Re: Web programming in Python.

2008-09-28 Thread Kurda Yon
1. On my server (in my directory) I found "cgi-bin" subdirectory. 2. In the "cgi-bin" I have created a file "test.py". 3. In that file I put: #!/usr/bin/python2.4 python print "Hello, World!" (I have checked, I have "/usr/bin/python2.4" directory.) 4. I give the following permissions to the "tes

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-28 Thread Michael Mabin
Sadly no. There is no utterance too inconsequential. On Sun, Sep 28, 2008 at 3:10 PM, Steve Holden <[EMAIL PROTECTED]> wrote: > Michael Mabin wrote: > > Tino, dude, I'm afraid I lied about my previous post being the last > > word. There are some things you said here that must be addressed. > >

Re: What is not objects in Python?

2008-09-28 Thread George Sakkis
On Sep 28, 2:29 pm, process <[EMAIL PROTECTED]> wrote: > I have heard some criticism about Python, that it is not fully object- > oriented. That's not a bug, it's a feature ;-) > Why isn't len implemented as a str.len and list.len method instead of > a len(list) function? As Terry Reedy wrote,

Re: What is not objects in Python?

2008-09-28 Thread Carl Banks
On Sep 28, 2:29 pm, process <[EMAIL PROTECTED]> wrote: > Why isn't len implemented as a str.len and list.len method instead of > a len(list) function? Although len() is spelled like a function call, in spirit it's an operator, and it behaves like any other operator in Python. Never mind why len()

Re: str() should convert ANY object to a string without EXCEPTIONS !

2008-09-28 Thread Lawrence D'Oliveiro
In message <[EMAIL PROTECTED]>, est wrote: > Well, you succeseded in putting all blame to myself alone. Great. Take it as a hint. > When you guy's are dealing with CJK characters in the future, you'll > find out what I mean. Speaking as somebody who HAS dealt with CJK characters in the past--se

Re: closures and dynamic binding

2008-09-28 Thread Aaron "Castironpi" Brady
On Sep 28, 4:47 pm, Terry Reedy <[EMAIL PROTECTED]> wrote: > Aaron "Castironpi" Brady wrote: > > On Sep 28, 2:52 am, Steven D'Aprano <[EMAIL PROTECTED] > >> As for why the complicated version works, it may be clearer if you expand > >> it from a one-liner: > > >> # expand: f[ n ]= (lambda n: ( lamb

Re: closures and dynamic binding

2008-09-28 Thread Steven D'Aprano
On Sun, 28 Sep 2008 17:47:44 -0400, Terry Reedy wrote: > Aaron "Castironpi" Brady wrote: >> On Sep 28, 2:52 am, Steven D'Aprano <[EMAIL PROTECTED] > >>> As for why the complicated version works, it may be clearer if you >>> expand it from a one-liner: >>> >>> # expand: f[ n ]= (lambda n: ( lambda

Milenko Kindl tterter

2008-09-28 Thread sdsdvfsdf
WASHINGTON - Congressional leaders and the White House agreed Sunday to a $700 billion rescue of the ailing financial industry after lawmakers insisted on sharing spending controls with the Bush administration. The biggest U.S. bailout in history won the tentative support of both presidential candi

privatdetektei detektei central privat detektei frankfurt private detective privatdetektiv in berlin

2008-09-28 Thread webilix950
privatdetektei detektei central privat detektei frankfurt private detective privatdetektiv in berlin + + + + +++ DETEKTEIEN DETEKTIVE ONLINE +++ DETEKTEI HAMBURG +++ PRIVATDETEKTIVE +++ + + http://WWW.DETEKTEI-DETEKTIV.NET http://WWW.DETEKTEI-DETEKTIV.NET http://WWW.DETEKTEI-DETEKTIV.NET http://WW

Web programming in Python.

2008-09-28 Thread Kurda Yon
Hi, I am totaly newbie in the Python's web programming. So, I dont even know the basic conceptions (but I have ideas about php-web- programming). Does it work in a similar way? First, I have to install a Python-server? On the server where I have my web site (it runs under Linux) if I type "python

rlcompleter and wxPython, problems ...

2008-09-28 Thread Stef Mientki
hello, I'm trying to implement autocompletion into my editor. But I find some weird behavior, or at least I don't have the faintest idea why this behavior occures, and even more important how to solve it In the example below I try to autocomplete " wx.s" , which in my humble opinion should at

Re: generate random digits with length of 5

2008-09-28 Thread bearophileHUGS
Tim Chase: > I suspect that the zfill responses don't have the property of equally > distributed "randomness", as the first digit may more likely be a zero. This code I have shown before: str(randrange(10)).zfill(5) If the numbers are equally distributed in [0, 9], then the leading zeros

Re: generate random digits with length of 5

2008-09-28 Thread Mensanator
On Sep 28, 4:02�pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > Wondering if there is a better way to generate string of numbers with > > a length of 5 which also can have a 0 in the front of the number. > > If you want to resample the same digit multiple times, either of these > two will do: > > �>>>

Re: generate random digits with length of 5

2008-09-28 Thread Mensanator
On Sep 28, 3:54�pm, "Aaron \"Castironpi\" Brady" <[EMAIL PROTECTED]> wrote: > On Sep 28, 3:44�pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > > > On Sep 28, 3:11 pm, "Gary M. Josack" <[EMAIL PROTECTED]> wrote: > > > > Chris Rebert wrote: > > > > On Sun, Sep 28, 2008 at 12:59 PM, sotirac <[EMAIL

Re: Python 3.0 and repr

2008-09-28 Thread Martin v. Löwis
> What are others' opinions? Any insight to this design decision? The intention is that all printable characters in a string get displayed in repr. This was in particular requested by Japanese users (but also by other users of non-ASCII characters) which complained that repr() is fairly useless i

Re: What is not objects in Python?

2008-09-28 Thread Bruno Desthuilliers
process a écrit : I have heard some criticism about Python, that it is not fully object- oriented. What is not an object in Python? names and statements. Why isn't len implemented as a str.len and list.len method instead of a len(list) function? See other answers here about how the len(obj

Re: closures and dynamic binding

2008-09-28 Thread Terry Reedy
Aaron "Castironpi" Brady wrote: On Sep 28, 2:52 am, Steven D'Aprano <[EMAIL PROTECTED] As for why the complicated version works, it may be clearer if you expand it from a one-liner: # expand: f[ n ]= (lambda n: ( lambda: n ) )( n ) inner = lambda: n outer = lambda n: inner f[n] = outer(n) o

Re: What is not objects in Python?

2008-09-28 Thread Tim Rowe
2008/9/28 process <[EMAIL PROTECTED]>: > I have heard some criticism about Python, that it is not fully object- > oriented. Why is that a criticism? OO is a tool, not a religion (ok, ok, OO *should be* a tool, not a religion). Is it a criticism of a hammer that it is not a screwdriver? Or do you p

Re: Not fully OO ?

2008-09-28 Thread Tim Rowe
2008/9/28 Aaron Castironpi Brady <[EMAIL PROTECTED]>: > Before I tried wxFormBuilder, I imagined that C# would be vastly > faster to develop than Python, for anything requiring any non-trivial > graphical interface. I've done extensive VB, so I can attest to that > personally. It is not. I'm co

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-28 Thread Tino Wildenhain
Michael Mabin wrote: Tino, dude, I'm afraid I lied about my previous post being the last word. There are some things you said here that must be addressed. Well. Its interesting to see thats either my English is so bad you don't understand or you are too tired. All what needs to be said was sai

Re: Hello boys!

2008-09-28 Thread Cydrome Leader
In rec.crafts.metalworking default <[EMAIL PROTECTED]> wrote: > On Sat, 27 Sep 2008 23:12:59 + (UTC), Cydrome Leader > <[EMAIL PROTECTED]> wrote: > >>In rec.crafts.metalworking Jim Thompson <[EMAIL PROTECTED]> wrote: >>> >>> On Sat, 27 Sep 2008 18:47:16 -0400, default <[EMAIL PROTECTED]> >>>

Re: generate random digits with length of 5

2008-09-28 Thread Aaron "Castironpi" Brady
On Sep 28, 4:08 pm, Michael Ströder <[EMAIL PROTECTED]> wrote: > Gary M. Josack wrote: > > Aaron "Castironpi" Brady wrote: > >> On Sep 28, 2:59 pm, sotirac <[EMAIL PROTECTED]> wrote: > > >>> Wondering if there is a better way to generate string of numbers with > >>> a length of 5 which also can hav

Re: Why are "broken iterators" broken?

2008-09-28 Thread Lie
On Sep 21, 10:13 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > According to the Python docs, once an iterator raises StopIteration, it > should continue to raise StopIteration forever. Iterators that fail to > behave in this fashion are deemed to be "broken": > > http://docs.p

Re: generate random digits with length of 5

2008-09-28 Thread Michael Ströder
Gary M. Josack wrote: > Aaron "Castironpi" Brady wrote: >> On Sep 28, 2:59 pm, sotirac <[EMAIL PROTECTED]> wrote: >> >>> Wondering if there is a better way to generate string of numbers with >>> a length of 5 which also can have a 0 in the front of the number. >>> >>> >>> random_number = random

Re: generate random digits with length of 5

2008-09-28 Thread Tim Chase
Wondering if there is a better way to generate string of numbers with a length of 5 which also can have a 0 in the front of the number. If you want to resample the same digit multiple times, either of these two will do: >>> from random import choice >>> ''.join(str(choice(range(10))) for _ in

Re: generate random digits with length of 5

2008-09-28 Thread Aaron "Castironpi" Brady
On Sep 28, 3:44 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Sep 28, 3:11 pm, "Gary M. Josack" <[EMAIL PROTECTED]> wrote: > > > > > Chris Rebert wrote: > > > On Sun, Sep 28, 2008 at 12:59 PM, sotirac <[EMAIL PROTECTED]> wrote: > > > >> Wondering if there is a better way to generate string of numb

Re: Not fully OO ?

2008-09-28 Thread Bruno Desthuilliers
Tim Rowe a écrit : 2008/9/26 Bruno Desthuilliers <[EMAIL PROTECTED]>: Not to start a troll, but from what I've seen of C# so far I do find this a bit surprising and really suspect more of a library issue than a language one. Care to tell more about the problem and solution ? (NB : I wouldn't e

Re: generate random digits with length of 5

2008-09-28 Thread Mensanator
On Sep 28, 3:11�pm, "Gary M. Josack" <[EMAIL PROTECTED]> wrote: > Chris Rebert wrote: > > On Sun, Sep 28, 2008 at 12:59 PM, sotirac <[EMAIL PROTECTED]> wrote: > > >> Wondering if there is a better way to generate string of numbers with > >> a length of 5 which also can have a 0 in the front of the

Re: is decorator the right thing to use?

2008-09-28 Thread Dmitry S. Makovey
George Sakkis wrote: > FYI, in case you missed it the final version doesn't need a Proxy base > class, just inherit from object. Also lowercased ProxyMethod to look > similar to staticmethod/classmethod: I cought that, just quoted the wrong one :) > class A(object): > > def __init__(self, b1

Re: What is not objects in Python?

2008-09-28 Thread [EMAIL PROTECTED]
On Sep 28, 2:29 pm, process <[EMAIL PROTECTED]> wrote: > I have heard some criticism about Python, that it is not fully object- > oriented. > > What is not an object in Python? > Parts of the syntax aren't objects. e.g. "=" or ":" aren't objects. Unlike in some less fully OO-languages (e.g. Java

Re: generate random digits with length of 5

2008-09-28 Thread Gary M. Josack
Gary M. Josack wrote: Aaron "Castironpi" Brady wrote: On Sep 28, 2:59 pm, sotirac <[EMAIL PROTECTED]> wrote: Wondering if there is a better way to generate string of numbers with a length of 5 which also can have a 0 in the front of the number. random_number = random.sample([0,1,2,3,4,5,6,

Re: generate random digits with length of 5

2008-09-28 Thread bearophileHUGS
sotirac: > random_number = random.sample([0,1,2,3,4,5,6,7,8,9], 5) # choose 5 elements But note that's without replacement. So if you want really random numbers you can do this: >>> from string import digits >>> from random import choice >>> "".join(choice(digits) for d in xrange(5)) '93898' If

Re: generate random digits with length of 5

2008-09-28 Thread Gary M. Josack
Aaron "Castironpi" Brady wrote: On Sep 28, 2:59 pm, sotirac <[EMAIL PROTECTED]> wrote: Wondering if there is a better way to generate string of numbers with a length of 5 which also can have a 0 in the front of the number. random_number = random.sample([0,1,2,3,4,5,6,7,8,9], 5) # choose 5

Re: generate random digits with length of 5

2008-09-28 Thread Gary M. Josack
Chris Rebert wrote: On Sun, Sep 28, 2008 at 12:59 PM, sotirac <[EMAIL PROTECTED]> wrote: Wondering if there is a better way to generate string of numbers with a length of 5 which also can have a 0 in the front of the number. random_number = random.sample([0,1,2,3,4,5,6,7,8,9], 5) # choose

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-28 Thread Steve Holden
Michael Mabin wrote: > Tino, dude, I'm afraid I lied about my previous post being the last > word. There are some things you said here that must be addressed. Good grief, is there no utterance so inconsequential that you will walk away from it without yet another round of retaliation? I believe

Re: generate random digits with length of 5

2008-09-28 Thread Aaron "Castironpi" Brady
On Sep 28, 2:59 pm, sotirac <[EMAIL PROTECTED]> wrote: > Wondering if there is a better way to generate string of numbers with > a length of 5 which also can have a 0 in the front of the number. > > >  random_number = random.sample([0,1,2,3,4,5,6,7,8,9], 5) # choose 5 > elements >  code = 'this is

Re: What is not objects in Python?

2008-09-28 Thread bearophileHUGS
Terry Reedy: > Partly history and partly practicality. Len is implemented as .__len__ > ;-). The len function is one, __len__ methods are many. If you want to > pass an argument to a function, passing len is easier that passing > operator.attrgetter('__len__'). Passing '__len__' (or 'len') woul

Re: generate random digits with length of 5

2008-09-28 Thread Chris Rebert
On Sun, Sep 28, 2008 at 12:59 PM, sotirac <[EMAIL PROTECTED]> wrote: > Wondering if there is a better way to generate string of numbers with > a length of 5 which also can have a 0 in the front of the number. > > > > random_number = random.sample([0,1,2,3,4,5,6,7,8,9], 5) # choose 5 > elements >

generate random digits with length of 5

2008-09-28 Thread sotirac
Wondering if there is a better way to generate string of numbers with a length of 5 which also can have a 0 in the front of the number. random_number = random.sample([0,1,2,3,4,5,6,7,8,9], 5) # choose 5 elements code = 'this is a string' + str(random_number[0]) + str(random_number[1]) + str(ra

Re: urllib2 and exceptions

2008-09-28 Thread robean
On Sep 28, 12:27 pm, robean <[EMAIL PROTECTED]> wrote: > On Sep 28, 12:11 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > > > > > On Sun, Sep 28, 2008 at 11:03 AM, robean <[EMAIL PROTECTED]> wrote: > > > Hi everyone, > > > > I have a question about using urllib2. > > > > I like urllib2 better than

Re: urllib2 and exceptions

2008-09-28 Thread robean
On Sep 28, 12:11 pm, "Chris Rebert" <[EMAIL PROTECTED]> wrote: > On Sun, Sep 28, 2008 at 11:03 AM, robean <[EMAIL PROTECTED]> wrote: > > Hi everyone, > > > I have a question about using urllib2. > > > I like urllib2 better than urllib at least in part because it has more > > elaborate support for h

Re: Music knowledge representation

2008-09-28 Thread Aaron "Castironpi" Brady
On Sep 28, 2:08 pm, Mr.SpOOn <[EMAIL PROTECTED]> wrote: > On Sun, Sep 28, 2008 at 8:59 PM, Aaron Castironpi Brady > > <[EMAIL PROTECTED]> wrote: > > Here is a link to someone else's design they asked about on the > > newsgroup a couple weeks ago. > > >http://groups.google.com/group/comp.lang.python

Re: Music knowledge representation

2008-09-28 Thread Mark Tolonen
"Mr.SpOOn" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] On Sun, Sep 28, 2008 at 8:59 PM, Aaron Castironpi Brady <[EMAIL PROTECTED]> wrote: Here is a link to someone else's design they asked about on the newsgroup a couple weeks ago. http://groups.google.com/group/comp.lang.pyt

Re: Selective importing and package dependencies

2008-09-28 Thread Chris Rebert
On Sun, Sep 28, 2008 at 7:10 AM, David Pratt <[EMAIL PROTECTED]> wrote: > Hi. I am in the midst of preparing a package to convert between various > schemas including orms. The issue is I don't want django, slqalchemy, storm, > rdflib etc. as hard dependencies of the package. Each module is a schema

standalone buildbot possible/ don't have a remote

2008-09-28 Thread mark
I want to start small and setup a buildbot on one machine (no slaves). I hope this is possible. I assume I only need one master in this case (without slave config)??? from my master.cfg c['slaves'] = [] ... (rest of the sample config) b1 = {'name': "buildbot-full", # 'slavename': "bot1name"

Re: What is not objects in Python?

2008-09-28 Thread Terry Reedy
process wrote: I have heard some criticism about Python, that it is not fully object- oriented. Feel free to ignore it if you wish. What is not an object in Python? Depends on what you mean by 'in'. Python is a language for defining and manipulating information objects. Code 'in' Python

Re: how to replace and string in a "SELECT ... IN ()"

2008-09-28 Thread Michael Mabin
Tino, dude, I'm afraid I lied about my previous post being the last word. There are some things you said here that must be addressed. On Sun, Sep 28, 2008 at 6:00 AM, Tino Wildenhain <[EMAIL PROTECTED]> wrote: > Michael Mabin wrote: > >> I'm exhausted, so I'll just shut up about this after a few

Re: urllib2 and exceptions

2008-09-28 Thread Chris Rebert
On Sun, Sep 28, 2008 at 11:03 AM, robean <[EMAIL PROTECTED]> wrote: > Hi everyone, > > I have a question about using urllib2. > > I like urllib2 better than urllib at least in part because it has more > elaborate support for handling errors: there is built in support for > URLError (for faulty urls

Re: What is not objects in Python?

2008-09-28 Thread Lie
On Sep 29, 1:29 am, process <[EMAIL PROTECTED]> wrote: > I have heard some criticism about Python, that it is not fully object- > oriented. > > What is not an object in Python? > > Why isn't len implemented as a str.len and list.len method instead of > a len(list) function? A question like this is

ANN: wxPython 2.8.9.0

2008-09-28 Thread Robin Dunn
Announcing -- The 2.8.9.0 release of wxPython is now available for download at http://wxpython.org/download.php. This release adds support for using Cairo for drawing on wx windows, adds a Win64 build, and various other fixes and enhancements. Source code is available, as well as binar

Re: Music knowledge representation

2008-09-28 Thread Mr.SpOOn
On Sun, Sep 28, 2008 at 8:59 PM, Aaron Castironpi Brady <[EMAIL PROTECTED]> wrote: > Here is a link to someone else's design they asked about on the > newsgroup a couple weeks ago. > > http://groups.google.com/group/comp.lang.python/browse_thread/thread/ecffaa827984866d/921cba3084b984dc?lnk=st&q=s

Re: How to read a jpg bytearray from a Flash AS3 file

2008-09-28 Thread rsgalloway
Thanks! I'm using form = cgi.FieldStorage(). When I print out the contents of form, I get this: FieldStorage(None, None, '\xff\xd8\xff\xe0\x00\x10JFIF \x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xdb \x00\x84\x00\x05\x03\x04\x04\x04\x03\x05\x04\x04\x04\x05\x05\x05\x06\x07\x0c \x08\x07\x07\x07

Re: Music knowledge representation

2008-09-28 Thread Aaron "Castironpi" Brady
On Sep 28, 9:37 am, Mr.SpOOn <[EMAIL PROTECTED]> wrote: > Hi, > I'm working on an application to analyse music (melodies, chord sequences > etc.) > > I need classes to represent different musical entities. I'm using a > class Note to represent all the notes. Inside it stores the name of > the natu

Re: closures and dynamic binding

2008-09-28 Thread Aaron "Castironpi" Brady
On Sep 28, 2:52 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sat, 27 Sep 2008 21:43:15 -0700, Aaron \"Castironpi\" Brady wrote: > > Hello all, > > > To me, this is a somewhat unintuitive behavior.  I want to discuss the > > parts of it I don't understand. > > f= [ Non

Re: What is not objects in Python?

2008-09-28 Thread Tino Wildenhain
Hi, process wrote: I have heard some criticism about Python, that it is not fully object- oriented. Don't listen to the voices... ;) What is not an object in Python? Why isn't len implemented as a str.len and list.len method instead of a len(list) function? So you also want to write 1+2

Re: What is not objects in Python?

2008-09-28 Thread Christian Heimes
process wrote: What is not an object in Python? Everything that is not part of Python's syntax is an object, including all string and number types, classes, metaclasses, functions, models, code and more. It's technically not possible to have something like e.g. an int that isn't an object.

What is not objects in Python?

2008-09-28 Thread process
I have heard some criticism about Python, that it is not fully object- oriented. What is not an object in Python? Why isn't len implemented as a str.len and list.len method instead of a len(list) function? -- http://mail.python.org/mailman/listinfo/python-list

Re: destructor not called

2008-09-28 Thread George Sakkis
On Sep 28, 12:00 pm, Marcin201 <[EMAIL PROTECTED]> wrote: > I have a class which uses a temporary directory for storing data.  I > would like that directory to be removed when the class is no longer > used.  I have tried removing the temporary directory from the class > destructor, however, it was

urllib2 and exceptions

2008-09-28 Thread robean
Hi everyone, I have a question about using urllib2. I like urllib2 better than urllib at least in part because it has more elaborate support for handling errors: there is built in support for URLError (for faulty urls) and HTTPError (for http errors that might originate from, say, passing an inva

parsing a site/page that uses/calls javascript functions...

2008-09-28 Thread bruce
Hi... I've got a couple of test apps that I use to parse/test different html webpages. However, I'm now looking at how to parse a given site/page that uses javascript calls to dynamically create/display the resulting HTML. I can see the HTML is the Browser page if I manually select the btn that i

Python 3.0 and repr

2008-09-28 Thread Mark Tolonen
I don't understand the behavior of the interpreter in Python 3.0. I am working at a command prompt in Windows (US English), which has a terminal encoding of cp437. In Python 2.5: Python 2.5 (r25:51908, Sep 19 2006, 09:52:17) [MSC v.1310 32 bit (Intel)] on win 32 Type "help", "copyr

Re: destructor not called

2008-09-28 Thread Michel Leunen
Marcin201 a écrit : class Foo: def __init__(self): print "Hello" self.f = self.fxn Maybe self.f = self.fxn() is what you want. Note the '()'. -- Michel Leunen http://linux.leunen.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Unable to write % character to a file using writelines() method

2008-09-28 Thread dudeja . rajat
On Sun, Sep 28, 2008 at 5:51 PM, Christian Heimes <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > >> Hi, >> >> >> I'm using the writelines() method to write some lines to a text file. But >> I'm unable to write the % character to the file using the following >> format: >> >> fdTolFile.writ

Re: destructor not called

2008-09-28 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Marcin201 <[EMAIL PROTECTED]> wrote: > I have a class which uses a temporary directory for storing data. I > would like that directory to be removed when the class is no longer > used. I have tried removing the temporary directory from the class > destructor, ho

Re: destructor not called

2008-09-28 Thread Szabolcs Ferenczi
On Sep 28, 6:00 pm, Marcin201 <[EMAIL PROTECTED]> wrote: > I have a class which uses a temporary directory for storing data.  I > would like that directory to be removed when the class is no longer > used.  I have tried removing the temporary directory from the class > destructor, however, it was n

Re: Unable to write % character to a file using writelines() method

2008-09-28 Thread Christian Heimes
[EMAIL PROTECTED] wrote: Hi, I'm using the writelines() method to write some lines to a text file. But I'm unable to write the % character to the file using the following format: fdTolFile.writelines("\n\tdiff Not in %s '%' range" %(toleranceInPer)) Try %% :) Christian -- http://mail.pyth

destructor not called

2008-09-28 Thread Marcin201
I have a class which uses a temporary directory for storing data. I would like that directory to be removed when the class is no longer used. I have tried removing the temporary directory from the class destructor, however, it was never called. After I while I traced the problem to the class hav

Re: Python style: exceptions vs. sys.exit()

2008-09-28 Thread Lie
On Sep 25, 3:05 pm, Bruno Desthuilliers wrote: > Steven D'Aprano a écrit : > > > On Wed, 24 Sep 2008 17:11:28 -0400, Ross Ridge wrote: > > >> Plenty of people were quick to say that the exception should be passed > >> through to the caller.  No one said this behaviour should be documented. > >>  T

Tkinter: scrollbar - unable to scroll the scrollbar if I click on arrow buttons of scroll bars

2008-09-28 Thread dudeja . rajat
Hi, Im using a tkinter scrollbars for horinzontal and vertical scrolling. Well the problem is I'm unable to scroll if I click on the arrows buttons of scrollbars ( with both types of scrollbars) Please suggest if I m missing some configuration. My code is as below: self.hsb = Scrollbar(appGu

  1   2   >