Re: Regarding Python is scripting language or not

2009-06-17 Thread Aaron Brady
On Jun 17, 7:38 am, Jean-Michel Pichavant wrote: > abhishek goswami wrote: > > Hi, > > I have very basic question about Python that do we consider pyhton as > > script language. > > I searched in google but it becomes more confusion for me. After some > > analysis I came to know that Python suppor

Re: How can I enumerate (list) serial ports?

2009-06-17 Thread Tim Golden
Jason wrote: Hi, I'm developing an application to talk to a device over a serial port. I'm trying my hardest to keep it cross platform, so I was using pySerial for the serial communications. But I can't see a pythonic, cross-platform way to enumerate serial ports on a machine. As with many oth

Re: python tutorial

2009-06-17 Thread steve
"Steven D'Aprano" wrote in message news:pan.2009.06.18.01.42...@remove.this.cybersource.com.au... > On Thu, 18 Jun 2009 10:36:01 +1000, steve wrote: > >> 1) Windows does not make a distinction between text and binary files. > > Of course it does. > > > Python 2.6.2 (r262:71605, Apr 14 2009, 22:40

Re: python tutorial

2009-06-17 Thread steve
"Robert Kern" wrote in message news:mailman.1728.1245289092.8015.python-l...@python.org... > On 2009-06-17 19:36, steve wrote: >>> "Carl Banks" wrote in message >>> news:2f6271b1-5ffa-4cec-81f8->>0276ad647...@p5g2000pre.googlegroups.com... >>> On Jun 15, 7:56 pm, "steve" wrote: I was just

Re: waling a directory with very many files

2009-06-17 Thread Asun Friere
On Jun 15, 6:35 am, Andre Engels wrote: > What kind of directories are those that just a list of files would > result in a "very large" object? I don't think I have ever seen > directories with more than a few thousand files... (a...@lucrezia:~/pit/lsa/act:5)$ ls -1 | wc -l 142607 There, you'

Re: fastest native python database?

2009-06-17 Thread Pierre Bourdon
On Thu, Jun 18, 2009 at 05:28, per wrote: > hi all, Hi, > i'm looking for a native python package to run a very simple data > base. i was originally using cpickle with dictionaries for my problem, > but i was making dictionaries out of very large text files (around > 1000MB in size) and pickling w

Re: Regarding Python is scripting language or not

2009-06-17 Thread Asun Friere
On Jun 18, 5:03 am, Terry Reedy wrote: > That depends on what you mean by 'put into classes' (and 'everything'). > > If you mean 'be an instance of a class', which I think is the most > natural reading, then Python *is* object-oriented and, if I understand > what I have read correctly (so that in

Re: walking a directory with very many files

2009-06-17 Thread Ethan Furman
Lawrence D'Oliveiro wrote: In message <20090617214535.10866...@coercion>, Mike Kazantsev wrote: On Wed, 17 Jun 2009 23:04:37 +1200 Lawrence D'Oliveiro wrote: In message <20090617142431.2b25f...@malediction>, Mike Kazantsev wrote: On Wed, 17 Jun 2009 17:53:33 +1200 Lawrence D'Oliveiro w

Re: Reading and setting file permissions programmatically

2009-06-17 Thread Kushal Kumaran
On Thu, Jun 18, 2009 at 2:05 AM, Cameron Pulsford wrote: > Sorry to flood the list but my google fu isn't up to par today I guess. > Basically, is it possible to read the permissions on one file and then set > the permissions of another file to the ones we just read? os.dup2 seemed > like it would

Re: fastest native python database?

2009-06-17 Thread William Clifford
On Jun 17, 8:28 pm, per wrote: > hi all, > > i'm looking for a native python package to run a very simple data > base. i was originally using cpickle with dictionaries for my problem, > but i was making dictionaries out of very large text files (around > 1000MB in size) and pickling was simply too

Re: What text editor is everyone using for Python

2009-06-17 Thread JussiJ
On May 26, 3:35 am, LittleGrasshopper wrote: > With so many choices, I was wondering what editor is the one you > prefer when coding Python, The Zeus for Windows IDE is Python aware: http://www.zeusedit.com/python.html > and why. It does syntax highlighting, smart indenting, code folding e

Re: fastest native python database?

2009-06-17 Thread per
i would like to add to my previous post that if an option like SQLite with a python interface (pysqlite) would be orders of magnitude faster than naive python options, i'd prefer that. but if that's not the case, a pure python solution without dependencies on other things would be the best option.

Re: fastest native python database?

2009-06-17 Thread Emile van Sebille
On 6/17/2009 8:28 PM per said... hi all, i'm looking for a native python package to run a very simple data base. i was originally using cpickle with dictionaries for my problem, but i was making dictionaries out of very large text files (around 1000MB in size) and pickling was simply too slow.

Re: Exceptions and Object Destruction (was: Problem with apsw and garbage collection)

2009-06-17 Thread Steven D'Aprano
On Wed, 17 Jun 2009 22:58:27 -0400, Charles Yeomans wrote: > On Jun 17, 2009, at 9:43 PM, Steven D'Aprano wrote: > >> On Wed, 17 Jun 2009 07:49:52 -0400, Charles Yeomans wrote: >> Even CPython doesn't rely completely on reference counting (it has a fallback gc for cyclic garbage). Pyth

Re: What text editor is everyone using for Python

2009-06-17 Thread JussiJ
On May 31, 12:42 am, edexter wrote: On the Windows platform the Zeus editor has Python language support: http://www.zeusedit.com > I will sometimes use word pad but i perfer syntax > highlighting.. The syntax highlighter is fully configurable. > I would be after is to be able to define my

Re: GUI(eclipse+pydev/SPE) freeze when doing python auto-completion under Linux

2009-06-17 Thread Wei, Xiaohai
yes, the same problem even on an empty program. every file has the same problem. for example, if I new a file and input the following: import os os. after I input '.', it will pop up the window, and i can select the function of os module or continue input. but after that, no action can be taken fo

fastest native python database?

2009-06-17 Thread per
hi all, i'm looking for a native python package to run a very simple data base. i was originally using cpickle with dictionaries for my problem, but i was making dictionaries out of very large text files (around 1000MB in size) and pickling was simply too slow. i am not looking for fancy SQL oper

Re: Exceptions and Object Destruction (was: Problem with apsw and garbage collection)

2009-06-17 Thread Charles Yeomans
On Jun 17, 2009, at 9:43 PM, Steven D'Aprano wrote: On Wed, 17 Jun 2009 07:49:52 -0400, Charles Yeomans wrote: Even CPython doesn't rely completely on reference counting (it has a fallback gc for cyclic garbage). Python introduced the "with" statement to get away from the kludgy CPython prog

Re: GUI(eclipse+pydev/SPE) freeze when doing python auto-completion under Linux

2009-06-17 Thread Tyler Laing
Do you experience the same problem even on an empty program file or is it limited to just one file? -Tyler On Wed, Jun 17, 2009 at 7:47 PM, Wei, James wrote: > On Jun 18, 10:45 am, "Wei, James" wrote: > > When I am editing python program with SPE, I found that SPE will > > freeze when it is do

Re: GUI(eclipse+pydev/SPE) freeze when doing python auto-completion under Linux

2009-06-17 Thread Wei, James
On Jun 18, 10:45 am, "Wei, James" wrote: > When I am editing python program with SPE, I found that SPE will > freeze when it is doing auto-completion. The behavior is very strange > that I can not edit the file again. If I switch to another file and > then switch back, I can edit it again. > > So

GUI(eclipse+pydev/SPE) freeze when doing python auto-completion under Linux

2009-06-17 Thread Wei, James
When I am editing python program with SPE, I found that SPE will freeze when it is doing auto-completion. The behavior is very strange that I can not edit the file again. If I switch to another file and then switch back, I can edit it again. So I switch to eclipse+pydev, but I found the same thing

How can I enumerate (list) serial ports?

2009-06-17 Thread Jason
Hi, I'm developing an application to talk to a device over a serial port. I'm trying my hardest to keep it cross platform, so I was using pySerial for the serial communications. But I can't see a pythonic, cross-platform way to enumerate serial ports on a machine. Ideally I could show the user a

Re: walking a directory with very many files

2009-06-17 Thread Mike Kazantsev
On Thu, 18 Jun 2009 10:33:49 +1200 Lawrence D'Oliveiro wrote: > In message <20090617214535.10866...@coercion>, Mike Kazantsev wrote: > > > On Wed, 17 Jun 2009 23:04:37 +1200 > > Lawrence D'Oliveiro wrote: > > > >> In message <20090617142431.2b25f...@malediction>, Mike Kazantsev wrote: > >> >

Re: Exceptions and Object Destruction (was: Problem with apsw and garbage collection)

2009-06-17 Thread Steven D'Aprano
On Wed, 17 Jun 2009 23:29:48 +1200, Lawrence D'Oliveiro wrote: > In message <7x7hzbv14a@ruckus.brouhaha.com>, wrote: > >> Lawrence D'Oliveiro writes: >> >>> > Reference counting is an implementation detail used by CPython but >>> > not [implementations built on runtimes designed for >>> > c

Re: Exceptions and Object Destruction (was: Problem with apsw and garbage collection)

2009-06-17 Thread Steven D'Aprano
On Wed, 17 Jun 2009 07:49:52 -0400, Charles Yeomans wrote: >> Even CPython doesn't rely completely on reference counting (it has a >> fallback gc for cyclic garbage). Python introduced the "with" >> statement to get away from the kludgy CPython programmer practice of >> opening files and relying

Re: python tutorial

2009-06-17 Thread Steven D'Aprano
On Thu, 18 Jun 2009 10:36:01 +1000, steve wrote: > 1) Windows does not make a distinction between text and binary files. Of course it does. Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more informatio

Re: python tutorial

2009-06-17 Thread Robert Kern
On 2009-06-17 19:36, steve wrote: "Carl Banks" wrote in message news:2f6271b1-5ffa-4cec-81f8->>0276ad647...@p5g2000pre.googlegroups.com... On Jun 15, 7:56 pm, "steve" wrote: I was just looking at the python tutorial, and I noticed these lines: http://docs.python.org/tutorial/inputoutput.html#

Re: Exotic Logics

2009-06-17 Thread Steven D'Aprano
On Wed, 17 Jun 2009 16:37:04 +, Lie Ryan wrote: >> Imagine for a moment that there are no boolean values. There are no >> numbers. They were never invented. There are no classes. >> There are no objects. >> There are only functions. >> >> Could you define functions that act like boolean valu

Re: python tutorial

2009-06-17 Thread steve
"Steven D'Aprano" wrote in message news:pan.2009.06.16.04.29...@remove.this.cybersource.com.au... > On Mon, 15 Jun 2009 20:58:47 -0700, Carl Banks wrote: > >> On Jun 15, 7:56 pm, "steve" wrote: >>> I was just looking at the python tutorial, and I noticed these lines: >>> >>> http://docs.python.

Re: python tutorial

2009-06-17 Thread steve
>"Carl Banks" wrote in message >news:2f6271b1-5ffa-4cec-81f8->>0276ad647...@p5g2000pre.googlegroups.com... >On Jun 15, 7:56 pm, "steve" wrote: >> I was just looking at the python tutorial, and I noticed these lines: >> >> http://docs.python.org/tutorial/inputoutput.html#reading-and-writing-...

Re: Create 3D Surface / Contour (with vpython?)

2009-06-17 Thread norseman
Philip Gröger wrote: Hi! How can I create a 3D surface (or something like the picture on the FAQ page http://www.vpython.org/contents/FAQ.html ) with python [or vpython]. Didnt find anything in the Documentation under "graph" Basically like a contourf diagram in 3D (http://www.techsoft.de/germ

Re: generator expression works in shell, NameError in script

2009-06-17 Thread Steven Samuel Cole
Both zip and enumerate do the trick. Thanks for the pointers, that's 2 more built-ins under my belt :-) Still don't really understand why my initial code didn't work, though... Thanks everyone! :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError: int argument required

2009-06-17 Thread Rhodri James
On Wed, 17 Jun 2009 12:07:15 +0100, Lawrence D'Oliveiro wrote: [snip example code] You haven't managed to get rid of the backslashes. [snip other example code] Now you've lost track of the original point of the discussion, which is about using alternate quotes to avoid backslashes. Ah,

Re: generator expression works in shell, NameError in script

2009-06-17 Thread Emile van Sebille
On 6/17/2009 3:54 PM ssc said... Wow! Didn't expect that kind of instant support. Thank you very much, I'll give both zip and enumerate a try. The code I've shown is actually copied pretty straight from a Django form class, but I didn't want to mention that as not to dilute the conversation. Don

Re: generator expression works in shell, NameError in script

2009-06-17 Thread Chris Rebert
On Wed, Jun 17, 2009 at 3:54 PM, ssc wrote: > Wow! Didn't expect that kind of instant support. Thank you very much, > I'll give both zip and enumerate a try. > > The code I've shown is actually copied pretty straight from a Django > form class, but I didn't want to mention that as not to dilute the

Re: generator expression works in shell, NameError in script

2009-06-17 Thread ssc
Wow! Didn't expect that kind of instant support. Thank you very much, I'll give both zip and enumerate a try. The code I've shown is actually copied pretty straight from a Django form class, but I didn't want to mention that as not to dilute the conversation. Don't think it matters, anyway. This i

Re: first full alpha release of PyLab_Works v0.3

2009-06-17 Thread Stef Mientki
program didn't start because .dll is missing (sorry I don't have the name)... I don't know if that is just an issue with the installer with vista or not (missing msv something 71. dll) You probably mean the microsoft visual C++ runtime (msvcr71.dll), windows vista has a brand new way (v

Re: Pythonic way to overwrite a file

2009-06-17 Thread Rhodri James
Top-posting, tsk, tsk. On Wed, 17 Jun 2009 19:26:07 +0100, Cameron Pulsford wrote: Essentially it just cleans up a source file of erroneous spaces and tabs and can also convert tabs to spaces so loading the whole file into memory is possibly an option. I am making this utility for persona

Re: persistent composites

2009-06-17 Thread Rhodri James
On Wed, 17 Jun 2009 16:06:22 +0100, Aaron Brady wrote: On Jun 16, 10:09 am, Mike Kazantsev wrote: On Tue, 16 Jun 2009 06:57:13 -0700 (PDT) Aaron Brady wrote: > Making the charitable interpretation that this was the extent of c-l- > py's support and enthusiasm for my idea, I will now go in

Re: generator expression works in shell, NameError in script

2009-06-17 Thread Jon Clements
On Jun 17, 11:19 pm, ssc wrote: > Hello, > > I am trying to generate this list of tuples: > [(0, ''), (1, 'Dr'), (2, 'Miss'), (3, 'Mr'), (4, 'Mrs'), (5, 'Ms')] > > My code works fine in the Python shell: > > >>> titles = ['Dr', 'Miss', 'Mr', 'Mrs', 'Ms',] > >>> title_choices = [(0, '')] + list((ti

Re: generator expression works in shell, NameError in script

2009-06-17 Thread Emile van Sebille
On 6/17/2009 3:41 PM Jason Tackaberry said... How about: enumerate([''] + titles) or perhaps, depending on usage... list(enumerate(titles)) Emile -- http://mail.python.org/mailman/listinfo/python-list

Re: generator expression works in shell, NameError in script

2009-06-17 Thread Jason Tackaberry
On Wed, 2009-06-17 at 15:38 -0700, Chris Rebert wrote: > See what Emile said, but here's a nicer way to code it, IMHO: > > titles = ['Dr', 'Miss', 'Mr', 'Mrs', 'Ms'] > title_choices = zip(range(len(titles)+1), ['']+titles) > > zip() to the rescue! How about: enumerate([''] + titles) -- htt

Re: generator expression works in shell, NameError in script

2009-06-17 Thread Chris Rebert
On Wed, Jun 17, 2009 at 3:19 PM, ssc wrote: > Hello, > > I am trying to generate this list of tuples: > [(0, ''), (1, 'Dr'), (2, 'Miss'), (3, 'Mr'), (4, 'Mrs'), (5, 'Ms')] > > My code works fine in the Python shell: > titles = ['Dr', 'Miss', 'Mr', 'Mrs', 'Ms',] title_choices = [(0, '')] +

Re: walking a directory with very many files

2009-06-17 Thread Lawrence D'Oliveiro
In message <20090617214535.10866...@coercion>, Mike Kazantsev wrote: > On Wed, 17 Jun 2009 23:04:37 +1200 > Lawrence D'Oliveiro wrote: > >> In message <20090617142431.2b25f...@malediction>, Mike Kazantsev wrote: >> >>> On Wed, 17 Jun 2009 17:53:33 +1200 >>> Lawrence D'Oliveiro wrote: >>>

Re: generator expression works in shell, NameError in script

2009-06-17 Thread Emile van Sebille
On 6/17/2009 3:19 PM ssc said... Hello, I am trying to generate this list of tuples: [(0, ''), (1, 'Dr'), (2, 'Miss'), (3, 'Mr'), (4, 'Mrs'), (5, 'Ms')] My code works fine in the Python shell: titles = ['Dr', 'Miss', 'Mr', 'Mrs', 'Ms',] title_choices = [(0, '')] + list((titles.index(t)+1, t)

generator expression works in shell, NameError in script

2009-06-17 Thread ssc
Hello, I am trying to generate this list of tuples: [(0, ''), (1, 'Dr'), (2, 'Miss'), (3, 'Mr'), (4, 'Mrs'), (5, 'Ms')] My code works fine in the Python shell: >>> titles = ['Dr', 'Miss', 'Mr', 'Mrs', 'Ms',] >>> title_choices = [(0, '')] + list((titles.index(t)+1, t) for t in titles) >>> title_c

Re: Perl's @foo[3,7,1,-1] ?

2009-06-17 Thread Alan G Isaac
On 6/17/2009 4:03 PM J. Cliff Dyer apparently wrote: > example code > should always include relevant imports. Agreed. It was a cut and paste failure. Apologies. Alan Isaac -- http://mail.python.org/mailman/listinfo/python-list

Re: Exotic Logics

2009-06-17 Thread Luis Alberto Zarrabeitia Gomez
Quoting Lie Ryan : > pdpi wrote: > > On Jun 17, 5:37 pm, Lie Ryan wrote: > >> Steven D'Aprano wrote: > >>> On Tue, 16 Jun 2009 22:46:14 -0700, William Clifford wrote: > I was staring at a logic table the other day, and I asked myself, "what > if one wanted to play with exotic logics; h

Re: exit() or sys.exit()

2009-06-17 Thread Sebastian Wiesner
> What is the difference on exit() and sys.exit() when called in the > main body of a script? From the command line they seem to have the > same effect. As of Python 2.5 there is no difference, however documentation [1] says about exit() and quit(): > They are useful for the interactive interp

Re: Exotic Logics

2009-06-17 Thread Lie Ryan
pdpi wrote: > On Jun 17, 5:37 pm, Lie Ryan wrote: >> Steven D'Aprano wrote: >>> On Tue, 16 Jun 2009 22:46:14 -0700, William Clifford wrote: I was staring at a logic table the other day, and I asked myself, "what if one wanted to play with exotic logics; how might one do it?" >>> This mig

RE: Good books in computer science?

2009-06-17 Thread Phil Runciman
Because it reminds me of when things went badly wrong. IBM360, Von Neumann architecture, no hardware stacks ... IMHO Burroughs and ICL had better approaches to OS design back then but had less resources to develop their ideas. However, mainly this period marked a transition from the excitement

Re: Reading and setting file permissions programmatically

2009-06-17 Thread MRAB
Cameron Pulsford wrote: Sorry to flood the list but my google fu isn't up to par today I guess. Basically, is it possible to read the permissions on one file and then set the permissions of another file to the ones we just read? os.dup2 seemed like it would work but I might not be using it cor

Re: etree, lxml unexpected behaviour

2009-06-17 Thread Stefan Behnel
Emanuele D'Arrigo wrote: > Hi everybody, I just tried the following: > import xml.etree.ElementTree as etree e = etree.fromstring('>>> xmlns:ans="anotherNamespace" ans:anotherAttr="2"/>') e.getchildren()[0].attrib > {'anAttr': '1', '{anotherNamespace}anotherAttr': '2'} > > Noti

Re: Regarding Python is scripting language or not

2009-06-17 Thread Lie Ryan
Jean-Michel Pichavant wrote: > abhishek goswami wrote: >> Hi, >> I have very basic question about Python that do we consider pyhton as >> script language. >> I searched in google but it becomes more confusion for me. After some >> analysis I came to know that Python support oops . >> >> Can anyone

Reading and setting file permissions programmatically

2009-06-17 Thread Cameron Pulsford
Sorry to flood the list but my google fu isn't up to par today I guess. Basically, is it possible to read the permissions on one file and then set the permissions of another file to the ones we just read? os.dup2 seemed like it would work but I might not be using it correctly. I know there is os.c

etree, lxml unexpected behaviour

2009-06-17 Thread Emanuele D'Arrigo
Hi everybody, I just tried the following: >>> import xml.etree.ElementTree as etree >>> e = etree.fromstring('>> xmlns:ans="anotherNamespace">>> ans:anotherAttr="2"/>') >>> e.getchildren()[0].attrib {'anAttr': '1', '{anotherNamespace}anotherAttr': '2'} Notice the lack of namespace before the attr

Re: SHM and Touchpad

2009-06-17 Thread Sparky
On Jun 17, 2:09 pm, Philip Semanchuk wrote: > On Jun 17, 2009, at 3:56 PM, Sparky wrote: > > > Hello! I am writing an application that requires access to the state > > of a synaptics touch pad on a laptop running Ubuntu Linux (for the > > number of fingers, pressure, x location, y location, etc).

logging.fileConfig limitations?

2009-06-17 Thread Mani Ghasemlou
Hi all, I have an application that writes out its logs in a subfolder of the user's local data directory. Let's say our user's name is "ßéäöÜ2". On my Windows XP machine, this logging path turns out to be: C:\Documents and Settings\ßéäöÜ2\Local Settings\Application Data\MyApp\MyApp.log My appli

Re: first full alpha release of PyLab_Works v0.3

2009-06-17 Thread Martin P. Hellwig
edexter wrote: it says I am missing msvcp71.dll installing Microsoft Visual C++ 2005 Redistributable Package did not help.. I had simular problems with alot of installers I had saved (from installing on xp) but when I grabbed newer installers they all worked, could be the manifast I was

Re: SHM and Touchpad

2009-06-17 Thread Philip Semanchuk
On Jun 17, 2009, at 3:56 PM, Sparky wrote: Hello! I am writing an application that requires access to the state of a synaptics touch pad on a laptop running Ubuntu Linux (for the number of fingers, pressure, x location, y location, etc). A different program using C++ accesses the information th

Re: Perl's @foo[3,7,1,-1] ?

2009-06-17 Thread J. Cliff Dyer
On Wed, 2009-06-17 at 14:13 +0200, Jean-Michel Pichavant wrote: > On Wed, Jun 17, 2009 at 04:14, Steven D'Aprano wrote: > >> What's np.arange? > >> > > > > import numpy as np > > > > -- > > Pierre "delroth" Bourdon > > Étudiant à l'EPITA / Student at EPITA > > > > Perfect example of why r

SHM and Touchpad

2009-06-17 Thread Sparky
Hello! I am writing an application that requires access to the state of a synaptics touch pad on a laptop running Ubuntu Linux (for the number of fingers, pressure, x location, y location, etc). A different program using C++ accesses the information through SHM and I was hoping to do the same with

Re: Create 3D Surface / Contour (with vpython?)

2009-06-17 Thread Gökhan SEVER
On Wed, Jun 17, 2009 at 12:58 PM, Philip Gröger < philip.groe...@googlemail.com> wrote: > Hi! > How can I create a 3D surface (or something like the picture on the FAQ > page http://www.vpython.org/contents/FAQ.html ) with python [or vpython]. > Didnt find anything in the Documentation under "grap

Re: Regarding Python is scripting language or not

2009-06-17 Thread Christian Heimes
Terry Reedy wrote: > If you mean 'be an instance of a class', which I think is the most > natural reading, then Python *is* object-oriented and, if I understand > what I have read correctly (so that ints are just (unboxed) ints and not > members of an int class), Java *is not*! A friend of mine ca

Re: Exotic Logics

2009-06-17 Thread Terry Reedy
William Clifford wrote: same (or different) results. I've read one can do all of the 16 binary operations with clever uses of NAND or NOR. The book Laws of Form, by Spencer-Brown' is based on that observation, with nand/nor expanded to n-ary 'bag' functions (like sum() is). I recommend it, e

Re: A simpler logging configuration file format?

2009-06-17 Thread Vinay Sajip
On Jun 5, 9:07 pm, geoff.ba...@gmail.com wrote: > Hi all, Some discussion about this has already taken place on the issue tracker: http://bugs.python.org/issue6136 and I thought I would summarise my comments there on this thread, for people who have no need to look at that issue. > At the momen

Re: strptime issue in multi-threaded application

2009-06-17 Thread Joe Holloway
Christian wrote: > > Joe Holloway schrieb: > > ImportError: Failed to import _strptime because the import lockis > > [sic] held by another thread. > > The error message is my fault. The cause of the mistake is obvious: No worries. The error message is clear even with the minor typo, I just wanted

Re: Exotic Logics

2009-06-17 Thread William Clifford
On Jun 17, 1:28 am, Steven D'Aprano wrote: > On Tue, 16 Jun 2009 22:46:14 -0700, William Clifford wrote: > > I was staring at a logic table the other day, and I asked myself, "what > > if one wanted to play with exotic logics; how might one do it?" > > First question: what's an exotic logics? > >

Re: Regarding Python is scripting language or not

2009-06-17 Thread Terry Reedy
Jochen Schulz wrote: abhishek goswami: Can anyone Guide me that Python is Oject oriented programming language or Script language In my opinion, Python is both. But an "objective" answer would require you to define what you means by these terms. If, by "object-oriented" you mean "everything ha

Re: Regarding Python is scripting language or not

2009-06-17 Thread Ken Seehart
abhishek goswami wrote: Hi, I have very basic question about Python that do we consider pyhton as script language. I searched in google but it becomes more confusion for me. After some analysis I came to know that Python support oops . Can anyone Guide me that Python is Oject oriented program

Re: Observer implementations

2009-06-17 Thread Mike C. Fletcher
Tobias Weber wrote: > In article , > "Mike C. Fletcher" wrote: > > >> See PyDispatcher for code to do this. >> > > That was the original problem. Got it now: if used inside the class > definition dispatcher.connect will raise "cannot create weak reference > to 'classmethod' object". Out

Re: Pythonic way to overwrite a file

2009-06-17 Thread Cameron Pulsford
Essentially it just cleans up a source file of erroneous spaces and tabs and can also convert tabs to spaces so loading the whole file into memory is possibly an option. I am making this utility for personal use, and that would definitely be fine, but if it turned out well I'd open source it and th

Re: Pythonic way to overwrite a file

2009-06-17 Thread Jean-Michel Pichavant
Cameron Pulsford wrote: Hey all, hopefully a simple question. I'm writing a simple python tool that opens a file, and does something like for line in file.readlines(): temp.write(line.doStuff()) However, I want to provide the option do this "in place", as in have the destination file be

Re: Pythonic way to overwrite a file

2009-06-17 Thread Ben Charrow
Cameron Pulsford wrote: > Hey all, hopefully a simple question. > > I'm writing a simple python tool that opens a file, and does something like > > for line in file.readlines(): > temp.write(line.doStuff()) > > However, I want to provide the option do this "in place", as in have the > desti

Create 3D Surface / Contour (with vpython?)

2009-06-17 Thread Philip Gröger
Hi! How can I create a 3D surface (or something like the picture on the FAQ page http://www.vpython.org/contents/FAQ.html ) with python [or vpython]. Didnt find anything in the Documentation under "graph" Basically like a contourf diagram in 3D ( http://www.techsoft.de/german/documents/images/3D_co

Pythonic way to overwrite a file

2009-06-17 Thread Cameron Pulsford
Hey all, hopefully a simple question. I'm writing a simple python tool that opens a file, and does something like for line in file.readlines(): temp.write(line.doStuff()) However, I want to provide the option do this "in place", as in have the destination file be the same as the source file.

Re: Exotic Logics

2009-06-17 Thread Aaron Brady
On Jun 17, 10:23 am, Mensanator wrote: > On Jun 17, 11:59 am, Aaron Brady wrote: > > > > > On Jun 17, 1:44 am, Steven D'Aprano > > > wrote: > > > On Tue, 16 Jun 2009 22:46:14 -0700, William Clifford wrote: > > > > I was staring at a logic table the other day, and I asked myself, "what > > > > if

Re: Exotic Logics

2009-06-17 Thread Aaron Brady
On Jun 17, 10:05 am, pdpi wrote: > On Jun 17, 5:37 pm, Lie Ryan wrote: > > > > > Steven D'Aprano wrote: > > > On Tue, 16 Jun 2009 22:46:14 -0700, William Clifford wrote: > > > >> I was staring at a logic table the other day, and I asked myself, "what > > >> if one wanted to play with exotic logic

Re: Exotic Logics

2009-06-17 Thread Mensanator
On Jun 17, 11:59 am, Aaron Brady wrote: > On Jun 17, 1:44 am, Steven D'Aprano > > > > wrote: > > On Tue, 16 Jun 2009 22:46:14 -0700, William Clifford wrote: > > > I was staring at a logic table the other day, and I asked myself, "what > > > if one wanted to play with exotic logics; how might one

Re: Exotic Logics

2009-06-17 Thread Aaron Brady
On Jun 17, 10:04 am, Aaron Brady wrote: snip > You (OP) may be interested in the definitions of the fuzzy operators: > > and( x, y ) := min( x, y ) > or( x, y ) := max( x, y ) > not( x ) := 1 (one)- x > nand( x, y ) := not( and( x, y ) ) = 1- min( x, y ) > > Defining 'xor' as '( x or y ) and ( not

Re: exit() or sys.exit()

2009-06-17 Thread Brendan
On Jun 17, 1:33 pm, Tim Chase wrote: > Brendan wrote: > > What is the difference on exit() and sys.exit() when called in the > > main body of a script? From the command line they seem to have the > > same effect. > > In Python <=2.4 you had to use sys.exit() because > __builtins__.exit() griped: >

Re: Exotic Logics

2009-06-17 Thread pdpi
On Jun 17, 5:37 pm, Lie Ryan wrote: > Steven D'Aprano wrote: > > On Tue, 16 Jun 2009 22:46:14 -0700, William Clifford wrote: > > >> I was staring at a logic table the other day, and I asked myself, "what > >> if one wanted to play with exotic logics; how might one do it?" > > > This might be usefu

Re: Exotic Logics

2009-06-17 Thread Aaron Brady
On Jun 17, 1:28 am, Steven D'Aprano wrote: > On Tue, 16 Jun 2009 22:46:14 -0700, William Clifford wrote: > > I was staring at a logic table the other day, and I asked myself, "what > > if one wanted to play with exotic logics; how might one do it?" > > First question: what's an exotic logics? > >

Re: ODE, GUI, plotter in Python

2009-06-17 Thread Rob Clewley
There was just an announcement on this list and the scipy list for PyLab_Works, which sounds exactly like what you're looking for. I would not recommend starting over with a new simulator at this point. -Rob On Tue, Jun 16, 2009 at 12:00 PM, Ala wrote: > Hello everyone. > > I am starting on implem

Re: Exotic Logics

2009-06-17 Thread Aaron Brady
On Jun 17, 1:44 am, Steven D'Aprano wrote: > On Tue, 16 Jun 2009 22:46:14 -0700, William Clifford wrote: > > I was staring at a logic table the other day, and I asked myself, "what > > if one wanted to play with exotic logics; how might one do it?" > > This might be useful for you, and if not usef

Re: Exotic Logics

2009-06-17 Thread Lie Ryan
Steven D'Aprano wrote: > On Tue, 16 Jun 2009 22:46:14 -0700, William Clifford wrote: > >> I was staring at a logic table the other day, and I asked myself, "what >> if one wanted to play with exotic logics; how might one do it?" > > > This might be useful for you, and if not useful, at least it

Re: Executing a python script while it is running

2009-06-17 Thread Aaron Brady
On Jun 16, 3:48 pm, Zach Hobesh wrote: > > A lot more information would be useful.  What version of Python, and what > > operating system environment?  Exactly what would you like to happen when > > the batch file is invoked a second time? > > I'm running Python 2.6.2 on Windows.  I'm passing file

Re: exit() or sys.exit()

2009-06-17 Thread Tim Chase
Brendan wrote: What is the difference on exit() and sys.exit() when called in the main body of a script? From the command line they seem to have the same effect. In Python <=2.4 you had to use sys.exit() because __builtins__.exit() griped: tch...@asgix:~$ python2.4 Python 2.4.4 (#2, Apr

exit() or sys.exit()

2009-06-17 Thread Brendan
What is the difference on exit() and sys.exit() when called in the main body of a script? From the command line they seem to have the same effect. Aside: Just used a python dictionary in which the keys were compiled regular expressions. Provided a very elegant solution. Have to love it. -- http:/

Re: Executing a python script while it is running

2009-06-17 Thread bobicanprogram
On Jun 17, 1:42 am, Zach Hobesh wrote: > On Tue, Jun 16, 2009 at 6:37 PM, Chris Rebert wrote: > > On Tue, Jun 16, 2009 at 6:21 PM, wrote: > >> Hey Dave, > > >> Thanks for the helpful responses. > > >>> Option 2 is what you get by default. Naturally it depends on what the > >>> application is us

Re: UDP queue size

2009-06-17 Thread Martin P. Hellwig
Scott David Daniels wrote: > 找尋自己的一片天 wrote: >> I got a problem about UDP. >> >> How do I get the UDP buffer size? >> >> When the server had some delay in handling incoming UDP, it will lost >> some package. I wonder it's because the system buffer size, is there any >> ways to find

Re: Measuring Fractal Dimension ?

2009-06-17 Thread pdpi
On Jun 17, 4:18 pm, Mark Dickinson wrote: > On Jun 17, 3:46 pm, Paul Rubin wrote: > > > Mark Dickinson writes: > > > It looks as though you're treating (a portion of?) the Koch curve as > > > the graph of a function f from R -> R and claiming that f is > > > uniform

Re: walking a directory with very many files

2009-06-17 Thread Mike Kazantsev
On Wed, 17 Jun 2009 23:04:37 +1200 Lawrence D'Oliveiro wrote: > In message <20090617142431.2b25f...@malediction>, Mike Kazantsev wrote: > > > On Wed, 17 Jun 2009 17:53:33 +1200 > > Lawrence D'Oliveiro wrote: > > > >> > Why not use hex representation of md5/sha1-hashed id as a path, > >> > arra

Re: UDP queue size

2009-06-17 Thread Nick Craig-Wood
§ä´m¦Û¤vª�...@¤ù¤Ñ wrote: > I got a problem about UDP. > > How do I get the UDP buffer size? > > When the server had some delay in handling incoming UDP, it will lost > some package. I wonder it's because the system buffer size, is there any > ways to find the exactly size of t

Re: Measuring Fractal Dimension ?

2009-06-17 Thread Mark Dickinson
On Jun 17, 3:46 pm, Paul Rubin wrote: > Mark Dickinson writes: > > It looks as though you're treating (a portion of?) the Koch curve as > > the graph of a function f from R -> R and claiming that f is > > uniformly continuous.  But the Koch curve isn't such a graph (

Re: Question about None

2009-06-17 Thread Aaron Brady
On Jun 17, 5:47 am, Bruno Desthuilliers wrote: > John Yeung a écrit : > > But mathematically speaking, it's intuitive that "nothing" would match > > any type. > > IOW, what's the OP is after is not the None type, but some yet > unexisting "Anything" type !-) The behaviors of the 'anything' object

Re: persistent composites

2009-06-17 Thread Aaron Brady
On Jun 16, 10:09 am, Mike Kazantsev wrote: > On Tue, 16 Jun 2009 06:57:13 -0700 (PDT) > > Aaron Brady wrote: > > Making the charitable interpretation that this was the extent of c-l- > > py's support and enthusiasm for my idea, I will now go into mourning. > > Death occurred at oh-eight-hundred.

Re: ANN: pyTenjin 0.8.0 - much faster template engine than Django

2009-06-17 Thread Igor Katson
kwatch wrote: I have released pyTenjin 0.8.0 Thanks for your project. I have used it a little, and there is a question to you. import tenjin from tenjin.helpers import * shared_cache = tenjin.GaeMemcacheCacheStorage() engine = tenjin.Engine(cache=shared_cache) 1. Why should I import tenjin

Re: Tool for browsing python code

2009-06-17 Thread Kurt Smith
On Tue, Jun 16, 2009 at 7:48 AM, Lucas P Melo wrote: > Is there any tool for browsing python code? (I'm having a hard time trying > to figure this out) > Anything like cscope with vim would be great. Check out pycscope: http://pypi.python.org/pypi/pycscope/0.3 I use it myself, and it works fine.

Re: Tool for browsing python code

2009-06-17 Thread Paul Boddie
On 16 Jun, 14:48, Lucas P Melo wrote: > Is there any tool for browsing python code? (I'm having a hard time > trying to figure this out) > Anything like cscope with vim would be great. Are you limiting your inquiry to text editors or IDEs, or are Web- based solutions also interesting? Often, conv

  1   2   >