Re: Multithreaded Python FSM (Harel State Machines)

2005-06-18 Thread Leonard J. Reder
WOW! Thanks, this looks remarkabley close to what I was talking about. Len fraca7 wrote: Leonard J. Reder a crit : [snip] http://smc.sourceforge.net/ It's probably not what you're looking for, but it's the closest I can think of. --

Re: ANN: IssueTrackerProduct 0.6.9 with AJAX and Reports

2005-06-18 Thread serseri_30666
selam benim ismim samet bende sizin gruba katilmak istiyorumkabul ederseniz sevinirim etmeseniz ayrilirim -- http://mail.python.org/mailman/listinfo/python-list

Re: Loop until condition is true

2005-06-18 Thread Donn Cave
Quoth Remi Villatel [EMAIL PROTECTED]: | What I'm trying to achieve is a conditionnal loop of which the condition | test would be done at the end so the loop is executed at least once. It's | some way the opposite of while. | | So far, all I got is: | | while True: | some(code) | if

OO approach to decision sequence?

2005-06-18 Thread Chinook
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 yourself saying if is_mugshot: #something

regarding popen function

2005-06-18 Thread praba kar
Dear All, 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() Actually here I didn't use any file handler and I didn't close file handler. regards Prabahar

Re: tree functions daily exercise: Table

2005-06-18 Thread Xah Lee
The Perl version of the Tree function is posted. It's a bit long. Please see the code here: http://xahlee.org/tree/Table.html the choice of having a string as the first argument to Table is a bit awkward in Perl. Possibly i'll have to rewrite it so that the first argument is a function instead,

Re: ElementTree Namespace Prefixes

2005-06-18 Thread uche . ogbuji
Chris Spencer: Fredrik Lundh wrote: Chris Spencer wrote: If an XML parser reads in and then writes out a document without having altered it, then the new document should be the same as the original. says who? Good question. There is no One True Answer even within the XML standards. It

Re: What is different with Python ?

2005-06-18 Thread Andrea Griffini
On 17 Jun 2005 21:10:37 -0700, Michele Simionato [EMAIL PROTECTED] wrote: Andrea Griffini wrote: Why hinder ? ... To be able to content himself with a shallow knowledge is a useful skill ;) Ah! ... I agree. Currently for example my knowledge of Zope is pretty close to 0.00%, but I'm using it

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

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 other words, I

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]

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

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 message before

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

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? def

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 connection

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:

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 yourself

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. -- Plutarch

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 which

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++ altogether

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:

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: 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 with (in

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? Personally I

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 that, at least

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

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

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 handlers so that

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;

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

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:

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 write

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 portion of the

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

Re: extreme newbie

2005-06-18 Thread cpunerd4
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? And also, from what I know, the Java virtual machine is more popular (and installed on more computers). Although it might take

MixIn method to call the method it overrides: how?

2005-06-18 Thread Mac
I have a MixIn class which defines a method foo(), and is then mixed in with another class by being prepended to that class's __bases__ member, thus overriding that class's definition of foo(). In my application though it is necessary for the MixIn's foo() to call the overridden foo(). How can I

Re: functions with unlimeted variable arguments...

2005-06-18 Thread Ivan Van Laningham
Hi All-- Paul Rubin wrote: 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 He's been around long enough to rewrite the manual. Metta,

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 complex

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

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

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 specific TLS

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 thought

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 hand is

Re: Loop until condition is true

2005-06-18 Thread Grant Edwards
On 2005-06-18, Peter Otten [EMAIL PROTECTED] wrote: IfyoulookatCcode,atleastinmyexperiencethe until loop is quite rarely used.(Idon'tseeitonceinthesource to Python 2.4, for example.) Long time no C? 'until' in C is actually do statement while (expression); I found 136

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 long

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

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

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. Or

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 to have to build an

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 FLATBUSH

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 prying

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,

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

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 by

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. They

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

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

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

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

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 installed.

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

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

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: 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__(self):

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 it

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 lot of

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

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 around

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

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 serious

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. This

Re: pysqlite - Checking the existance of a table

2005-06-18 Thread Peter Hansen
Gerhard Hring 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,

Re: Unbound names in __del__

2005-06-18 Thread Torsten Bronger
Hallchen! 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 programmer. Besides, I

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 static.

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

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 ... What

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 example I

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 when

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 called

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 noticed

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,

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 bytecode is

  1   2   >