Re: struct unpack newline

2005-05-31 Thread Peter Otten
[EMAIL PROTECTED] wrote: > what concerns me though is that although the file is opened in binary > mode, > "for line.." has a problem reading the file correctly. There is _no_ correct way of splitting a file containing binary data in lines because binary data may contain newline bytes that do not

Re: [ANN] IPython 0.6.14.

2005-05-31 Thread Mark Sargent
Fernando Perez wrote: >Hi all, > >I've just made the 0.6.14 release of IPython, mostly to fix the >inevitable bugs reported after the .13 one (though one big improvement >sneaked by). > >IPython's homepage is at: > >http://ipython.scipy.org > >and downloads are at: > >http://ipython.scipy.org/dist

Re: a newbie question about debug

2005-05-31 Thread flyaflya
flyaflya wrote: > I use pdb.set_trace() to debug code.the Debugger Commands "enable" and > "disable" need argumet -- "breakpoint number",but I can't find any > information about it,so how to can i get the breakpoint number? I think > "disable","enable" are very useful commands... I know why I c

Re: pickle alternative

2005-05-31 Thread Andrew Dalke
simonwittber wrote: > I've written a simple module which serializes these python types: > > IntType, TupleType, StringType, FloatType, LongType, ListType, DictType For simple data types consider "marshal" as an alternative to "pickle". > It appears to work faster than pickle, however, the decode

Re: struct unpack newline

2005-05-31 Thread grant
Good point. Hadn't thouhgt of that. Thanks Grant -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle alternative

2005-05-31 Thread simonwittber
> For simple data types consider "marshal" as an alternative to "pickle". >From the marhal documentation: Warning: The marshal module is not intended to be secure against erroneous or maliciously constructed data. Never unmarshal data received from an untrusted or unauthenticated source. > BTW, y

Albatross 1.30 released

2005-05-31 Thread Andrew McNamara
OVERVIEW Albatross is a small toolkit for developing highly stateful web applications. The toolkit has been designed to take a lot of the pain out of constructing intranet applications although you can also use Albatross for deploying publicly accessed web applications. In slightly more than 45

Re: __getattribute__ and __getattr__

