Re: extreme newbie

2005-06-18 Thread Peter Hansen
cpunerd4 wrote: > even so, > crackers have a harder time getting into compiled programs rather than > intepreted languages. I know hiding the code won't stop all crackers > but it will stop some of the casual theifs won't it? It's not so much > that they could steal code, it's that they could alter

Re: Unbound names in __del__

2005-06-18 Thread Peter Hansen
Torsten Bronger wrote: > Peter Hansen <[EMAIL PROTECTED]> writes: >>What's your use case for del? > > Every instance represents a "session" to a measurement instrument. > After the instance is deleted, the session should be closed to free > resources. You mean like GPIB devices? We've written a

Re: thread.start_new_thread question

2005-06-18 Thread Peter Hansen
Konstantin Veretennicov wrote: > Thank you, but that doesn't answer my question. I was asking if there > is a reason that "args" is not optional. At the risk of increasing your frustration, I'm going avoid answering your question as well and simply point out that if you use the "threading" modul

Re: How should threads be terminated? (related to 'Help with thread related tracebacks')

2005-06-18 Thread Peter Hansen
Maxwell Hammer wrote: > On Thu, 16 Jun 2005 16:20:23 -0400, Peter Hansen wrote: >>If the question was well formulated, and it's been more than a couple of >>days, you should consider reposting. It's very unusual for a post with >>such a subject (if it was a clear question) to get _no_ feedback a

Re: Shortcut to initialize variables

2005-06-18 Thread Peter Hansen
Andrew wrote: > I'm writing a program that will take substitution and transposition > cipher texts and spit out plain text with no human input. So I suppose > I'll have dictionaries of digraphs and trigraphs too; for frequency > analysis. > Do you think this is to heavy of a project to learn the

Re: extreme newbie

2005-06-18 Thread cpunerd4
I see your point, although I don't think there is much a 14 year old can do to sue someone. . . I'm sure my code won't be that valuable untill I'm older though. Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: case/switch statement?

