Re: NEWB: General purpose list iteration?

2005-08-12 Thread Peter Otten
Donald Newcomb wrote: > I was wondering it there's a simple routine (I > think I can write a recurisve routine to do this.) to scan all the > elements of a list, descending to lowest level and change something. What > I'd like to do today is to convert everything from string to float. So, if > I h

Re: Where can be a problem?

2005-08-12 Thread Peter Otten
Lad wrote: > I use the following > ### > import re > Results=[] > data1=' href="detailaspxmember=15016&mode=advert" href="detailaspxmember=15017&mode=advert" ' > ID = re.compile(r'^.*=(\d+)&.*$',re.MULTILINE) > Results=re.findall(ID,data1) > print Results > # > to extract

Cheese shop (was Re: python2.4/site-packages)

2005-08-12 Thread Michael Hoffman
Lucas Raab wrote: > Michael Hoffman wrote: >> http://www.python.org/pypi >> >> This used to be called the Python Package index but is now the Python >> Cheese Shop? Huh??? > > You've never heard the Cheese Shop Sketch by Monty Python?? I have but I've never heard of PyPI's name being changed? I

Re: net view /domain

2005-08-12 Thread usenet
Hi Tim! Thanks again for your help! I just tried it out and it does exactly what I want it to do :-) Have a nice day! Dirk -- http://mail.python.org/mailman/listinfo/python-list

Re: Why does __init__ not get called?

2005-08-12 Thread Fuzzyman
If you subclass strings you have to do your magic in __new__ rather than __init__. It receives the same arguments as you would normally expect to go to __init__. (Except cls rather than self). Best Regards, Fuzzy http://www.voidspace.org.uk/python -- http://mail.python.org/mailman/listinfo/pyt

Re: Cheese shop (was Re: python2.4/site-packages)

2005-08-12 Thread Erik Max Francis
Michael Hoffman wrote: > I have but I've never heard of PyPI's name being changed? I can only > find an announcement on Slashdot? I came across the change a good while back in my Web referrals, not having heard of it except passively. PyPI was a simple, clear, unambiguous name; Cheese Shop is

Re: Regular expression to match a #

2005-08-12 Thread Duncan Booth
John Machin wrote: > The point was made in a context where the OP appeared to be reading a > line at a time and parsing it, and re.compile(r'something').match() > would do the job; re.compile(r'^something').search() will do the job too > -- BECAUSE ^ means start of line anchor -- but somewhat r

Re: Regular expression to match a #

2005-08-12 Thread Duncan Booth
John Machin wrote: >> Your wording makes it hard to distinguish what exactly is "dopey". >> > > """ > dopey implementations of search() (which apply match() at offsets 0, 1, > 2, .). > """ > > The "dopiness" is that the ^ operator means that the pattern cannot > possibly match starting at

Re: Using globals with classes

2005-08-12 Thread Diez B. Roggisch
> Is there a way to make a Python function "remember" the values of certain > variables ? Or use fortran 95 like use module, only : varname, type of > within a def ? I'm not sure what you are trying to do here - but it seems to me that you are not properly designing your application. You really s

Re: Using globals with classes

2005-08-12 Thread Diez B. Roggisch
> Is there a way to make a Python function "remember" the values of certain > variables ? Or use fortran 95 like use module, only : varname, type of > within a def ? I'm not sure what you are trying to do here - but it seems to me that you are not properly designing your application. You really s

Re: Why is this?

2005-08-12 Thread Matt Hammond
On Fri, 12 Aug 2005 00:10:08 +0100, John Hazen <[EMAIL PROTECTED]> wrote: >> [[], []] is [[]]*2 >> > True > > Just curious, did you actually cut and paste this from a real > interactive session? (I think not.) My interpreter (yes, I know it's > old) gives: Ooops - you're absolutely right.

Re: How do these Java concepts translate to Python?

2005-08-12 Thread bruno modulix
Ray wrote: > Hello, > > I've been learning Python in my sparetime. I'm a Java/C++ programmer by > trade. So I've been reading about Python OO, and I have a few questions > that I haven't found the answers for :) > > 1. Where are the access specifiers? (public, protected, private) object.name =>

Re: How do these Java concepts translate to Python?