2005-05-31 Thread Gigi
Terry Reedy wrote: > "Gigi" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>Hi, >>In the Python documentation regarding __getattribute__ (more attribute >>access for new style classes) it is mentioned that if __getattribute__ >>is defined __getattr__ will never be called (unless

scripting browsers from Python

2005-05-31 Thread Michele Simionato
I would like to know what is available for scripting browsers from Python. For instance, webbrowser.open let me to perform GET requests, but I would like to do POST requests too. I don't want to use urllib to emulate a browser, I am interested in checking that browser X really works as intended wit

Re: write to the same file from multiple processes at the same time?

2005-05-31 Thread gabor
Mike Meyer wrote: > gabor <[EMAIL PROTECTED]> writes: > > >>ok, i ended up with the following code: >> >>def syncLog(filename,text): >> f = os.open(filename,os.O_WRONLY | os.O_APPEND) >> fcntl.flock(f,fcntl.LOCK_EX) >> os.write(f,text) >> #FIXME: what about releasing the lock? >>

Re: pickle alternative

2005-05-31 Thread Andrew Dalke
simonwittber wrote: >>From the marhal documentation: > Warning: The marshal module is not intended to be secure against > erroneous or maliciously constructed data. Never unmarshal data > received from an untrusted or unauthenticated source. Ahh, I had forgotten that. Though I can't recall what

Re: [ANN] IPython 0.6.14.

2005-05-31 Thread Mark Sargent
Mark Sargent wrote: >Fernando Perez wrote: > > > >>Hi all, >> >>I've just made the 0.6.14 release of IPython, mostly to fix the >>inevitable bugs reported after the .13 one (though one big improvement >>sneaked by). >> >>IPython's homepage is at: >> >>http://ipython.scipy.org >> >>and downloads

Re: avl tree

2005-05-31 Thread Zunbeltz Izaola
On Mon, 30 May 2005 21:13:57 +0200, Berthold Höllmann wrote: > > I'm afraid you won't be happy with the code. It's very old and likely > won't compile. We have an inhouse version of this module which > compiles and run on Sparc solaris (32 Bit) and linux x86 with Python > up to 2.4. I fixed some

Re: prime number

2005-05-31 Thread Mikael Olofsson
lostinpython wrote: > What civil engineers need with all this programming is beyond me. We > have to learn another language to program our CADD software, which I > find much easier than this. According to my experience, almost every engineer - civil or not - uses programming at least occationa

regular expression problem

2005-05-31 Thread [EMAIL PROTECTED]
hi everyone there is a way, using re, to test (for es) in a=[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14] if a list b is composed by three "sublists" of a separated or not by elements. if b=[a2,a3,a4,a7,a8,a12,a13] gives true because in a we have [,a2,a3,a3,...,a7,a8,...,a12,a13,...] or b=[

Re: __getattribute__ and __getattr__

2005-05-31 Thread Peter Otten
Gigi wrote: > to be inaccurate. I fill a little like Leibnitz :-) . It's a curious It's Leibniz -- unless you're in the cookie business. I see your post for the third time, btw. What's wrong? Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: pickle alternative

2005-05-31 Thread simonwittber
> Ahh, I had forgotten that. Though I can't recall what an attack > might be, I think it's because the C code hasn't been fully vetted > for unexpected error conditions. I tried out the marshal module anyway. marshal can serialize small structures very qucikly, however, using the below test va

Re: Newbie Here

2005-05-31 Thread Peter Maas
Mark Sargent schrieb: > I want to get into python to use it for > Linux/Unix related stuff. A question I have, is, those of you who use it > for the same things, what do you primarily use it for. Could you show me > some examples.? - little daily stuff e.g. transforming data - sysadmin tasks (b

Re: how to convert string to list or tuple

2005-05-31 Thread Duncan Booth
Steven Bethard wrote: > Duncan Booth wrote: >> any new style class you have defined and call any of its methods with >> whatever arguments I wish. > > Any new style class that I've defined? Or just any one I pass in as > part of dict(__builtins__=None, ...)? If the former, could you > elabora

Re: plotting with Python

2005-05-31 Thread Rolf Wester
Philippe C. Martin wrote: > Look at wxPython > > Regards, > > Philippe > > I will do it, thank you for your reply. Rolf > > Rolf Wester wrote: > > >>Hi, >> >>I have a Python console application that is intended to be used >>interactively and I have to add plotting capabilities (multiple XY

Re: plotting with Python

2005-05-31 Thread Rolf Wester
[EMAIL PROTECTED] wrote: > We use dislin in my lab. I don't think it's GPL... > > http://www.linmpi.mpg.de/dislin > Hi, thank you for your reply. I tried dislin but this didn't work very well for me. But I will try it again. Regards Rolf -- http://mail.python.org/mailman/listinfo/python-li

Re: regular expression problem

2005-05-31 Thread alex23
[EMAIL PROTECTED] wrote: > hi everyone > there is a way, using re, to test (for es) in > a=[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14] if a list b is > composed by three "sublists" of a separated or not by elements. Heya, Is there any particular reason why you need to use re? If you're usin

Re: How do you drive-by-wire a car using Python ?

2005-05-31 Thread [EMAIL PROTECTED]
Please note we had to avoid trash cans when the DARPA folks came to visit us. Our vehicle aims at being a garbage avoidance system instead :-) Igor. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to run functions in the background?

2005-05-31 Thread Will McGugan
Ognjen Bezanov wrote: > > I had a look into this, but have decided on pymedia, which was more > focused on well... media. > > Either way thanks all of you, I have written my first threaded program, > and it does what I need it to perfectly. > > The only thing i have a problem with now is how to

Re: What are OOP's Jargons and Complexities?

2005-05-31 Thread Xah Lee
the Rise of “Access Specifiers” (or, the Scoping Complexity of OOP) In programing, a variable has a scope — meaning where the variable can be seen. Normally, there are two basic models: dynamically scoped and lexically scoped. Dynamic scoping is basically a time based system, while lexical scoping

Stupid Newbie Question Concerning CGI and Reading Forward Slashes

2005-05-31 Thread Joey C.
Hi, I want to make a configuration script for something and it needs to read inputs from an HTML file. A couple of these inputs are textboxes that the user inputs a path in. For example: Your Home Directory: [/home/me/public_html/] So, I'm using Python to read these inputs and store them in a co

Re: Stupid Newbie Question Concerning CGI and Reading Forward Slashes

2005-05-31 Thread Jatinder Singh
Hi Joey, I am not sure but still I might mean something and give you some clues. Just try to change / with double slash(//) or with backslash(\ or \\). next option is read about os module it can give u some hints about how paths should be written. Hope These will help. Quoting "Joey C." <[EMAIL P

:: winreg ::

2005-05-31 Thread A.K.Sabin
Hi Evrbdy, I do struggle with Registry Keys. ( _winreg ) I am able to Create Keys inside HKEY_LOCAL_MACHINE, =_winreg.HKEY_LOCAL_MACHINE/ IE EXTENSION is MY AIM SOFTWARE/Microsoft/Internet Explorer/Extensions I cant assign the values to CLSID, HOT ICON, EXEC, Default Visible. Please Help me out.

Generalized Linear Least Squares Problems

2005-05-31 Thread venkat
Hi, I want to solve linear least sqaure problem( min||c-Ax||2 subject to Bx=d ). How do I do it in python. lapack has a routine for doing this (DGGLSE). Can I access this from python? TIA, venkat. -- http://mail.python.org/mailman/listinfo/python-list

Re: Generalized Linear Least Squares Problems

2005-05-31 Thread Tim Leslie
On 31 May 2005 03:12:49 -0700, venkat <[EMAIL PROTECTED]> wrote: > Hi, > > I want to solve linear least sqaure problem( min||c-Ax||2 subject to > Bx=d ). How do I do it in python. lapack has a routine for doing this > (DGGLSE). Can I access this from python? > Check out scipy, in particular the l

Re: scripting browsers from Python

2005-05-31 Thread Simon Brunning
On 31 May 2005 00:52:33 -0700, Michele Simionato <[EMAIL PROTECTED]> wrote: > I would like to know what is available for scripting browsers from > Python. > For instance, webbrowser.open let me to perform GET requests, but I > would like > to do POST requests too. I don't want to use urllib to emul

Re: write to the same file from multiple processes at the same time?

2005-05-31 Thread Piet van Oostrum
Isn't a write to a file that's opened as append atomic in most operating systems? At least in modern Unix systems. man open(2) should give more information about this. Like: f = file("filename", "a") f.write(line) f.flush() if line fits into the stdio buffer. Otherwise os.write can be used. As t

Re: Newbie Here

2005-05-31 Thread raviteja . bhupatiraju
Not sure what you mean Unix related stuff. Anything can be. I use Python as a general purpose language. Python is good for most things I do. Recently I used it for Web Applications (CherryPy), Search Engines (Lupy, PyLucene), Middleware (Ice), Swing GUIs (Jython), data transformations etc. -- ht

Re: Newbie Here

2005-05-31 Thread Rob Cowie
As a relalative newbie myself I think I can say Python is used for anything any major programming language is used for. One of its many strengths is scalability - it can be used to great effect as a scripting language AND as an object oriented language for creating large, GUI apps. Yours is not an

Re: Stupid Newbie Question Concerning CGI and Reading Forward Slashes

2005-05-31 Thread Steve Holden
Joey C. wrote: > Hi, I want to make a configuration script for something and it needs to > read inputs from an HTML file. A couple of these inputs are textboxes > that the user inputs a path in. For example: > Your Home Directory: > [/home/me/public_html/] > > So, I'm using Python to read these

Re: What are OOP's Jargons and Complexities?

2005-05-31 Thread Dale King
David Formosa (aka ? the Platypus) wrote: > On Tue, 24 May 2005 09:16:02 +0200, Tassilo v. Parseval > <[EMAIL PROTECTED]> wrote: > >>Also sprach John W. Kennedy: > > [...] > > >>Most often, languages with strong typing can be found on the functional >>front (such as ML and Haskell). These lang

Re: Newbie Here

2005-05-31 Thread Peter Maas
Rob Cowie schrieb: > As a relative newbie myself I think I can say Python is used for > anything any major programming language is used for. My list was meant as an enumeration of tasks for which _I_ _currently_ use Python. You are of course right that Python covers a much wider range, although "a

sys.stderr and thread

2005-05-31 Thread Michele Petrazzo
I have a wxpython application (the main program) and a lot of external modules (import mymodule) that use always 2 thread (one is my application and one is twisted with new threadselectreactor). Sometime when I close my app, I receive a thread error that I want to redirect to a file (I don't know w

Re: eric3 question

2005-05-31 Thread Magnus Lycka
Gerrit van Dyk wrote: > Try using raw_input() instead of the sys.stdin.readline(). raw_input() > is the preferred way of getting console input. Is it? Guido's "Python Regrets" slides (Google for them) seems to say the opposite. Besides, that's not the problem here... Alexander Zatvornitskiy wrot

Re: Exiting SocketServer: socket.error: (98, 'Address already in use')

2005-05-31 Thread Magnus Lycka
Thank's a lot Andrew and Dennis. Andrew Dalke wrote: > You can set the class variable "allow_reuse_address = True" in > your derived ExitableSocketServer to get the behaviour you > expect, at the expense of some problems mentioned in the > above URL. Ok. I added a STOP message to my protocol, so

Re: scripting browsers from Python

2005-05-31 Thread davidb
Michele Simionato wrote: > I would like to know what is available for scripting browsers from > Python. > For instance, webbrowser.open let me to perform GET requests, but I > would like to do POST requests too. I don't want to use urllib to > emulate a browser, I am interested in checking that br

exit after process exit

2005-05-31 Thread [EMAIL PROTECTED]
Hello, I would like to run a python process and wait until the process exit. How can I do it? For example I would like to run a.exe. and wait until a.exe exit. Sincerely Yours, Pujo -- http://mail.python.org/mailman/listinfo/python-list

Re: scripting browsers from Python

2005-05-31 Thread Kent Johnson
Simon Brunning wrote: > On 31 May 2005 00:52:33 -0700, Michele Simionato > <[EMAIL PROTECTED]> wrote: > >>I would like to know what is available for scripting browsers from >>Python. > > I don't know of anything cross platform, or even cross browser, but on > Windows, IE can be automated via COM

Re: regular expression problem

2005-05-31 Thread Kent Johnson
[EMAIL PROTECTED] wrote: > hi everyone > there is a way, using re, to test (for es) in > a=[a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13,a14] if a list b is > composed by three "sublists" of a separated or not by elements. > > if b=[a2,a3,a4,a7,a8,a12,a13] gives true because in a > we have [,a2,

Re: Report generator for object databases.

2005-05-31 Thread Magnus Lycka
Mir Nazim wrote: > Hi, > I m planning to use ZODB for an applicaton. Is any one aware of report > generators like Data Vision, Crystal Reports, fo python object > databases. ZODB isn't like a relational database. It doesn't have a query language etc. In other words, a report generator for a ZODB a

Re: exit after process exit

2005-05-31 Thread Philippe C. Martin
os.popen ? Regards, Philippe [EMAIL PROTECTED] wrote: > Hello, > > I would like to run a python process and wait until the process exit. > How can I do it? > > For example I would like to run a.exe. and wait until a.exe exit. > > Sincerely Yours, > Pujo -- http://mail.python.org/mailman/

Re: regular expression problem

2005-05-31 Thread [EMAIL PROTECTED]
thank you again: i used list and not set because order in my list is important. in fact i'd like to apply this function to strings (or ordered sequences of data). For this reason proposed to use regular expression. best regards. -- http://mail.python.org/mailman/listinfo/python-list

change vars in place w/loop or list comprehension

2005-05-31 Thread ken . boss
I am a python newbie, and am grappling with a fundamental concept. I want to modify a bunch of variables in place. Consider the following: >>> a = 'one' >>> b = 'two' >>> c = 'three' >>> list = [a, b, c] >>> for i in range(len(list)): ... list[i] = list[i].upper() ... >>> [a, b, c] = list >>>

Re: Newbie Here

2005-05-31 Thread Magnus Lycka
Mark Sargent wrote: > A question I have, is, those of you who use it > for the same things, what do you primarily use it for. Erh, I'm sure different people use it for very different things. In contrast to e.g. PHP or bash, Python is a very generic language usable for most preogramming tasks. My

Re: change vars in place w/loop or list comprehension

2005-05-31 Thread Jatinder Singh
Hi what u can do over here is add a,b,c... in a list e.g. list.append(vars..) and then use the statement newlist = map(lambda x:x.upper(),list) Now ur newlist will contain the modified list. HOPE THIS THE BETTER SOLUTION TO UR PROBLEM Quoting [EMAIL PROTECTED]: > I am a python newbie, and am g

Python 2.5 CVS broken for HP-UX platform?

2005-05-31 Thread mg
Hello, While trying to compile Python 2.5 from the nighlty CVS image, it raises the following errors on HP-UX. This disables me the use of HP-UX for some projects: Compilation flags: export CC=aCC export CFLAGS="-Ae +DD64" export LDFLAGS="+DD64" make clean ./configure --prefix=/usr/local/python_c

Re: write to the same file from multiple processes at the same time?

2005-05-31 Thread Steve Holden
Roy Smith wrote: > Peter Hansen <[EMAIL PROTECTED]> wrote: > >>The OP was probably on the right track when he suggested that things >>like SQLite (conveniently wrapped with PySQLite) had already solved this >>problem. > > > Perhaps, but a relational database seems like a pretty heavy-weight >

Seti-like program

2005-05-31 Thread GMane Python
Hello I'd like to consider making a program which is 'seti-like' where I could run a command-line Python script to just 'do something', and then be able to launch a viewer program (maybe linux x11 or Windows, possibly over a network socket) using wxPython to be able to inter-act with it. (Start jo

something like CPAN, PPMs?

2005-05-31 Thread Alex Gittens
I'm new to Python from Perl, and loving it. Has there ever been any discussion of creating a similar resource as CPAN for Python, or a similar distribution method as PPMs? Seems like it would make a great language even better. Alex -- http://tangentspace.net/cz -- http://mail.python.org/mailman/

Re: change vars in place w/loop or list comprehension

2005-05-31 Thread Raymond Hettinger
> >>> a = 'one' > >>> b = 'two' > >>> c = 'three' > >>> [a, b, c] = [s.upper() for s in [a, b, c]] > >>> a > 'ONE' > > Both of these accomplish what I'm after; I prefer the second for its > brevity. But either approach requires that I spell out my list of > vars-to-alter [a, b, c] twice. This stri

Re: standard doc style for method signatures

2005-05-31 Thread David S.
David S. alumni.tufts.edu> writes: > > Is there a generally accepted way to denote method signatures---that is, > expected type or required interface for each argument. > Here is an answer: http://python.org/peps/pep-0257.html http://www.python.org/peps/pep-0008.html -- http://mail.python

Re: sys.stderr and thread

2005-05-31 Thread Peter Hansen
Michele Petrazzo wrote: > I have a wxpython application (the main program) and a lot of external > modules (import mymodule) that use always 2 thread (one is my > application and one is twisted with new threadselectreactor). > Sometime when I close my app, I receive a thread error that I want to >

Re: change vars in place w/loop or list comprehension

2005-05-31 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > I am a python newbie, and am grappling with a fundamental concept. I > want to > modify a bunch of variables in place. Consider the following: > [snip] a = 'one' b = 'two' c = 'three' [a, b, c] = [s.upper() for s in [a, b, c]] > > Both of these accompl

The need to put "self" in every method

2005-05-31 Thread Fernando M.
Hi, i was just wondering about the need to put "self" as the first parameter in every method a class has because, if it's always needed, why the obligation to write it? couldn't it be implicit? Or is it a special reason for this being this way? Thanks. -- http://mail.python.org/mailman/listinf

Re: How do you drive-by-wire a car using Python ?

2005-05-31 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: >Please note we had to avoid trash cans when the DARPA folks came to >visit us. Our vehicle aims at being a garbage avoidance system instead >:-) > >Igor. > Python clearly is unsuitable for Grand Challenges, as I believe

Alternative history (was: prime number)

2005-05-31 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Mike Meyer <[EMAIL PROTECTED]> wrote: . . . >If it isn't a homework assignment, and you're honestly in such, then >you should know there's been a lot of research in this area, because >primes ar

Re: prime number

2005-05-31 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, lostinpython <[EMAIL PROTECTED]> wrote: >It is a homework assignment from a book but not for a class. I'm >trying to teach my self some basic programming before I have to take it >in college. If I show enough understanding of the subject, my advisor >will let me fo

Dr. Dobb's Python-URL! - weekly Python news and links (May 31)

2005-05-31 Thread Simon Brunning
QOTW: "Not tested but confident should be an oxymoron for a programmer." - Peter Otten (Asked "Is this unsurprising if I look at it right?") - "Yes; in general this is true across many domains for a very large number of referents of "it" :-)" - John Machin "Strong typing means there [are] a lot

Re: The need to put "self" in every method

2005-05-31 Thread Steve Holden
Fernando M. wrote: > Hi, > > i was just wondering about the need to put "self" as the first > parameter in every method a class has because, if it's always needed, > why the obligation to write it? couldn't it be implicit? > > Or is it a special reason for this being this way? > > Thanks. > The

Re: how to convert string to list or tuple

2005-05-31 Thread Steven Bethard
Duncan Booth wrote: > e.g. Assuming that the MyDatabase class does something nasty to a file: > class MyDatabase(object): > > def __init__(self, filename): > self.filename = filename > def initialise(self): > print "Splat %s" % self.filename > eval('''[ cls for cl

Re: How do you drive-by-wire a car using Python ?

2005-05-31 Thread [EMAIL PROTECTED]
Cameron, Good point, I know you are a newbie :-). Let me help you out, just tell the guy in the hallway that for the recognition of the spelling for garbage in any other languages we use the zipfile module as pointed out in http://pegasusbridge.blogspot.com/2005/05/on-being-innovative-part-i.html

Re: The need to put "self" in every method

2005-05-31 Thread John Roth
"Fernando M." <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi, > > i was just wondering about the need to put "self" as the first > parameter in every method a class has because, if it's always needed, > why the obligation to write it? couldn't it be implicit? > > Or is it a speci

Re: The need to put "self" in every method

2005-05-31 Thread Steven Bethard
Fernando M. wrote: > i was just wondering about the need to put "self" as the first > parameter in every method a class has because, if it's always needed, > why the obligation to write it? couldn't it be implicit? py> import this The Zen of Python, by Tim Peters Beautiful is better than ugly. Ex

DLL load failed: The specified procedure could not be found

2005-05-31 Thread Bill Davy
sys.path: H:\Husky\HostPC\V1\SHIP\Debug H:\Husky\HostPC\V1\SHIP E:\Bill\Python-2.4.1\PCbuild\python24_d.zip C:\Python24\Lib C:\Python24\DLLs C:\Python24\Lib\lib-tk H:\Husky\HostPC\V1\RunSHIP H:\Husky\HostPC\V1\Debug C:\Python24 C:\Python24\lib\site-packages Traceback (most recent call la

Re: COM+, Javascript and Python

2005-05-31 Thread dannyguindi
Do you guys know if there is a way to do this in Linux? Thanks. Danny -- http://mail.python.org/mailman/listinfo/python-list

Re: The need to put "self" in every method

2005-05-31 Thread Simon Brunning
On 31 May 2005 08:45:45 -0700, Fernando M. <[EMAIL PROTECTED]> wrote: > i was just wondering about the need to put "self" as the first > parameter in every method a class has because, if it's always needed, > why the obligation to write it? It doesn't need to be 'self'. You could use 'this', or 's

Re: Seti-like program

2005-05-31 Thread [EMAIL PROTECTED]
Other examples- PCAnyWhere, a Trojan Horse .. :) Anyway, this is quite simple. All you realy need is a server with a GUI that listens all the time for incoming connections, and a client that will connect to the server and work in the background. Here are some thoughts... - Figure out what ac

Re: The need to put "self" in every method

2005-05-31 Thread Erik Max Francis
Fernando M. wrote: > i was just wondering about the need to put "self" as the first > parameter in every method a class has because, if it's always needed, > why the obligation to write it? couldn't it be implicit? > > Or is it a special reason for this being this way? Because it's not always ne

Re: Running twisted http server - "Method Not Allowed" error

2005-05-31 Thread Richard Townsend
On 30 May 2005 23:50:45 -0700, [EMAIL PROTECTED] wrote: > from twisted.web import server, resource > from twisted.internet import reactor > > class Simple(resource.Resource): > isLeaf = True > def render_GET(self, request): > return "Hello, world!" > > site = server.Site(Simple()

Re: The need to put "self" in every method

2005-05-31 Thread Roy Smith
Fernando M. <[EMAIL PROTECTED]> wrote: >i was just wondering about the need to put "self" as the first >parameter in every method a class has because, if it's always needed, >why the obligation to write it? couldn't it be implicit? Didn't this exact question get asked just a few days ago? Anyway,

Re: sys.stderr and thread

2005-05-31 Thread Michele Petrazzo
Peter Hansen wrote: > Michele Petrazzo wrote: >> This is the exception: >> >> Unhandled exception in thread started by > Thread.__bootstrap of > >> Traceback (most recent call last): >> File "C:\Python23\lib\threading.py", line 451, in __bootstrap >> self.__stop() >> File "C:\Python23\lib\t

Re: COM+, Javascript and Python

2005-05-31 Thread Peter Hansen
dannyguindi wrote: > Do you guys know if there is a way to do this in Linux? What is "this"? Your subject line provides a context, but not a problem to which we can give you the solution. Please be specific. -Peter -- http://mail.python.org/mailman/listinfo/python-list

anygui,anydb, any opinions?

2005-05-31 Thread rzed
Periodically, we see questions about which gui package is best, or which database package to use. These questions typically trigger some exchanges of opinion, though of course this no one best answer, and eventually things quiet down until the next round. But it seems to me that what seldom get

Re: Seti-like program

2005-05-31 Thread GMane Python
I want to have a program download pictures from a netCam (Axis 2100). So, I want to start & stop, and also see progress (how many photos, are there errors, did I begin encoding to DivX, etc) for multiple cameras. -Dave <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Other examples-

Re: how to prepend string to a string?

2005-05-31 Thread flamesrock
Thanks for all the responses :) You're right, Kent. That does exactly what I need it to. Anyways.. if there isn't a prepend function, I'm going to request it from the devs. Would be cool to see that in future versions of python. -- http://mail.python.org/mailman/listinfo/python-list

array concatenation

2005-05-31 Thread [EMAIL PROTECTED]
Hello, I have 2 arrays defined with different typecodes. a = array('B', '\0', 6) b = array('L', '\0', 526) for i in range( 6): a[i] = 0xFF for i in range( 520): b[i] = 0x How do i concatenate these two arrays so that, i get b = 0xff 0xff 0xff 0xff 0xff 0xff 0x 0x

Re: anygui,anydb, any opinions?

2005-05-31 Thread max
rzed <[EMAIL PROTECTED]> wrote in news:Xns9667883C1D343jreeder@ 63.223.7.253: > So what do you think? What's wrong with the picture? Why isn't > there a greater priority to work in this direction? > Without giving any reasons beyond intuition, I would have to say that it boils down to 2 things

Re: scripting browsers from Python

2005-05-31 Thread John J. Lee
"Michele Simionato" <[EMAIL PROTECTED]> writes: > I would like to know what is available for scripting browsers from > Python. > For instance, webbrowser.open let me to perform GET requests, but I > would like > to do POST requests too. I don't want to use urllib to emulate a > browser, I am > int

Re: how to prepend string to a string?

2005-05-31 Thread Peter Hansen
flamesrock wrote: > Thanks for all the responses :) > > You're right, Kent. That does exactly what I need it to. > > Anyways.. if there isn't a prepend function, I'm going to request it > from the devs. Would be cool to see that in future versions of python. Since strings cannot be modified in-p

working with pointers

2005-05-31 Thread Michael
Do expicit pointers exist in python?? if i do: a = [5,7] b = a a.empty() b = ? how do i do explicit pointers?? Mike -- http://mail.python.org/mailman/listinfo/python-list

Re: working with pointers

2005-05-31 Thread Steven Bethard
Michael wrote: > Do expicit pointers exist in python?? > > if i do: > > a = [5,7] > b = a > > a.empty() > > b = ? This is what the interactive prompt is for. Try it: py> a = [5,7] py> b = a py> a.empty() Traceback (most recent call last): File "", line 1, in ? AttributeError: 'list' objec

Re: working with pointers

2005-05-31 Thread Michael
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Michael wrote: > > Do expicit pointers exist in python?? > > > > if i do: > > > > a = [5,7] > > b = a > > > > a.empty() > > > > b = ? > > This is what the interactive prompt is for. Try it: > > py> a = [5,7] > py> b = a

Re: plotting with Python

2005-05-31 Thread Leonard J. Reder
Hi Philippe, You may want to look at HippoDraw application. The web site is http://www.slac.stanford.edu/grp/ek/hippodraw/. I have used both the C++ api and python bindings. They have a layer of python called hippoplotter.py to make it easy to instance the basic plotting canvase and place mult

Re: working with pointers

2005-05-31 Thread Dave Brueck
Michael wrote: > sorry, I'm used to working in c++ :-p > > if i do > a=2 > b=a > b=0 > then a is still 2!? > > so when do = mean a reference to the same object Always. > and when does it mean make a copy of the object?? Never. -Dave -- http://mail.python.org/mailman/listinfo/python-list

Re: working with pointers

2005-05-31 Thread Michael
except numbers?? "Dave Brueck" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Michael wrote: > > sorry, I'm used to working in c++ :-p > > > > if i do > > a=2 > > b=a > > b=0 > > then a is still 2!? > > > > so when do = mean a reference to the same object > > Always. > > > and when

Re: working with pointers

2005-05-31 Thread Ivan Van Laningham
Hi All-- Dave Brueck wrote: > > Michael wrote: > > sorry, I'm used to working in c++ :-p > > > > if i do > > a=2 > > b=a > > b=0 > > then a is still 2!? > > > > so when do = mean a reference to the same object > > Always. > > > and when does it mean make a copy of the object?? > > Never. > T

Re: working with pointers

2005-05-31 Thread Leif K-Brooks
Michael wrote: > a=2 > b=a > b=0 That's more or less equivalent to this C++ code: int *a; int *b; a = new int; *a = 2; b = a; b = new int; *b = 0; -- http://mail.python.org/mailman/listinfo/python-list

[no subject]

2005-05-31 Thread python-list-bounces+archive=mail-archive . com
#! rnews 1598 Newsgroups: comp.lang.python Path: news.xs4all.nl!newsspool.news.xs4all.nl!transit.news.xs4all.nl!newsfeeder.wxs.nl!textfeed1.on.meganewsservers.com!meganewsservers.com!feeder2.on.meganewsservers.com!216.196.98.140.MISMATCH!border1.nntp.dca.giganews.com!nntp.giganews.com!diablo.voice

Re: working with pointers

2005-05-31 Thread Steven Bethard
Michael wrote: > if i do > a=2 > b=a > b=0 > then a is still 2!? > > so when do = mean a reference to the same object and when does it mean make > a copy of the object?? It *always* means a reference. It *never* makes a copy. Although the terminology isn't quite right, you can think of all "var

Re: working with pointers

2005-05-31 Thread Chris Cioffi
Nope, numbers too.  When you do:   a = 4   You are storing a reference to the literal 4 in a.    >>> a = 4>>> dir(a)['__abs__', '__add__', '__and__', '__class__', '__cmp__', '__coerce__', '__delattr__', '__div__', '__divmod__', '__doc__', '__float__', '__floordiv__', '__getattribute__', '__getne wa

Re: Stupid Newbie Question Concerning CGI and Reading Forward Slashes

2005-05-31 Thread Joey C.
Steve Holden wrote: > It's not a common question, but it's relatively easily answered. You are > splitting everything but the filename off with os.path.split and then > complaining about the result! Once you stop doing that your problem is > solved. Thus, it's a stupid newbie question. Thanks a l

Re: working with pointers

2005-05-31 Thread Grant Edwards
On 2005-05-31, Michael <[EMAIL PROTECTED]> wrote: > except numbers?? Um, no? Unless you provide some context, how are we supposed to know what you're asking about? Numbers are immutable, so there is no practical difference. -- Grant Edwards grante Yow! Are we T

Re: working with pointers

2005-05-31 Thread Rocco Moretti
> "Dave Brueck" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>Michael wrote: >> >>>sorry, I'm used to working in c++ :-p >>> >>>if i do >>>a=2 >>>b=a >>>b=0 >>>then a is still 2!? >>> >>>so when do = mean a reference to the same object >> >>Always. >> >> >>>and when does it mea

Re: how to prepend string to a string?

2005-05-31 Thread newcoder
How about this: dirList = ['depth1', 'depth2', 'depth3'] string = """position""" for x in range(len(dirList)): string += '>> %s' % dirList.pop(0) print string flamesrock wrote: > Thanks for all the responses :) > > You're right, Kent. That does exactly what I need it to. > > Anyways..

Re: exit after process exit

2005-05-31 Thread Jeff Epler
You might want os.spawnv(os.P_WAIT, "a.exe", ["a.exe"]) os.system("a.exe") Jeff pgpp3Fxdo0nYA.pgp Description: PGP signature -- http://mail.python.org/mailman/listinfo/python-list

  1   2   >