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: 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: 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

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: 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

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 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 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: 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

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: 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

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

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: 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

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: 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 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: 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: 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 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: 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

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

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

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, >>>

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: 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: 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: extreme newbie

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

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: 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: 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 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

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: 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

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: 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: 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 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: 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

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: 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

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 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 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: 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: 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: 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: 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: [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: 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: 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: 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 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: Set of Dictionary

2005-06-18 Thread Raymond Hettinger
[Vibha] > I know sets have been implemented using dictionary but > I absolutely need to have a set of dictionaries...any > ideas how to do that? Yes. Create a dictionary subclass that is hashable. Be sure not to mutate it after using it in a set. >>> class FrozenDict(dict): def __hash__(s

Static (why?) PyDateTimeAPI and SIP

2005-06-18 Thread Denis S. Otkidach
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 static. The current solution is to define my own functions in main module as workaround:

Re: Migrating from Windows to OS X

2005-06-18 Thread Kalle Anke
On Sat, 18 Jun 2005 17:07:04 +0200, [EMAIL PROTECTED] wrote (in article <[EMAIL PROTECTED]>): > How are the development tools for the Mac? I'll use IDLE if it's > available, but I like Scintilla better. Don't know ... I think that MacPython is perhaps what you're looking for. Personally, I use

Re: Python documentation problem

2005-06-18 Thread axel
In comp.lang.perl.misc Xah Lee <[EMAIL PROTECTED]> 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? By using the index - it's an alphabetical list of

Re: Migrating from Windows to OS X

2005-06-18 Thread Maurice LING
[EMAIL PROTECTED] wrote: > 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

Re: Migrating from Windows to OS X

2005-06-18 Thread [EMAIL PROTECTED]
Kalle Anke wrote: > 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 inst

Re: Loop until condition is true

2005-06-18 Thread Andrea Griffini
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 was squeezing most out of the CPU (videogame industry) I remember that the asm code generat

Re: extreme newbie

2005-06-18 Thread cpunerd4
by the way, you guys have talked me out of java. Im thinking about this py2exe thing. (anyother suggestions) I like this list. :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop until condition is true

2005-06-18 Thread Donn Cave
Quoth Peter Otten <[EMAIL PROTECTED]>: ... | 'until' in C is actually | | do | statement | while (expression); Oops. Well, QED - I sure don't need it often. Donn Cave, [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: extreme newbie

2005-06-18 Thread cpunerd4
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 it and release it somewer

Re: extreme newbie

2005-06-18 Thread Grant Edwards
On 2005-06-18, cpunerd4 <[EMAIL PROTECTED]> wrote: > what I mean by secure is that no one can steal the code. Distributing bytecode (Java or Python) vs. source only makes little difference if your code is really worth stealing. Distributing compiled C code will make it a little more difficult, bu

Localization in OSX

2005-06-18 Thread Dariosky
Hi, I have a problem with L10N of an app, I'm unable to retrieve default language in mac while this works for both Linux and Windows: LOCALE=locale.getdefaultlocale() Where can I find default system settings with mac? -- dariosky http://dariosky.altervista.org/ -- http://mail.python.org/mail

Re: extreme newbie

2005-06-18 Thread Diez B. Roggisch
cpunerd4 wrote: > what I mean by secure is that no one can steal the code. I want to > create comercial applications eventually. (although I will work on open > source I hope, so don't get mad at me) and calling me cpunerd4 will be > fine. Commercial applications don't suffer from code-stealing. T

Re: extreme newbie

2005-06-18 Thread Renato Ramonda
Grant Edwards ha scritto: > Python is required and Java is optional and not installed by > default in the Linux distros I'm familiar with. > > I don't know how many Windows systems have Java installed. > I don't think any of mine do. It's pretty much the other way round: java CANNOT be included

Re: extreme newbie

2005-06-18 Thread Renato Ramonda
cpunerd4 ha scritto: > > Another reason I was thinging java was because you can > run it in the browser. Bad idea in 99% of the cases: applets are evil. -- Renato Usi Fedora? Fai un salto da noi: http://www.fedoraitalia.org -- http://mail.python.org/mailman/list

Re: extreme newbie

2005-06-18 Thread cpunerd4
what I mean by secure is that no one can steal the code. I want to create comercial applications eventually. (although I will work on open source I hope, so don't get mad at me) and calling me cpunerd4 will be fine. -- http://mail.python.org/mailman/listinfo/python-list

Re: MixIn method to call the method it overrides: how?

2005-06-18 Thread [EMAIL PROTECTED]
Something like this will do what you want to achieve. I think the above does as well what you want, but to me my solution is much more clear class Base(object): def foo(self): print 'Base foo' class Derived(Base): def foo(self): super(Derived, self)

Re: extreme newbie

2005-06-18 Thread Steven D'Aprano
On Sat, 18 Jun 2005 15:00:02 +0200, Renato Ramonda wrote: > cpunerd4 ha scritto: >> thanks all for the advice. The reason I was thinking about using java >> (or C or something) was that it is a little more secure than >> distributing the source code isn't it? > > As in "protecting your code from

Re: extreme newbie

2005-06-18 Thread Grant Edwards
On 2005-06-18, cpunerd4 <[EMAIL PROTECTED]> wrote: > what is this py2exe thing? > Is py2exe included? > Where can I find it? http://www.google.com/search?q=py2exe -- Grant Edwards grante Yow! I just bought at FLATB

Re: Loop until condition is true

2005-06-18 Thread Tim Williams
- Original Message - From: "Remi Villatel" <[EMAIL PROTECTED]> > There is always a "nice" way to do things in Python but this time I can't > find one. > So far, all I got is: > > while True: > some(code) > if final_condition is True: > break > # > # > > What I don't find so "nice" is t

Re: Why is there no instancemethod builtin?

2005-06-18 Thread John Roth
"John Reese" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Why hello there ha ha. > > I have got in the habit of testing the types of variables with > isinstance and the builtin type names instead of using the types > module, as was the style back around Python 2.1. That is, rathe

Re: pysqlite - Checking the existance of a table

2005-06-18 Thread Gerhard Häring
rh0dium wrote: > Hi all, > > I am starting to play with pysqlite, and would like to know if there is > a function to determine if a table exists or not. You can try to access the table in a try-catch block, something like: cur.execute("select * from tablename where 1=2") and check if it fails.

Re: extreme newbie

2005-06-18 Thread cpunerd4
what is this py2exe thing? I think its what i've been looking for...(and inno setup was in my plans (or maby null soft installer...)). Another reason I was thinging java was because you can run it in the browser. Is py2exe included? Where can I find it? thanks, cpunerd4 -- http://mail.python.org

Re: Python documentation problem

2005-06-18 Thread Jürgen Exner
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? Why are you asking in a Perl NG for information about Python? Or are you also asking your bac

Re: Python documentation problem

2005-06-18 Thread Jürgen Exner
Xah Lee wrote: > Python documentation, > [...] Python Reference Manual for more information. > [...] python doc wasted my time. [...] python coders. > [...] use python doc > python community [...] coding in python. [Sexual explicatives deleted] And this outburst has exactly _what_ to do with Perl

Re: Python documentation problem

2005-06-18 Thread Grant Edwards
On 2005-06-18, Xah Lee <[EMAIL PROTECTED]> wrote: [...] > Fuck the python doc wasted my time. Fuck python coders. Each > time i tried to use python doc and got frustrated because it > being grossly incompetent, i'll post a message like this, no > more frequent than once a week. This will go on as

Re: Loop until condition is true

2005-06-18 Thread Grant Edwards
On 2005-06-18, Peter Otten <[EMAIL PROTECTED]> 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

Re: extreme newbie

2005-06-18 Thread Grant Edwards
On 2005-06-18, Renato Ramonda <[EMAIL PROTECTED]> wrote: >> And also, from what I know, the Java virtual machine is more >> popular (and installed on more computers). > > And it is also HUGE, so anyone NOT having it will think twice > before downloading it only for your app. Python on the other >

Re: extreme newbie

2005-06-18 Thread Grant Edwards
On 2005-06-18, cpunerd4 <[EMAIL PROTECTED]> wrote: > thanks all for the advice. The reason I was thinking about using java > (or C or something) was that it is a little more secure than > distributing the source code isn't it? A little. Not much. You don't have to distribute Python source code,

Re: Threading and serial port access

2005-06-18 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Hi, > > I'm writing a program which requires the use of three serial ports and > one parallel port. My application has a scanning devices on each port, > which I can access fine with pyserial. However, I'm unsure of how > exactly I should be designing the program, I th

Re: smtplib and TLS

2005-06-18 Thread Tim Williams
- Original Message - From: "Paul Rubin" "http://phr.cx"@NOSPAM.invalid > "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

Re: pysqlite - Checking the existance of a table

2005-06-18 Thread Cousin Stanley
| I am starting to play with pysqlite, | and would like to know if there is a function | to determine if a table exists or not. rh0dium One way to get at a list of table names in an SQLite data base is to query the sqlite_master table import sys import sqlite this_db = sy

Re: OO approach to decision sequence?

2005-06-18 Thread George Sakkis
"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 example I noted) is not an instance of a class > already - it is obtained from an external source

Threading and serial port access

2005-06-18 Thread willie
Hi, I'm writing a program which requires the use of three serial ports and one parallel port. My application has a scanning devices on each port, which I can access fine with pyserial. However, I'm unsure of how exactly I should be designing the program, I thought I could use threading to start

Re: extreme newbie

2005-06-18 Thread Renato Ramonda
cpunerd4 ha scritto: > thanks all for the advice. The reason I was thinking about using java > (or C or something) was that it is a little more secure than > distributing the source code isn't it? As in "protecting your code from prying eyes"? Then java is exactly like python: I can distribute a

Re: exceptions considered harmful

2005-06-18 Thread Andrea Griffini
On Fri, 17 Jun 2005 20:00:39 -0400, Roy Smith <[EMAIL PROTECTED]> wrote: >This sounds like a very C++ view of the world. In Python, for example, >exceptions are much more light weight and perfectly routine. The problem with exceptions is coping with partial updatd state. Suppose you call a comp

  1   2   >