2005-08-12 Thread bruno modulix
Devan L wrote: > Fausto Arinos Barbuto wrote: > >>Ray wrote: >> >> >>>1. Where are the access specifiers? (public, protected, private) >> >>AFAIK, there is not such a thing in Python. >> >>---Fausto > > > Well, technically you can use _attribute to mangle it, __attribute would work better

win32com: use not possible as normal user

2005-08-12 Thread Sibylle Koczian
Hello, I've installed Python 2.4 and the win32 extensions, using administrator rights, under Windows XP in "C:\Programme". As this is a directory without spaces I didn't expect any problems. But now I can't _use_ win32com as a normal user, because normal users can't write there: PythonWin 2.4.

Re: Spreadsheet with Python scripting and database interface?

2005-08-12 Thread Wolfgang Keller
Hello, and thanks for your reply. > One thing that's not clear from your question is whether you want to > script the office from within using a macro or from the outside via > "remote control". What I basically dream of is using Python as THE embedded macro language of the spreadsheet. Becaus

Re: How do these Java concepts translate to Python?

2005-08-12 Thread bruno modulix
Ray wrote: > Fausto Arinos Barbuto wrote: > >>Ray wrote: >> >> >>>1. Where are the access specifiers? (public, protected, private) >> >>AFAIK, there is not such a thing in Python. > > > So everything is public? I know that you can prefix a member with > underscores to make something private,

Re: Psyco & Linux

2005-08-12 Thread Jeremy Sanders
Fausto Arinos Barbuto wrote: > The specifics of my system are: > > Athlon AMD-64 3300+ > SuSE 9.3 Professional (64-bit) > Python 2.4 > gcc/g++ 3.3.5 Ummm... I thought psyco only supported 32 bit systems. I haven't seen anything else to suggest otherwise. See http://psyco.sou

Re: What are modules really for?

2005-08-12 Thread Tito
bruno modulix wrote: > Magnus Lycka wrote: > >>N.Davis wrote: >> >> >>>Functions existing in a module? Surely if "everything is an object" >>>(OK thats Java-talk but supposedly Python will eventually follow this >>>too) >> >> >>int too? ;) > > > Yes, int too. I think he is talking about *Java*

__getattribute__ for class object

2005-08-12 Thread Sylvain Ferriol
hello when i define __getattribute__ in a class, it is for the class instances but if i want to have a __getattribute__ for class attributes how can i do that ? sylvain -- http://mail.python.org/mailman/listinfo/python-list

Re: What are modules really for?

2005-08-12 Thread Magnus Lycka
bruno modulix wrote: > Magnus Lycka wrote: > >>N.Davis wrote: >> >> >>>Functions existing in a module? Surely if "everything is an object" >>>(OK thats Java-talk but supposedly Python will eventually follow this >>>too) >> >> >>int too? ;) > > > Yes, int too. I was talking about everything bei

Re: What are modules really for?

2005-08-12 Thread Magnus Lycka
Terry Reedy wrote: > However, everything is an instance of a class or type. Except whitespace, comments, operators and statements! (Did I miss anything?) You can obviously argue whether a "variable" (or name if you like) is an object, or just refers to an object, but then we're getting philosophi

Re: How to quit a Windows GUI program gracefully with Python under Cygwin?