2005-06-18 Thread Peter Hansen
D H wrote: > Peter Hansen wrote: [some stuff Doug didn't like] > I don't think you could have misread my simple suggestion to you any > more completely than you did. Sorry, I'll try harder next time. -Peter -- http://mail.python.org/mailman/listinfo/python-list

Re: regarding popen function

2005-06-18 Thread Peter Hansen
praba kar wrote: >The following way of popen function usage is > wrong or not kindly give me answer regarding this > > time = os.popen("echo %s | tai64nlocal" % > line[2]).read() Did you try it? Just open the Python interactive interpreter and see what happens: Python 2.3.4 (#1, Feb 2 200

Re: What is different with Python ?

2005-06-18 Thread Peter Hansen
D H wrote: > Peter Hansen wrote: >> With respect to the author, and an understanding that there is >> probably much that didn't go into his self-description (add >> "about.htm" to the above URL), it sounds as though he knows primarily, >> perhaps solely, C and C++, and has done relatively little

Re: ANN: Concurrence 0.0.5.2 Alpha

2005-06-18 Thread Cockle Cowrie
On 6/17/05, Daniel Bickett <[EMAIL PROTECTED]> wrote: > Concurrence is a networked file editing program that enables multiple > people to modify a document simultaneously. It is written entirely in > python, and uses the wxPython library for the GUI and the Twisted > library for networking. > > Th

Re: pysqlite - Checking the existance of a table

2005-06-18 Thread Peter Hansen
Gerhard Häring wrote: > Or you can query the sqlite_master table (don't know any specification > off-hand, but it contains the schema information). Item #9 in the FAQ (http://www.sqlite.org/faq.html#q9) shows it as: CREATE TABLE sqlite_master ( type TEXT, name TEXT, tbl_name TEXT, ro

Re: Unbound names in __del__

2005-06-18 Thread Torsten Bronger
Hallöchen! Peter Hansen <[EMAIL PROTECTED]> writes: > Torsten Bronger wrote: > >> Peter Hansen <[EMAIL PROTECTED]> writes: >> >>> What's your use case for del? >> >> Every instance represents a "session" to a measurement instrument. >> After the instance is deleted, the session should be closed t

Re: extreme newbie

2005-06-18 Thread Peter Hansen
cpunerd4 wrote: > I see your point, although I don't think there is much a 14 year old > can do to sue someone. . . I'm sure my code won't be that valuable > untill I'm older though. Thanks You're probably wrong on the first count, and whether you're wrong on the second is entirely up to you. ;-)

Re: Unbound names in __del__

2005-06-18 Thread Peter Hansen
Torsten Bronger wrote: > keithley = GpibInstrument(14) > keithley.write("*IDN?") > print keithley.read() > > A keithley.close() would be a wart in my opinion; instead I want to > hide the whole session thing from the programmer. Besides, I > haven't yet given up the hope that the issu

Re: Unbound names in __del__

2005-06-18 Thread Torsten Bronger
Hallöchen! Peter Hansen <[EMAIL PROTECTED]> writes: > Torsten Bronger wrote: > >> keithley = GpibInstrument(14) >> keithley.write("*IDN?") >> print keithley.read() >> >> A keithley.close() would be a wart in my opinion; instead I want >> to hide the whole session thing from the progra

Re: [PyKDE] Static (why?) PyDateTimeAPI and SIP

2005-06-18 Thread Gerard Vermeulen
On Sat, 18 Jun 2005 19:52:20 +0400 "Denis S. Otkidach" <[EMAIL PROTECTED]> wrote: > I use datetime C API in extension module generated with SIP. But SIP > break the code into several .cpp files compiled separately and > PyDateTimeAPI used by all macros constituting public interface is > declared

Re: extreme newbie

2005-06-18 Thread Steven D'Aprano
On Sat, 18 Jun 2005 12:05:59 -0400, Peter Hansen wrote: > Furthermore, protecting you from someone else making money off a copy of > your program is basically what licenses are for, and if you have noticed > they don't protect even Microsoft (see, for example, entire governments > like the Indo

Re: extreme newbie

2005-06-18 Thread cpunerd4
the problem is that i don't even know the language yet. . . -- http://mail.python.org/mailman/listinfo/python-list

Re: What makes an object uncopyable?

2005-06-18 Thread Konstantin Veretennicov
On 17 Jun 2005 15:41:07 -0700, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I am trying to make a copy of a certain Python object using the > copy.copy() function. When I try to perform this operation I get an > error like the following: > > copy.Error: un(shallow)copyable object of type ... >

Re: OO approach to decision sequence?

2005-06-18 Thread Chinook
On Sat, 18 Jun 2005 09:10:25 -0400, George Sakkis wrote (in article <[EMAIL PROTECTED]>): > "Chinook" wrote: > >> I understand what you are saying. The point I'm messing up my head with >> though, is when the entity (tree node in my case or variable record content >> deconstructing in the aspect

Re: Unbound names in __del__

2005-06-18 Thread Dieter Maurer
Peter Hansen <[EMAIL PROTECTED]> writes on Fri, 17 Jun 2005 08:43:26 -0400: > ... > And I don't recall the last time I saw a __del__ in third-party code I > was examining. > > > What's your use case for del? I had to use one a few days ago: To call the "unlink" method of a "minidom" object

Re: extreme newbie

2005-06-18 Thread Mrsani
> So true. Am I the only one who wonders this: If Python at runtime runs > very much like Java and has generally about the same > speed (or faster) rofl -- http://mail.python.org/mailman/listinfo/python-list

Re: Unbound names in __del__

2005-06-18 Thread Peter Hansen
Torsten Bronger wrote: >>Torsten Bronger wrote: >>>keithley = GpibInstrument(14) >>>keithley.write("*IDN?") >>>print keithley.read() >> [on using atexit] > However, this doesn't close sessions while the program is running. > If the programmer has the above code in a function which is ca

Re: extreme newbie

2005-06-18 Thread Chinook
On Sat, 18 Jun 2005 14:00:35 -0400, Steven D'Aprano wrote (in article <[EMAIL PROTECTED]>): > On Sat, 18 Jun 2005 12:05:59 -0400, Peter Hansen wrote: > >> Furthermore, protecting you from someone else making money off a copy of >> your program is basically what licenses are for, and if you have

oddness in super()

2005-06-18 Thread Michael P. Soulier
Ok, this works in Python on Windows, but here on Linux, with Python 2.4.1, I'm getting an error. The docs say: A typical use for calling a cooperative superclass method is: class C(B): def meth(self, arg): super(C, self).meth(arg) However, when I try this, which works on windows, w

Re: oddness in super()

2005-06-18 Thread Diez B. Roggisch
Michael P. Soulier wrote: Why the difference? Is Python portability overrated? Is this a bug? Certainly a bug - but not in python. The super-method works for new-style classes only. The attached script reproduces your observed behaviour. So kit seems that whatever toolkit you use, it uses n

Re: extreme newbie

2005-06-18 Thread Ed Jensen
Grant Edwards <[EMAIL PROTECTED]> wrote: >> I've guessed that python is purely an interpreted language unless its >> compiled into another language (ie. it needs python installed in order >> to run programs). Is this correct? > > It's just like Java. It's compiled into bytecode and then the > byt

Re: extreme newbie

2005-06-18 Thread Ed Jensen
Renato Ramonda <[EMAIL PROTECTED]> wrote: > The only system (apart from solaris, I guess) that has a JVM by default > is OSX, and it's _NOT_ sun's one, but the internally developed one. Apple licenses Sun's JVM and makes the modifications necessary to run it on OSX. I know I'm being a pedant, bu

Re: extreme newbie

2005-06-18 Thread John Machin
Dennis Lee Bieber wrote: > On 18 Jun 2005 07:48:13 -0700, "cpunerd4" <[EMAIL PROTECTED]> declaimed > the following in comp.lang.python: > > >>even so, >>crackers have a harder time getting into compiled programs rather than >>intepreted languages. I know hiding the code won't stop all crackers >

Re: Threading and serial port access

2005-06-18 Thread willie
Diez wrote: > Apart from that the approach you use is wasting resources - if you are > concerned about that (or better style...) use e.g. twisted with the > serial and parallel support and its so-called select reactor. The idea > behind that concept is that the OS is responsible for scannig IO-Por

Re: Why is there no instancemethod builtin?

2005-06-18 Thread George Sakkis
"Steven Bethard" wrote: > John Reese wrote: > > I now do: > > > > if isinstance(x, list): > > > > It is my understanding that this is what people do nowadays. > > I wouldn't go that far. I don't have an isinstance check for lists > anywhere in my entire codebase. Why do you think you need to c

struct.(un)pack and ASCIIZ strrings

2005-06-18 Thread Sergey Dorofeev
I can use string.unpack if string in struct uses fixed amount of bytes. But is there some extension to struct modue, which allows to unpack zero-terminated string, size of which is unknown? E.g. such struct: long, long, some bytes (string), zero, short, short, short. -- http://mail.python.org/ma

Re: Unbound names in __del__

2005-06-18 Thread Terry Reedy
"Torsten Bronger" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >> Torsten Bronger wrote: >> >>> keithley = GpibInstrument(14) >>> keithley.write("*IDN?") >>> print keithley.read() >>> A keithley.close() would be a wart in my opinion; instead I want >>> to hide the whol

Re: Regex for repeated character?

2005-06-18 Thread Terry Hancock
On Saturday 18 June 2005 02:05 am, John Machin wrote: > Doug Schwarz wrote: > > In article <[EMAIL PROTECTED]>, > > Leif K-Brooks <[EMAIL PROTECTED]> wrote: > >>How do I make a regular expression which will match the same character > >>repeated one or more times, > > How's this? > > > > >>> [x[

Re: Unbound names in __del__

2005-06-18 Thread Torsten Bronger
Hallöchen! "Terry Reedy" <[EMAIL PROTECTED]> writes: > "Torsten Bronger" <[EMAIL PROTECTED]> wrote: > > [...] > >> However, this doesn't close sessions while the program is >> running. If the programmer has the above code in a function >> which is called repeatedly, he may run into trouble. IIR

Re: struct.(un)pack and ASCIIZ strrings

2005-06-18 Thread Terry Reedy
"Sergey Dorofeev" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I can use string.unpack if string in struct uses fixed amount of bytes. I presume you mean struct.unpack(format, string). The string len must be known when you call, but need not be fixed across multiple calls with

Re: extreme newbie

2005-06-18 Thread Harlin Seritt
? -- http://mail.python.org/mailman/listinfo/python-list

Re: oddness in super()

2005-06-18 Thread John Machin
Michael P. Soulier wrote: > Ok, this works in Python on Windows, but here on Linux, with Python 2.4.1, I'm > getting an error. > > The docs say: > > A typical use for calling a cooperative superclass method is: > > class C(B): > def meth(self, arg): > super(C, self).meth(arg) > > H

Re: Loop until condition is true

2005-06-18 Thread Michael J. Fromberger
In article <[EMAIL PROTECTED]>, Andrea Griffini <[EMAIL PROTECTED]> wrote: > On Sat, 18 Jun 2005 13:35:16 -, Grant Edwards <[EMAIL PROTECTED]> > wrote: > > >AFAICT, the main use for do/while in C is when you want to > >define a block of code with local variables as a macro: > > When my job

Re: struct.(un)pack and ASCIIZ strrings

2005-06-18 Thread John Machin
Terry Reedy wrote: > "Sergey Dorofeev" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>I can use string.unpack if string in struct uses fixed amount of bytes. > > > I presume you mean struct.unpack(format, string). The string len must be > known when you call, but need not b

Re: Regex for repeated character?

2005-06-18 Thread John Machin
Terry Hancock wrote: > On Saturday 18 June 2005 02:05 am, John Machin wrote: > >>Doug Schwarz wrote: >> >>>In article <[EMAIL PROTECTED]>, >>> Leif K-Brooks <[EMAIL PROTECTED]> wrote: >>> How do I make a regular expression which will match the same character repeated one or more times, >>>

MONEY, MONEYYYY

2005-06-18 Thread LIDERANÇA!!
Querido Amigo, Você pode ganhar 50.000 REAIS ou mais nos próximos 90 dias, parece impossível? Prossiga lendo todos os detalhes (não há nada escondido)... Atenção: esta é a tradução feita e adaptada para português. No final desta tradução encontrará o original em inglês para eventual uso. D

Is there something similar to ?: operator (C/C++) in Python?

2005-06-18 Thread Bo Peng
Hi, I need to pass a bunch of parameters conditionally. In C/C++, I can do func(cond1?a:b,cond2?c:d,.) In Python, I am using temporary variables like if cond1: para1 = a else: para1 = b # # a bunch of such if/else func(para1, para2,...) Is there an easier way to do this in Pyt

Re: Loop until condition is true

2005-06-18 Thread Joseph Garvin
Peter Otten wrote: >I found 136 occurrences of "do {" versus 754 of "while (" and 1224 of "for >(" in the Python 2.4 source, so using these rough estimates do-while still >qualifies as "rarely used". > >Peter > > > That's 136 times you'd have to use an ugly hack instead. I definitely wouldn't m

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-18 Thread Peter Hansen
Bo Peng wrote: > I need to pass a bunch of parameters conditionally. In C/C++, I can do > func(cond1?a:b,cond2?c:d,.) > > Is there an easier way to do this in Python? Please read the FAQ to learn the answer and much other useful information. In this case, the specific entry follows, but you

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-18 Thread Hsuan-Yeh Chang
Bo Peng wrote: > Hi, > > I need to pass a bunch of parameters conditionally. In C/C++, I can do > > func(cond1?a:b,cond2?c:d,.) > > In Python, I am using temporary variables like > > if cond1: >para1 = a > else: >para1 = b > > # > # a bunch of such if/else > > func(para1, pa

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-18 Thread Roy Smith
Bo Peng <[EMAIL PROTECTED]> wrote: > I need to pass a bunch of parameters conditionally. In C/C++, I can do > > func(cond1?a:b,cond2?c:d,.) Python does not have a ternary operator analogous to C's :?. There are some ugly hacks you can play with the logical operators to emulate :?, but in m

Re: extreme newbie

2005-06-18 Thread Kent Johnson
Harlin Seritt wrote: > Am I the only one who wonders this: If Python at runtime runs > very much like Java and has generally about the same speed (or faster), > then why in the world isn't Java becoming more archaic and being > steadily replaced by Python? I ask this not as a rhetorical question, >

Re: extreme newbie

2005-06-18 Thread Steven D'Aprano
On Sat, 18 Jun 2005 15:43:24 -0400, Chinook wrote: > Steven, > > Your weigh-in on semantics is misleading, How is it misleading? > but your elaboration of the aspect is very well put. > > As to semantics, piracy is to the originator what freedom fighter is to those > that perceive themselve

Re: extreme newbie

2005-06-18 Thread Brian
Hi Cpunerd4, For beginners, I would strongly recommend checking out http://www.GreenTeaPress.com -- they publish a FREE, online book that is used in Highschools and other educational facilities to teach Python programming. Excellent -- a must have for those who wish to learn about the languag

Re: Is there something similar to ?: operator (C/C++) in Python?

2005-06-18 Thread Bo Peng
>>In Python, I am using temporary variables like >> >>if cond1: >> para1 = a >>else: >> para1 = b >> >># >># a bunch of such if/else >> >>func(para1, para2,...) > > > Yeah, that's how I would do it. How many of these things do you have? I have around 10 of them. Using these if/else, it

SciPy gui_thread Problem

2005-06-18 Thread Hsuan-Yeh Chang
Dear SciPy users, Can anyone tell me the reason for following error messages: >>> import gui_thread >>> gui_thread.start() Traceback (most recent call last): File "/usr/lib/python2.4/site-packages/scipy_base/pexec.py", line 56, in run exec (code, frame.f_globals,frame.f_locals) File "", l

Re: Loop until condition is true

2005-06-18 Thread Ron Adam
Joseph Garvin wrote: > Peter Otten wrote: > >> I found 136 occurrences of "do {" versus 754 of "while (" and 1224 of >> "for >> (" in the Python 2.4 source, so using these rough estimates do-while >> still >> qualifies as "rarely used". >> >> Peter >> >> >> > That's 136 times you'd have to use

Re: oddness in super()

2005-06-18 Thread Michael P. Soulier
On 18/06/05 Diez B. Roggisch said: > Certainly a bug - but not in python. The super-method works for > new-style classes only. > > The attached script reproduces your observed behaviour. So kit seems > that whatever toolkit you use, it uses new-style classes on windows, and > old-style ones on

Extensions on Linux: import without underscore?

2005-06-18 Thread James Carroll
Hi, I'm creating an extension called _bright.so on linux. I can import it with import _bright, but how can I import bright and get the package? On windows, I've been able to import bright instead of import _bright, but on Linux it seems to need the underscore. I'm tempted to create a bright.py w

Re: SciPy gui_thread Problem

2005-06-18 Thread Robert Kern
Hsuan-Yeh Chang wrote: > Dear SciPy users, If you want to address Scipy users, you should post to the Scipy mailing list. > Can anyone tell me the reason for following error messages: > > import gui_thread gui_thread.start() > > Traceback (most recent call last): > File "/usr/lib/py

Re: Extensions on Linux: import without underscore?

2005-06-18 Thread Robert Kern
James Carroll wrote: > Hi, I'm creating an extension called _bright.so on linux. I can > import it with import _bright, but how can I import bright and get the > package? > > On windows, I've been able to import bright instead of import _bright, That has to be a bug. You shouldn't rely on that b

Re: Extensions on Linux: import without underscore?

2005-06-18 Thread jchiang
Try SharedLibrary("bright.so", SHLIBPREFIX="", ...) The prefix option is documented here http://www.scons.org/doc/HTML/scons-man.html -- http://mail.python.org/mailman/listinfo/python-list

Re: Extensions on Linux: import without underscore?

2005-06-18 Thread James Carroll
Thanks Robert. > > Call it bright.so . > If I rename it bright.so, then I get the error: ImportError: dynamic module does not define init function (initbright) I'm using swig with the module declaration %module bright I've looked at some other source, and it looks like there are some good

Re: Extensions on Linux: import without underscore?

2005-06-18 Thread Robert Kern
James Carroll wrote: > Thanks Robert. > >>Call it bright.so . > > If I rename it bright.so, then I get the error: > ImportError: dynamic module does not define init function (initbright) Sorry, I should have been clearer. Just renaming the file won't help. The init function also needs to be a

What platforms have Python Virtual Machines and what version(s) of Python do they support?

2005-06-18 Thread Casey Hawthorne
What platforms have Python Virtual Machines and what version(s) of Python do they support? In particular: Palm OS PocketPC What version of Python does Jython support? Does any machine running a JVM support Jython? Does it depend on the JVM version and if it's J2ME? Thank you for your time! -- Re

Re: pickle alternative

2005-06-18 Thread simonwittber
> I think you should implement it as a C extension and/or write a PEP. > This has been an unfilled need in Python for a while (SF RFE 467384). I've submitted a proto PEP to python-dev. It coming up against many of the same objections to the RFE. Sw. -- http://mail.python.org/mailman/listinfo/py

Re: pickle alternative

2005-06-18 Thread Paul Rubin
[EMAIL PROTECTED] writes: > > I think you should implement it as a C extension and/or write a PEP. > > This has been an unfilled need in Python for a while (SF RFE 467384). > > I've submitted a proto PEP to python-dev. It coming up against many of > the same objections to the RFE. See also bug# 4

Re: Help implementing an idea

2005-06-18 Thread Tim Roberts
[EMAIL PROTECTED] wrote: > >Well, I'm a total python n00b, but I was playing around with exception >handling >yesterday, and was stricken by how incredibly easy it is to use the op system >to create nice scripts... I did the following: > >import sys >lines = sys.stdin.readlines() >lines.sort() >

Re: Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-18 Thread Leif K-Brooks
Steven D'Aprano wrote: > The language is *always* spelt without the "a", and usually all in > lower-case: perl. The language is title-cased (Perl), but the standard interpreter is written in all lowercase (perl). Sort of like the distinction between Python and CPython. -- http://mail.python.org/m

Re: Regex for repeated character?

2005-06-18 Thread John Machin
Doug Schwarz wrote: > In article <[EMAIL PROTECTED]>, > Leif K-Brooks <[EMAIL PROTECTED]> wrote: > > >>How do I make a regular expression which will match the same character >>repeated one or more times, instead of matching repetitions of any >>(possibly non-same) characters like ".+" does? In o

functions with unlimeted variable arguments...

2005-06-18 Thread Xah Lee
how can i define a function with variable parameters? For example, f(a) would return [a] f(a,b) would return [a,b] f(a,b,...) would return [a,b,...] One solution is of course to make the argument as a list. i.e. f([a,b,...]) but are there other solutions? Xah [EMAIL PROTECTED] ∑ http://xahlee.

Re: Loop until condition is true

2005-06-18 Thread Peter Otten
Donn Cave wrote: > If you look at C code, at least in my experience the > "until" loop is quite rarely used.  (I don't see it once in the source > to Python 2.4, for example.) Long time no C? 'until' in C is actually do statement while (expression); I found 136 occurrences of "do {" ver

Re: What is different with Python ?

2005-06-18 Thread Michele Simionato
Your position reminds me of this: http://www.pbm.com/~lindahl/real.programmers.html Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Migrating from Windows to OS X

2005-06-18 Thread [EMAIL PROTECTED]
Hello, fellow programmers! I am sitting in front of a nice new PowerBook portable which has OS 10.4 installed. The Python.org web site says that Apple has shipped OS 10.4 with Python 2.3.5 installed. How exactly do I access this? I have searched through the Applications and Libraries folders.

Re: OO approach to decision sequence?

2005-06-18 Thread Jordan Rastrick
I've coded some simple recursive tree data structures using OO before (unfortunately not in Python though). It's not nessecarily an ill-suited approach to the task, although it depends on the specific details of what you're doing. What's the the piece of code from which your if...elif fragment is t

Re: smtplib and TLS

2005-06-18 Thread Matthias Kluwe
> "Matthias Kluwe" <[EMAIL PROTECTED]> writes: >> The server accepts and delivers my messages, but the last command >> raises >> socket.sslerror: (8, 'EOF occurred in violation of protocol') >> Did I miss something? Any hint is welcome. > Looks like the module didn't send an TLS Close Notify mes

Re: functions with unlimeted variable arguments...

2005-06-18 Thread Paul Rubin
"Xah Lee" <[EMAIL PROTECTED]> writes: > but are there other solutions? > > Xah Geez man, haven't you been around long enough to read the manual? def f(*a): return a -- http://mail.python.org/mailman/listinfo/python-list

Re: Migrating from Windows to OS X

2005-06-18 Thread Kalle Anke
On Sat, 18 Jun 2005 09:26:23 +0200, [EMAIL PROTECTED] wrote (in article <[EMAIL PROTECTED]>): > I am sitting in front of a nice new PowerBook portable which has OS > 10.4 installed. The Python.org web site says that Apple has shipped OS > 10.4 with Python 2.3.5 installed. How exactly do I access

Re: extreme newbie

2005-06-18 Thread Jordan Rastrick
Another thing to keep in mind is that while technically both Python and Java are converted into intermediate byte-codes, which are then interpreted, the Java Virtual Machine runs java bytecode significantly faster. Partly this is because Sun have put a lot of effort into making Java as fast as poss

Re: functions with unlimeted variable arguments...

2005-06-18 Thread John Machin
Xah Lee wrote: > how can i define a function with variable parameters? For example, > > f(a) would return [a] > f(a,b) would return [a,b] > f(a,b,...) would return [a,b,...] > > One solution is of course to make the argument as a list. i.e. > f([a,b,...]) > but are there other solutions? > >>> d

Re: smtplib and TLS

2005-06-18 Thread Paul Rubin
"Matthias Kluwe" <[EMAIL PROTECTED]> writes: > Hmm. I tried > > server.sock.realsock.shutdown(2) > before server.quit() with the result of I don't think that's exactly what you want. You need to send a specific TLS message BEFORE shutting down the socket, to tell the other end that the TLS conne

Python documentation problem

2005-06-18 Thread Xah Lee
Python documentation, http://python.org/doc/2.4.1/lib/typesfunctions.html - 2.3.10.3 Functions Function objects are created by function definitions. The only operation on a function object is to call it: func(argument-list). There are really two flavors of function objects: buil

Re: OO approach to decision sequence?

2005-06-18 Thread Brian van den Broek
Chinook said unto the world upon 18/06/2005 02:17: > OO approach to decision sequence? > - > > In a recent thread (Cause for using objects?), Chris Smith replied with (in > part): > > >> If your table of photo data has several types of photos, and you find >>

Re: Python documentation problem

2005-06-18 Thread Erik Max Francis
Xah Lee wrote: > Fuck the python doc wasted my time. Fuck python coders. Use your words! -- Erik Max Francis && [EMAIL PROTECTED] && http://www.alcyone.com/max/ San Jose, CA, USA && 37 20 N 121 53 W && AIM erikmaxfrancis The mind is not a vessel to be filled but a fire to be kindled. -- P

Re: OO approach to decision sequence?

2005-06-18 Thread John Machin
Jordan Rastrick wrote: > I've coded some simple recursive tree data structures using OO before > (unfortunately not in Python though). It's not nessecarily an > ill-suited approach to the task, although it depends on the specific > details of what you're doing. What's the the piece of code from whi

Re: Back to the future - python to C++ advice wanted

2005-06-18 Thread Kay Schluehr
D H wrote: > That's why so many people have switched to Java or C# (or Python and > other langugages of course). You might talk to them about using Python, > since Python and C/C++ fit together very nicely (with tools like BOOST, > SWIG, Pyrex,...). But me personally I like to avoid C++ altogeth

Re: Python documentation problem

2005-06-18 Thread Xah Lee
i wanted to find out if Python supports eval. e.g. somecode='3+4' print eval(somecode) # prints 7 in the 14 hundred pages of python doc, where am i supposed to find this info? Xah [EMAIL PROTECTED] ∑ http://xahlee.org/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python documentation problem

2005-06-18 Thread Brian van den Broek
Xah Lee said unto the world upon 18/06/2005 03:49: > Python documentation, > http://python.org/doc/2.4.1/lib/typesfunctions.html > > - > 2.3.10.3 Functions > > Function objects are created by function definitions. The only > operation on a function object is to call it: func(argu

Re: Python documentation problem

2005-06-18 Thread Brian van den Broek
Xah Lee said unto the world upon 18/06/2005 04:11: > i wanted to find out if Python supports eval. e.g. > > somecode='3+4' > print eval(somecode) # prints 7 > > in the 14 hundred pages of python doc, where am i supposed to find this > info? > > Xah > [EMAIL PROTECTED] > ∑ http://xahlee.org/ >

Re: Python documentation problem

2005-06-18 Thread John Machin
Xah Lee wrote: > i wanted to find out if Python supports eval. e.g. > > somecode='3+4' > print eval(somecode) # prints 7 > > in the 14 hundred pages of python doc, where am i supposed to find this > info? > Option 1: As they say in the classics, "Suck it and see". If you want to find out if som

Re: OO approach to decision sequence?

2005-06-18 Thread Chinook
On Sat, 18 Jun 2005 03:52:28 -0400, Brian van den Broek wrote (in article <[EMAIL PROTECTED]>): > Chinook said unto the world upon 18/06/2005 02:17: >> OO approach to decision sequence? >> - >> >> In a recent thread (Cause for using objects?), Chris Smith replied w

Re: Migrating from Windows to OS X

2005-06-18 Thread Chinook
On Sat, 18 Jun 2005 03:26:23 -0400, [EMAIL PROTECTED] wrote (in article <[EMAIL PROTECTED]>): > Hello, fellow programmers! > > I am sitting in front of a nice new PowerBook portable which has OS > 10.4 installed. The Python.org web site says that Apple has shipped OS > 10.4 with Python 2.3.5 ins

Re: regarding popen function

2005-06-18 Thread Michael Hoffman
praba kar wrote: >The following way of popen function usage is > wrong or not kindly give me answer regarding this > > time = os.popen("echo %s | tai64nlocal" % > line[2]).read() I don't know, I don't know what tai64nlocal is or what's in line[2]. What happened when you tried it? Personall

Re: Overcoming herpetophobia (or what's up w/ Python scopes)?

2005-06-18 Thread Steven D'Aprano
On Sat, 18 Jun 2005 04:26:13 +, Dennis Lee Bieber wrote: > On Sat, 18 Jun 2005 03:02:13 +1000, Steven D'Aprano > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > >> >> The language is *always* spelt without the "a", and usually all in >> lower-case: perl. >> > Given

Using swig to use an existing dll/library

2005-06-18 Thread peter . o . mueller
Hi together, i have a Windows DLL in C that is internally multithreaded and provides a callback function to signal specific events. As I understood one can use "normal" C-code with swig. Is it also possible to use existing DLLs? Does swig can also handel the callback method? If not - is there anot

Re: Python documentation problem

2005-06-18 Thread Xah Lee
Apparently i tried it before posting eval '3' and got misleading errors because i forgot the parenthesis... This is a easy one to find in the doc... The unhelpful doc organization and past experiences confounded this case. Thanks. Xah [EMAIL PROTECTED] ∑ http://xahlee.org/ -- http://mail.pyt

Re: exceptions considered harmful

2005-06-18 Thread Steven D'Aprano
On Fri, 17 Jun 2005 20:00:39 -0400, Roy Smith wrote: > "H. S. Lahman" <[EMAIL PROTECTED]> wrote: >> > Never throw an exception. And if someone throws one at you, >> > catch it immediately and don't pass it on. >> >> IMO, this is generally fine advice. Languages provide exception >> hand

Re: Python documentation problem

2005-06-18 Thread Tassilo v. Parseval
Also sprach Xah Lee: > i wanted to find out if Python supports eval. e.g. > > somecode='3+4' > print eval(somecode) # prints 7 > > in the 14 hundred pages of python doc, where am i supposed to find this > info? You are not going to find it in comp.lang.perl.misc. Tassilo -- use bigint; $n=71423

Re: Python documentation problem

2005-06-18 Thread Xah Lee
> what is wrong with python doc > http://python.org/doc/2.4.1/lib/typesfunctions.html the problem is that the page essentially says nothing. Nothing that is relevant to programing, and such nothingness occupies a significant portion of the python doc. (at least a quarter) It is like reading a manu

Re: pygtk question

2005-06-18 Thread Christophe Lambin
"RunLevelZero" <[EMAIL PROTECTED]> wrote: > Hopefully someone can help me out here. It's probably super simple but > how do you select multiple items in a treeview? I have > gtk.SELECTION_MULTIPLE set but of course that was enough. It should be enough to do this: treeview.get_selection

Re: Python documentation problem

2005-06-18 Thread Kalle Anke
On Sat, 18 Jun 2005 11:49:38 +0200, Xah Lee wrote (in article <[EMAIL PROTECTED]>): > the problem is that the page essentially says nothing. Nothing that is > relevant to programing, and such nothingness occupies a significant > portion of the python doc. (at least a quarter) It is like reading a

Re: utf8 and ftplib

2005-06-18 Thread Fredrik Lundh
Richard Lewis wrote: > OK, I've fiddled around a bit more but I still haven't managed to get it > to work. I get the fact that its not the FTP operation thats causing the > problem so it must be either the xml.minidom.parse() function (and > whatever sort of file I give that) or the way that I wri

Re: Python documentation problem

2005-06-18 Thread Steven D'Aprano
On Sat, 18 Jun 2005 12:02:07 +0200, Kalle Anke wrote: > On Sat, 18 Jun 2005 11:49:38 +0200, Xah Lee wrote > (in article <[EMAIL PROTECTED]>): > >> the problem is that the page essentially says nothing. Nothing that is >> relevant to programing, and such nothingness occupies a significant >> porti

Re: What is different with Python ?

2005-06-18 Thread Andrea Griffini
On 18 Jun 2005 00:26:04 -0700, "Michele Simionato" <[EMAIL PROTECTED]> wrote: >Your position reminds me of this: > >http://www.pbm.com/~lindahl/real.programmers.html Yeah, but as I said I didn't use a TRS-80, but an Apple ][. But the years were those ;-) Andrea -- http://mail.python.org/mailman

  1   2   >