2005-08-12 Thread KB
Thanks. After I confirmed 'Alt-F4' would terminate and close a win32 application running independently, I installed 'SendKeys' module and tested with the following code under both Cygwin and Python Windows import os, SendKeys os.system('program datafile') SendKeys.SendKeys(""" {PAUSE 0.25}

Re: How to Adding Functionality to a Class by metaclass(not by inherit)

2005-08-12 Thread Paolino
Dont' know where are you going with that but if what you need is cancelling some attributes when inheriting then probably this is a cleaner approach: class Meta(type): def __init__(cls, name, bases, dic): def attributeError(*_): raise AttributeError for base in bases:

Re: __getattribute__ for class object

2005-08-12 Thread Paolino
Sylvain Ferriol wrote: > hello > when i define __getattribute__ in a class, it is for the class instances > but if i want to have a __getattribute__ for class attributes > > how can i do that ? > Skating on thin ice eh.Read something on metaclasses. class Meta(type): def __getattribute__(kl

pywin32 from network install

2005-08-12 Thread agostino . russo
I managed to make pywin32 work from a network installation (not really hard work: a shared folder + copying some dlls + setting PYTHONPATH). PythonWin amd COM seem to be working fine from the network install, BUT when I need to pass PyTime to a COM object expecting a Date I get the following error:

Re: Help sorting a list by file extension

2005-08-12 Thread Tom Anderson
On Fri, 12 Aug 2005, Bengt Richter wrote: > On Fri, 12 Aug 2005 00:06:17 GMT, Peter A. Schott <[EMAIL PROTECTED]> wrote: > >> Trying to operate on a list of files similar to this: >> >> test.1 >> test.2 >> test.3 >> >> I want to sort them in numeric order instead of string order. > > >>> [name for

Re: What is Python?!

2005-08-12 Thread Magnus Lycka
Evil Bastard wrote: > I guess a language could be called a 'scripting language' if: > - the source code can be executed directly, and/or > - source need not be converted to a separate file in a >non-human-readable format before it can be executed, and/or > - a change to the source file aut

how do i make exteranl module work under debug session?

2005-08-12 Thread Wen
Hi guys! I'm writing a small DLL thingy that requieres the use of loading the Python interpreter and executing a series of scripts. I have generated an interface to my dll with SWIG and put it in. It works like this: 1) a small .exe loads the .dll and calls the main init() function 2) the dll st

Re: pywin32 from network install

2005-08-12 Thread Neil Benn
[EMAIL PROTECTED] wrote: >I managed to make pywin32 work from a network installation (not really >hard work: a shared folder + copying some dlls + setting PYTHONPATH). >PythonWin amd COM seem to be working fine from the network install, BUT >when I need to pass PyTime to a COM object expecting a D

Re: Help sorting a list by file extension

2005-08-12 Thread Cyril Bazin
Maybe simpler but not very much simpler: one line for each solution. And in your solution the lambda is evaluated at each comparaison of the sort algorithm isn't it? So your code seems less productive than the bengt's code which apply the same code as the lambda only one time by entry in the li

Re: What is Python?!

2005-08-12 Thread Martin P. Hellwig
Magnus Lycka wrote: > or what have you. How do you sell this without making it sound > like snake oil? (Particularly with that name! :) This *is* the languange you are looking for ... Stops the argument every time, although afterwards they look kind a funny at me. -- mph -- http://

Re: Jargons of Info Tech industry

2005-08-12 Thread Ulrich Hobelmann
Jürgen Exner wrote: > Just for the records at Google et.al. in case someone stumbles across Xah's > masterpieces in the future: > Xah is very well known as the resident troll in many NGs and his > 'contributions' are less then useless. And you are the resident troll-reply service, posting this rep

Re: __getattribute__ for class object

2005-08-12 Thread Dan
> > but if i want to have a __getattribute__ for class attributes > > Read something on metaclasses. Depending on what you want to do, it might be better to use properties instead: class Meta(type): x = property(lambda klass: 'Called for '+str(klass)) class Foo(object): __metaclass

Help with wxPython

2005-08-12 Thread mitsura
Hi, I have encountered an annoying problem with wx.Choice from wx.Python. Basically, what I want to do is create a drop down box with a set of choices (so far so good). The problem is that when the drop down box is created, the first entry in the list of the drop down box is empty and you need to

Re: Why is this?

2005-08-12 Thread Peter Mott
If I use concatenation + instead of multiplication * then I get the result that Jiri expected: >>> L = [[]] + [[]] >>> L[1].append(1) >>> L [[], [1]] With * both elements are changed: >>> L = [[]] * 2 >>> L[1].append(1) >>> L [[1], [1]] Alex Martelli says in his excellent Nutshell book t

Re: len(sys.argv) in (3,4)

2005-08-12 Thread Magnus Lycka
Daniel Schüle wrote: > I just tried the same code at home and it worked fine > it has to do with windows .. some settings or whatever > (python 2.4.1 installed on both) > > maybe someone have experienced the same problem > and had more luck in solving the puzzle First of all: "Windows" is a whole

Re: NEWB: General purpose list iteration?

2005-08-12 Thread Donald Newcomb
"Devan L" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > This will just do_something(object) to anything that is not an > iterable. Only use it if all of your nested structures are of the same > depth. Cool! I'll try it. -- Donald Newcomb DRNewcomb (at) attglobal (dot) net --

bug in property?

2005-08-12 Thread Damir Hakimov
#!/usr/bin/python2.4 class test_property: def __init__(self): self._x="Zero" pass def setx(self,x): print "set x" #this is not work self._x=x def getx(self): return self._x def delx(self): del(self._x) x=property(getx,setx,delx,"XXX") t=test_prop

Re: Jargons of Info Tech industry

2005-08-12 Thread Thomas Fritsch
Xah Lee wrote: > [...] > My time is limited, so i'll just give a brief explanation of my thesis > [...] This is what psychology calls a disordered self-perception. -- "Thomas:Fritsch$ops:de".replace(':','.').replace('$','@') -- http://mail.python.org/mailman/listinfo/python-list

Re: bug in property?

2005-08-12 Thread Simon Brunning
On 8/12/05, Damir Hakimov <[EMAIL PROTECTED]> wrote: > #!/usr/bin/python2.4 > class test_property: > def __init__(self): > self._x="Zero" > pass > def setx(self,x): > print "set x" #this is not work > self._x=x > def getx(self): return self._x > def

Re: pywin32 from network install

2005-08-12 Thread agostino . russo
Hmm I have the same problem using python -E... Moreover I do not see anything strange in the sys.path (Z\LocalApps is my shared folder): 'Z:\\LocalApps\\examples', 'Z:\\LocalApps\\python\\python24.zip', 'Z:\\LocalApps\\examples', 'Z:\\LocalApps\\python\\DLLs', 'Z:\\LocalApps\\python\\lib', 'Z:\\Lo

Re: Why is this?

2005-08-12 Thread Duncan Booth
Peter Mott wrote: > If I use concatenation + instead of multiplication * then I get the > result that Jiri expected: > > >>> L = [[]] + [[]] > >>> L[1].append(1) > >>> L > [[], [1]] > > With * both elements are changed: > > >>> L = [[]] * 2 > >>> L[1].append(1) > >>> L > [[1], [1]] > > Alex M

Re: Why is this?

2005-08-12 Thread Matt Hammond
On Fri, 12 Aug 2005 12:57:38 +0100, Peter Mott <[EMAIL PROTECTED]> wrote: > If I use concatenation + instead of multiplication * then I get the > result that Jiri expected: > > >>> L = [[]] + [[]] > >>> L[1].append(1) > >>> L > [[], [1]] > > With * both elements are changed: > > >>> L = [[]]

Re: How do these Java concepts translate to Python?

2005-08-12 Thread Roy Smith
"Ray" <[EMAIL PROTECTED]> wrote: > I've been learning Python in my sparetime. I'm a Java/C++ programmer by > trade. So I've been reading about Python OO, and I have a few questions > that I haven't found the answers for :) > > 1. Where are the access specifiers? (public, protected, private) Quick

Re: How to quit a Windows GUI program gracefully with Python under Cygwin?

2005-08-12 Thread Jason Tishler
On Fri, Aug 12, 2005 at 03:07:02AM -0700, KB wrote: > After I confirmed 'Alt-F4' would terminate and close a win32 > application running independently, > I installed 'SendKeys' module and tested with the following code under > both Cygwin and Python Windows If you installed the SendKeys binary, th

Re: Help with wxPython

2005-08-12 Thread Roel Schroeven
[EMAIL PROTECTED] wrote: > I have encountered an annoying problem with wx.Choice from wx.Python. > Basically, what I want to do is create a drop down box with a set of > choices (so far so good). The problem is that when the drop down box is > created, the first entry in the list of the drop down

Re: Writing a small battleship game server in Python

2005-08-12 Thread Michael Goettsche
On Thursday 11 August 2005 18:08, Brian Quinlan wrote: > Michael Goettsche wrote: > > What would be a good, but still easy way to write such a server? > > You could use SimpleXMLRPCServer. A client call sequence could like this: Thanks for the example Brian. I wonder... is there a standard impleme

Re: Writing a small battleship game server in Python

2005-08-12 Thread Michael Goettsche
On Thursday 11 August 2005 19:03, [EMAIL PROTECTED] wrote: > Why not using directly SOAP ? > > A minimalistic 'Hello world' client looks like : > >from SOAPpy import SOAPProxy > >server= SOAPProxy("http://localhost:8080";) >print server.Hello("world") > > and the server side like : > >

Re: Writing a small battleship game server in Python

2005-08-12 Thread Michael Goettsche
On Thursday 11 August 2005 18:34, Dan wrote: > > The server should accept connections from new players and be able to > > handle multiple games concurrently. > > Multiple threads would be the way to go for a real application. But if > you want to avoid the complexity involved in threading and > syn

Re: Where can be a problem?

2005-08-12 Thread Lad
Peter, I tried exactly this import re Results=[] data1='' ID = re.compile(r'^.*=(\d+)&.*$',re.MULTILINE) Results=re.findall(ID,data1) print "Results are= ",Results # and received Results are= ['15017'] Not all numbers What exactly did you get? Thanks. L. -- http://mail.python.

Zope, Python 2.4 pythonScripts import problem

2005-08-12 Thread krzychu
Hi, I have installed brand new platform - Zope-2-7-6, Python 2.4.1, Plone 2.0.5, OS Debian 1:3.3.6-2. After import a old Plone site from the following platform Zope-2-7-4, Python 2.3.3, Plone 2.0.3 to the new one, I get error when I visit PuthonScript in the ZMI. "invalid syntax (Script (Python)

Re: Printing to printer

2005-08-12 Thread Larry Bates
I adapted some code from David Boddie into a Python class to write directly to Linux print queues. I have used it in one project and it worked just fine. I've attached a copy for your use. You are free to use it as you wish, with no guarantees or warranties. Hope it helps. Larry Bates Steve M

Re: How do these Java concepts translate to Python?

2005-08-12 Thread Ray
bruno modulix wrote: > And BTW, don't bother making all your attributes "protected" or > "private" then writing getters and setters, Python has a good support > for computed attributes, so you can change the implementation without > problem (which is the original reason for not-public attributes

Re: len(sys.argv) in (3,4)

2005-08-12 Thread infidel
> Nope. But since you're running this on a very peculiar OS, I just can > guess that this very peculiar OS consider all args to be one same string... It depends on what you're coding with. If you're writing a Win32 program in C/C++ (and by extension, Visual Basic), the WinMain() function passes a

Re: Catching stderr output from graphical apps

2005-08-12 Thread gry
Linux -2.4.20 (x86), Python 2.3.3. I did exactly as you suggested. After the stderr.write, a window pops up with title "Error Stream from run of errorwindow.pyc". The window is otherwise blank. Nothing more happens when I do the "x=7+nosuchvariable", I just get the next python ">>>" prompt, but no

Re: len(sys.argv) in (3,4)

2005-08-12 Thread infidel
It might make more sense if you could find out exactly what that one argument contains. -- http://mail.python.org/mailman/listinfo/python-list

Python's Exception, and Capitalization

2005-08-12 Thread Ray
Hello guys, OK, I've been reading some more about Python. There are some things about Python exception that I haven't been able to grasp: 1. This is a small thing, but why is object spelled "object", and the mother of all exception "Exception" (with capital E)? Why is not object spelled "Object"

Re: Where can be a problem?

2005-08-12 Thread Peter Otten
Lad wrote: > Peter, > I tried exactly this > > import re > Results=[] > data1=' href="detailaspxmember=15016&mode=advert" href="detailaspxmember=15017&mode=advert" ' > ID = re.compile(r'^.*=(\d+)&.*$',re.MULTILINE) > Results=re.findall(ID,data1) > print "Results are= ",Results >

simpli int/str problem

2005-08-12 Thread sinan .
hi all, i have a string and int values in same dictionary like this dict = {'str_name': 'etc' , 'int_name' : 112 } the error occures when do this SQL = "INSERT INTO (`AH`, `BH` ) VALUES ('" + dict['str_name'] + "', '" + dict['int_name'] + "')" cursor.execute(SQL) python does not accep dict['int_nam

Re: How do these Java concepts translate to Python?

2005-08-12 Thread Ray
Roy Smith wrote: > Quick answer; there are none, all attributes are public. > > Slightly longer answer; if you name an attribute with two leading > underscores (i.e. "__myPrivateData"), there is some name mangling that goes > on which effectively makes the attribute private. There are ways around

Text/IDE Python Editor?

2005-08-12 Thread djanvk
Any recommendations on a editior/IDE for programming in python? I'm using windows xp. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's Exception, and Capitalization

2005-08-12 Thread D H
Ray wrote: > Hello guys, > > OK, I've been reading some more about Python. There are some things > about Python exception that I haven't been able to grasp: > > 1. This is a small thing, but why is object spelled "object", and the > mother of all exception "Exception" (with capital E)? Why is not

Re: Text/IDE Python Editor?

2005-08-12 Thread Simon Brunning
On 8/12/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Any recommendations on a editior/IDE for programming in python? http://wiki.python.org/moin/PythonEditors -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python

Re: Bug in slice type

2005-08-12 Thread Michael Hudson
Bryan Olson <[EMAIL PROTECTED]> writes: > The Python slice type has one method 'indices', and reportedly: > > This method takes a single integer argument /length/ and > computes information about the extended slice that the slice > object would describe if applied to a sequence of l

Re: simpli int/str problem

2005-08-12 Thread [EMAIL PROTECTED]
Use substitution like below. Hope this helps py> d = {'str_name': 'etc' , 'int_name' : 112 } py> SQL = "INSERT INTO (`AH`, `BH` ) VALUES ('" + d['str_name'] + "', '" + d['int_name'] + "')" Traceback (most recent call last): File "", line 1, in -toplevel- SQL = "INSERT INTO (`AH`, `BH` ) VAL

Re: Python's Exception, and Capitalization

2005-08-12 Thread Ray
D H wrote: > Yeah, the python standard library has been built by lots of different > people. It wasn't designed by one entity using one standard like the > java standard library or .NET/Mono class library. Um, OK, so is it customary in modern Python programs to follow Java convention? then method

Re: simpli int/str problem

2005-08-12 Thread Paolino
sinan . wrote: > hi all, > i have a string and int values in same dictionary like this > dict = {'str_name': 'etc' , 'int_name' : 112 } > the error occures when do this > SQL = "INSERT INTO (`AH`, `BH` ) VALUES ('" + dict['str_name'] + "', > '" + dict['int_name'] + "')" > cursor.execute(SQL) > pyth

Re: simpli int/str problem

2005-08-12 Thread Paul McGuire
I just did this sort of thing the other day! Your database only accepts ints for BH, but remember, you are building an SQL *string* to be executed. To show SQL that your BH value is an int, not a string, do not enclose it in quotes. (Another style hint: don't name dict's "dict", as this will mas

Re: Python's Exception, and Capitalization

2005-08-12 Thread [EMAIL PROTECTED]
For youtr try, except, finally: you can construct something like this: try: try: print 'egg' + 1 except ValueError, e: print e finally: print 'spam' It results in: py> spam Traceback (most recent call last): File "C:/Martin/test.py", line 3, in -toplevel- print

Re: thread limit in python

2005-08-12 Thread danieldsmith
i modified my C test program (included below) to explicitly set the default thread stack size, and i'm still running into the same problem. can you think of any other thing that would possibly be limiting me? and sorry to continue to post here. since this is occurring in both c and python, i thi

Re: Where can be a problem?

2005-08-12 Thread Lad
Thank you Peter for help. The reason why it did not work was the fact that findall function required CRLF among lines -- http://mail.python.org/mailman/listinfo/python-list

Re: Where can be a problem?

2005-08-12 Thread Paul McGuire
Try this, its a bit more readable than your re. from pyparsing import Word,nums,Literal,replaceWith data1='' # a number is a word composed of nums, that is, the digits 0-9 # your search string is looking for a number between an '=' and '&' EQUALS = Literal("=") AMPER = Literal("&") number =

Re: Jargons of Info Tech industry

2005-08-12 Thread Mike Schilling
"Jürgen Exner" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Xah Lee wrote: >> Jargons of Info Tech industry >> >> (A Love of Jargons) >> >> Xah Lee, 2002 Feb >> >> People in the computing field like to spur the use of spurious >> jargons. The less educated they are, the more they

problem extending tkSimpleDialog.Dialog

2005-08-12 Thread William Gill
I have created a widget that extends Frame() and contains labels, checkboxes, and entrys. I am trying to use tkSimpleDialog.Dialog to create a modal display of this widget, but am running into some (addressing) problems. My widget displays in the parent widget, not the tkSimpleDialog.Dialog?

Re: How do these Java concepts translate to Python?

2005-08-12 Thread Aahz
In article <[EMAIL PROTECTED]>, Ben Finney <[EMAIL PROTECTED]> wrote: > >Recently, the language came to partially support '__foo' (i.e. a name >beginning with two underscores) as a pseudo-"private". It's just a >namespace munging though; sufficiently determined users can get at it >without much ef

Re: Python's Exception, and Capitalization

2005-08-12 Thread Aahz
In article <[EMAIL PROTECTED]>, Ray <[EMAIL PROTECTED]> wrote: > >2. I'm quite baffled that you either have try/except, or try/finally. >In Java, it is quite common to do this: > >try { >// something >} catch(AException e) { >// handle >} catch(BException e) { >// handle >} catch(CExcep

Re: Jargons of Info Tech industry

2005-08-12 Thread jan V
> Xah is very well known as the resident troll in many NGs and his 'contributions' are less then useless. > > Best is to just ignore him. Did you know that some deranged people take sexual pleasure out of starting fires? Apparently some of the latest forest/bush fires in southern Europe were even

Re: Why is this?

2005-08-12 Thread Peter Mott
Matt Hammond wrote: > On Fri, 12 Aug 2005 12:57:38 +0100, Peter Mott <[EMAIL PROTECTED]> wrote: > >> If I use concatenation + instead of multiplication * then I get the >> result that Jiri expected: >> >> >>> L = [[]] + [[]] >> >>> L[1].append(1) >> >>> L >> [[], [1]] >> >> With * both elemen

Re: Python's Exception, and Capitalization

2005-08-12 Thread bruno modulix
Ray wrote: > Hello guys, > > OK, I've been reading some more about Python. There are some things > about Python exception that I haven't been able to grasp: > > 1. This is a small thing, but why is object spelled "object", and the > mother of all exception "Exception" (with capital E)? Why is not

Re: Help sorting a list by file extension

2005-08-12 Thread Peter A.Schott
OK - I actually got something working last night with a list that is then converted into a dictionary (dealing with small sets of data - < 200 files per run). However, I like the sorted list option - I didn't realize that was even an option within the definition and wasn't quite sure how to get th

Re: How do these Java concepts translate to Python?

2005-08-12 Thread bruno modulix
Ray wrote: > Roy Smith wrote: > >>Quick answer; there are none, all attributes are public. >> (snip) > > Well yeah... if you really want it, in Java you can do that too via > reflection. Just that I'm not used to it yet so I feel a bit jittery > with so much power on my hands! Then wait until yo

Re: FTP over SSL (explicit encryption)

2005-08-12 Thread David Isaac
"Alan Isaac" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > http://www.lag.net/paramiko/ > However it requires the PyCrypto module. > http://www.amk.ca/python/code/crypto > > Can you briefly outline how to use this as a client > to upload and down files from a server using SFTP? OK

need help with my append syntax

2005-08-12 Thread yaffa
dear folks, i'm trying to append a semicolon to my addr string and am using the syntax below. for some reason the added on of the ; doesn't work. when i print it out later on it only shows the original value of addr. addr = incident.findNextSibling('td') addr.append('%s;') thanks yaffa -- ht

Re: How do these Java concepts translate to Python?

2005-08-12 Thread Ray
bruno modulix wrote: > Then wait until you discover what one can do with __magic_methods__, > functions-as-objects, closures, callable objects, descriptors > (properties on steroids), decorators, generators, and metaclasses... > *Then* you'll know what power means !-) > > And more is to come... ..

Re: need help with my append syntax

2005-08-12 Thread Qiangning Hong
yaffa wrote: > dear folks, > > i'm trying to append a semicolon to my addr string and am using the > syntax below. for some reason the added on of the ; doesn't work. > when i print it out later on it only shows the original value of addr. > > addr = incident.findNextSibling('td') > addr.append(

Re: thread limit in python

2005-08-12 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > and sorry to continue to post here. since this is occurring in both c > and python, i think there's no question i'm running into an os limit. Probably, but I haven't yet seen anyone ask the real important question. What possible use could you have for more than 1000

Re: Text/IDE Python Editor?

2005-08-12 Thread Peter A.Schott
Also, it depends on what you're trying to do. GUI, Web, Service-type apps, etc. I have started using Stan's Python Editor (www.stani.be) because I like the general features it offers. It does require wxpython to run, though. I've also used Boa Constructor and DrPython - both pretty good environ

Re: Python's Exception, and Capitalization

2005-08-12 Thread Steve M
You might find the Python Style Guide to be helpful: http://www.python.org/doc/essays/styleguide.html -- http://mail.python.org/mailman/listinfo/python-list

Re: need help with my append syntax

2005-08-12 Thread Michael Ekstrand
On 12 Aug 2005 09:31:08 -0700 "yaffa" <[EMAIL PROTECTED]> wrote: > addr = incident.findNextSibling('td') > addr.append('%s;') addr += ';' or addr2 = '%s;' % addr Strings, being immutable, do not support appending like lists do. Also, the %whatever specifiers are only in effect when used with t

Re: need help with my append syntax

2005-08-12 Thread Qiangning Hong
Do not discuss off-list, maybe others will have better solutions to your question. And also please do not top-posting, it makes me difficult to trim the irrelevant text. yaffa wrote: > sorry addr is a variable. how to i append to that? I know addr is a variable (or better a name). But what obj

UCALC equivalent

2005-08-12 Thread Dark Cowherd
http://www.ucalc.com/mathparser/index.html There is a great library called UCALC which allows you to set up an expression and evaluate it for e.g. you an define an expression by calling a function in UCALC then call it with various values of x for e.g. see this page http://www.ucalc.com/mathparse

Re: How do these Java concepts translate to Python?

2005-08-12 Thread Steven Bethard
bruno modulix wrote: >>but technically >>speaking, there are no public, protected, or private things. > > Yes there are: > object.name is public > object._name is protected > object.__name is private The double-underscore name-mangling is almost never worth it. It's supposed to stop name collis

How to build Python modules on windows?

2005-08-12 Thread .
Hi, how can I build python modules on windows? I tried to build numarray[0] using Microsoft Visual C++ 2003 Toolkit, but got the following error: --- error: Python was built with version 7.1 of Visual Studio, and extensions need to be built with the same version of the compiler, but it isn't i

Re: UCALC equivalent

2005-08-12 Thread Larry Bates
Python has built in eval function and doesn't require a library. Larry Bates Dark Cowherd wrote: > http://www.ucalc.com/mathparser/index.html > > There is a great library called UCALC which allows you to set up an > expression and evaluate it > for e.g. you an define an expression by calling a f

Re: __getattribute__ for class object

2005-08-12 Thread Steven Bethard
Dan wrote: > Depending on what you want to do, it might be better to use properties > instead: > > class Meta(type): > x = property(lambda klass: 'Called for '+str(klass)) > > class Foo(object): > __metaclass__=Meta Also worth noting that you can inline the metaclass if you don't n

Re: Supressing argument renaming in the Qt Designer -> pyuic workflow

2005-08-12 Thread Phil Thompson
On Thursday 11 August 2005 6:36 pm, Madhusudan Singh wrote: > Hi > > Some of the functions I defined inside Qt Designer need to have some values > passed to them. > > For instance : > > Code : > > void Form3::runningplot(n,plottitle,xname,x,y1name,y1,y2name,y2) > > is translated by pyuic to > > Pyt

Re: Using globals with classes

2005-08-12 Thread Scott David Daniels
Madhusudan Singh wrote: > I am using qwtplot to display a running plot : > > void Form3::runningplot(n,plottitle,xname,x,y1name,y1,y2name,y2) > { ^^ I presume this is just some untranslated stuff ^^ > if n==1 : > > plotkey1=self.runningqwtPlot.insertCurve(y1name,self.runningqwtPlot.xBottom,s

Re: How to build Python modules on windows?

2005-08-12 Thread Qiangning Hong
". <"@bag.python.org wrote: > Hi, > > how can I build python modules on windows? I tried to build numarray[0] > using Microsoft Visual C++ 2003 Toolkit, but got the following error: > > --- > error: Python was built with version 7.1 of Visual Studio, and > extensions need to be built with the s

Re: UCALC equivalent

2005-08-12 Thread max
Larry Bates <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Python has built in eval function and doesn't require > a library. > > Larry Bates > Are you kidding? Read the original post a little more closely. The o.p. is looking for a library that evaluates mathematical expressions and

Bug on Python2.3.4 [FreeBSD]?

2005-08-12 Thread Uwe Mayer
Hi, AFAICT there seems to be a bug on FreeBSD's Python 2.3.4 open function. The documentation states: > Modes 'r+', 'w+' and 'a+' open the file for updating (note that 'w+' > truncates the file). Append 'b' to the mode to open the file in binary > mode, on systems that differentiate between bin

  1   2   >