Re: Python MIDI in 2008

2008-05-07 Thread Asun Friere
On May 6, 7:43 pm, Max M <[EMAIL PROTECTED]> wrote: > This is old in the sense that it has been a while since I wrote it. But > it is virtually bug free, so nothing much is happening. > > The midi standard does not change so there is no real reason to > change/upgrade it. Maybe you should add a m

Re: using sqlite3 - execute vs. executemany; committing ...

2008-05-07 Thread David
Hi Vlasta. > > tags_lookups[tag][item_dict[tag]] = tags_lookups[tag].get(item_dict[tag], > set()) | set([idx]) > > I thought, whether I am not overestimating myself with respect to the future > maintaining of the code ... :-) Here's a suggestion for readability and maintainability: Make a search

strftime() argument 1 must be str, not unicode

2008-05-07 Thread Alexandr N Zamaraev
Subj is bag? Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from datetime import datetime >>> datetime.today().strftime('%Y_%m_%d %H_%M_%S.csv') '2008_05_07 12_30_22.csv' >>> dateti

Re: How do you debug memory usage?

2008-05-07 Thread David
> Rsync uses a lot of memory: >http://www.samba.org/rsync/FAQ.html#4 > rdiff-backup uses librsync, not rsync. > I'm not sure if rsync uses librsync, but one could speculate that > they share some code and perhaps some of the same problems. > But 2GB seems excessive unless you are dealing w

Re: License selection for free software

2008-05-07 Thread Carl Banks
On May 7, 2:39 am, Paul Rubin wrote: > [EMAIL PROTECTED] (Ville M. Vainio) writes: > > > In practice, the probability of hijacking of source code by an evil > > corporation is very low for most projects. And even when it did > > happen, the evil corporation would likely s

Re: using sqlite3 - execute vs. executemany; committing ...

2008-05-07 Thread David
> > Google for "overlapping markup" and "python overlapping markup" for > more information. Here's one interesting page I found: > I found an interesting markup called LMNL, which supports overlapping markup: http://lmnl.net/ Also, a survey which compares various markup languages, including LM

PEP 370 question

2008-05-07 Thread Paul Melis
In (the recently accepted) PEP 370 it says "Current Python versions don't have a unified way to install packages into the home directory of a user (except for Mac Framework builds). Users are either forced to ask the system administrator to install or update a package for them or to use one of

Re: ]ANN[ Vellum 0.16: Lots Of Documentation and Watching

2008-05-07 Thread Ville Vainio
On May 6, 11:27 pm, hdante <[EMAIL PROTECTED]> wrote: > GPL can mix with other free software licenses, so people who write > BSD code and do not wish to remain BSD clean are free to use GPL'd > code. That's the important point. No, it can't. It can only mix through aggregation, i.e. you can ship

Re: License selection for free software

2008-05-07 Thread Paul Rubin
Carl Banks <[EMAIL PROTECTED]> writes: > Nonsense. They could be more than willing to contribute their > patches, but aren't willing to accept the GPL's limitation to being > used only in open source packages. Oh, I see what you mean--I'm considering any derived work to be a patch, which is maybe

Re: Scanning through Windows registry...

2008-05-07 Thread Tim Golden
Unknown Hero wrote: Tim Golden wrote: [... snip long example ...] Correct me if I'm wrong (which I just might be), but doesn't the above code go through the keys behind HKEY_LOCAL_MACHINE\Software\Timsoft\ ? Is it possible to use an empty value in: hTimSoft = _winreg.OpenKey (HKLM, r"Soft

Re: Am I missing something with Python not having interfaces?

2008-05-07 Thread Bruno Desthuilliers
jmDesktop a écrit : (snip) On the dynamic typing, isn't that the same sort of thing that lots of scripting languages do? This is not restricted to scripting languages - that is, unless you'd call Smalltalk, Erlang or common lisp "scripting languages". Also and FWIW, static typing in C is mo

Re: strftime() argument 1 must be str, not unicode

2008-05-07 Thread Andrii V. Mishkovskyi
2008/5/7 Alexandr N Zamaraev <[EMAIL PROTECTED]>: > Subj is bag? > > Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit > (Intel)] on win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> from datetime import datetime > >>> datetime.today().strfti

Re: Problem parsing SOAP envelope with ElementTree

2008-05-07 Thread Waldemar Osuch
Zvi wrote: Hi All, Can someone tell me why id the following not working? snip not working code What am I doing wrong? Here is working code. 8<- from xml.etree import ElementTree as ET data = """xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"; xmlns

Why don't generators execute until first yield?

2008-05-07 Thread Martin Sand Christensen
Hi! First a bit of context. Yesterday I spent a lot of time debugging the following method in a rather slim database abstraction layer we've developed: , | def selectColumn(self, table, column, where={}, order_by=[], group_by=[]): | """Performs a SQL select query returning a single colum

Re: use php in python httpservers

2008-05-07 Thread artasis
On May 6, 3:00 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Hi, that is my task: > > I need to create python webserver-like extension(dll) which will run > > php and python scripts as plugins. > > I have no problems with dll creating and run python scripts, but I

Re: Why don't generators execute until first yield?

2008-05-07 Thread Ian Kelly
On Wed, May 7, 2008 at 2:29 AM, Martin Sand Christensen <[EMAIL PROTECTED]> wrote: > Now to the main point. When a generator function is run, it immediately > returns a generator, and it does not run any code inside the generator. > Not until generator.next() is called is any code inside the ge

mxTexTools (Re: using sqlite3 - execute vs. executemany; committing ...)

2008-05-07 Thread M.-A. Lemburg
On 2008-05-07 00:07, Vlastimil Brom wrote: Thanks for reminding me about the mxTextTools; I looked at this package very quickly several months ago and it seemed quite complex and heavy-weight, but maybe I will reconsider this after some investigation ... mxTextTools gives you almost full C spee

Re: Scanning through Windows registry...

2008-05-07 Thread Tim Golden
In a spirit of being helpful... :) The code below (which I imagine every Windows programmer writes sometime in their Python life) mimics the os.walk functionality, yielding the key, subkeys, and values under a particular starting point in the registry. The "if __name__ == '__main__'" test run at

Re: saving a webpage's links to the hard disk

2008-05-07 Thread castironpi
On May 7, 1:40 am, Jetus <[EMAIL PROTECTED]> wrote: > On May 4, 7:22 am, [EMAIL PROTECTED] wrote: > > > > > > > On May 4, 12:33 am, "Gabriel Genellina" <[EMAIL PROTECTED]> > > wrote: > > > > En Sun, 04 May 2008 01:33:45 -0300, Jetus <[EMAIL PROTECTED]> escribió: > > > > > Is there a good place to l

Re: Why don't generators execute until first yield?

2008-05-07 Thread Duncan Booth
Martin Sand Christensen <[EMAIL PROTECTED]> wrote: > Now to the main point. When a generator function is run, it immediately > returns a generator, and it does not run any code inside the generator. > Not until generator.next() is called is any code inside the generator > executed, giving it tra

Re: open filename with spaces in path

2008-05-07 Thread Chris
On May 7, 1:09 am, "Kam-Hung Soh" <[EMAIL PROTECTED]> wrote: > On Wed, 07 May 2008 08:36:35 +1000, Michael Robertson   > > <[EMAIL PROTECTED]> wrote: > > I'm having trouble opening a file in linux, whose path has spaces in it. > > > $ mkdir my\ test > > $ echo test > my\ test/test.txt > > $ python

Re: python vs. grep

2008-05-07 Thread Anton Slesarev
I try to save my time not cpu cycles) I've got file which I really need to parse: -rw-rw-r-- 1 xxx xxx 3381564736 May 7 09:29 bigfile That's my results: $ time grep "python" bigfile | wc -l 2470 real0m4.744s user0m2.441s sys 0m2.307s And python scripts: import sys if len(

Re: Python MIDI in 2008

2008-05-07 Thread Paul Boddie
On 6 Mai, 11:43, Max M <[EMAIL PROTECTED]> wrote: > [Python Midi] > It does not have real time support even though I did write it with that > support in mind. I just never got around to write it as I did not need > it myself. > > I also developed it on Windows and I found it to be a bore to get r

Re: python vs. grep

2008-05-07 Thread Ville Vainio
On May 6, 10:42 pm, Anton Slesarev <[EMAIL PROTECTED]> wrote: > flines = (line for line in f if pat.search(line)) What about re.findall() / re.finditer() for the whole file contents? -- http://mail.python.org/mailman/listinfo/python-list

Re: Why don't generators execute until first yield?

2008-05-07 Thread Martin Sand Christensen
> "Ian" == Ian Kelly <[EMAIL PROTECTED]> writes: Ian> Isn't lazy evaluation sort of the whole point of replacing a list Ian> with an iterator? Besides which, running up to the first yield when Ian> instantiated would make the generator's first iteration Ian> inconsistent with the remaining iter

Re: License selection for free software

2008-05-07 Thread Paul Boddie
On 6 Mai, 19:22, [EMAIL PROTECTED] (Ville M. Vainio) wrote: > Excuse the long post. Excuse the cherry-picking from your long post. ;-) [...] > Also, you can do what Paul Boddie did - fork the project, or maintain > patches that are under LGPL. With a liberal license, you have that > privilege.

FreeBSD KeyboardInterrupt not captured

2008-05-07 Thread radim . marek
Hi Guys, during testing of my project on FreeBSD I've discovered stange 'feature' of time.sleep(). It works if single thread is running, but when multi-threaded, the SIGINT signal seems not to be handled in same way. I've found three discussion about similar behavior with os.system() but so far n

PHP + TinyButStrong Python replacement

2008-05-07 Thread pistacchio
hi! i'm a php user and a python programmer. i'd love to use python for my server side needs but i can't seem to find what i'm looking for. for most of my php work i use mysql and tinyButStrong (http://www.tinybutstrong.com) which is a very lightweight template engine that offers powerful functi

Re: License selection for free software

2008-05-07 Thread D'Arcy J.M. Cain
On 06 May 2008 23:00:01 -0700 Paul Rubin <"http://phr.cx"@NOSPAM.invalid> wrote: > "Matt Porter" <[EMAIL PROTECTED]> writes: > > > Python's non-GPL license certainly is annoying to some of us. > > I'm intrigued - how can it be annoying? > > It means GPL'd contributions can't be included in the mai

Re: Why don't generators execute until first yield?

2008-05-07 Thread Martin Sand Christensen
> "Duncan" == Duncan Booth <[EMAIL PROTECTED]> writes: [...] Duncan> Now try: Duncan> Duncan>for command in getCommandsFromUser(): Duncan>print "the result of that command was", execute(command) Duncan> Duncan> where getCommandsFromUser is a greedy generator that reads from stdin,

Re: Scanning through Windows registry...

2008-05-07 Thread Unknown Hero
Thank you, I think I can manage now. It's nice that you could spare some time to help me in this, Tim. People like you make the world a better place :) I'll post my code here once I have time to write it, currently I'm rather busy. That is merely for optimization suggestions and for others who mig

Re: Why don't generators execute until first yield?

2008-05-07 Thread Duncan Booth
Martin Sand Christensen <[EMAIL PROTECTED]> wrote: >> "Duncan" == Duncan Booth <[EMAIL PROTECTED]> writes: > [...] > Duncan> Now try: > Duncan> > Duncan>for command in getCommandsFromUser(): > Duncan>print "the result of that command was", > execute(command) Duncan> > Duncan> whe

Re: Why don't generators execute until first yield?

2008-05-07 Thread Marco Mariani
Duncan Booth wrote: It does this: @greedy def getCommandsFromUser(): while True: yield raw_input('Command?') for cmd in getCommandsFromUser(): print "that was command", cmd Command?hello Command?goodbye that was command hello Comma

Some issue with right click in TreeCtrl

2008-05-07 Thread tarun
Hello All, Please find the code for a simple wx.TreeCtrl code. Whenever I right click on any item in the Tree, I see the function, 'OnSelChanged' gets called twice. What I've just done is that I've associated the function 'OnRightClick' with wx.EVT_TREE_ITEM_RIGHT_CLICK. And in this function, I s

Re: mxTexTools (Re: using sqlite3 - execute vs. executemany; committing ...)

2008-05-07 Thread Vlastimil Brom
2008/5/7, M.-A. Lemburg <[EMAIL PROTECTED]>: > > On 2008-05-07 00:07, Vlastimil Brom wrote: > > > Thanks for reminding me about > > the mxTextTools; I looked at this package very quickly several months > > ago and it seemed quite > > complex and heavy-weight, but maybe I will reconsider this after

Learning question...

2008-05-07 Thread swapsun
Any idea why the following program does not work? I was learning IO on Python and the following generates a TypeError: range() integer end argument expected, got str. I am a beginner. # print input name (str k), j times using raw_input def hello(): j=raw_input

Re: Why don't generators execute until first yield?

2008-05-07 Thread Marco Mariani
Marco Mariani wrote: Not here.. Oh, sorry, I obviously didn't see the @greedy decorator amongst all the quoting levels. Anyway, the idea doesn't make much sense to me :) -- http://mail.python.org/mailman/listinfo/python-list

Re: Why don't generators execute until first yield?

2008-05-07 Thread Duncan Booth
Marco Mariani <[EMAIL PROTECTED]> wrote: > Duncan Booth wrote: > >> It does this: >> > @greedy >> def getCommandsFromUser(): >> while True: >> yield raw_input('Command?') >> >> > for cmd in getCommandsFromUser(): >> print "that was command", cmd >> >>

Re: Learning question...

2008-05-07 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: > Any idea why the following program does not work? I was learning IO on > Python and the following generates a TypeError: range() integer end > argument expected, got str. > I am a beginner. Because raw_input does return you as string which you need explicitly convert to

Re: Why don't generators execute until first yield?

2008-05-07 Thread Marco Mariani
Duncan Booth wrote: Perhaps if you'd copied all of my code (including the decorator that was the whole point of it)... Sure, I missed the point. Python's > symbols become quoting levels and mess up messages. Anyway, I would loathe to start execution of a generator before starting to iterat

Re: Learning question...

2008-05-07 Thread Thomas Woelz
On 7 maio, 09:25, [EMAIL PROTECTED] wrote: > Any idea why the following program does not work? I was learning IO on > Python and the following generates a TypeError: range() integer end > argument expected, got str. > I am a beginner. > > > # print input name (str k

Re: Scanning through Windows registry...

2008-05-07 Thread Mike Driscoll
On May 7, 4:45 am, Tim Golden <[EMAIL PROTECTED]> wrote: > In a spirit of being helpful... :) > > The code below (which I imagine every Windows programmer writes > sometime in their Python life) mimics the os.walk functionality, yielding > the key, subkeys, and values under a particular starting po

Re: using sqlite3 - execute vs. executemany; committing ...

2008-05-07 Thread Vlastimil Brom
Hi David, thanks for your suggestions. The mentioned line of code is actually already a part of such a searching method, thus it is beeing called in a similar way you suggested, but anyhow it catched my eye ...; Thanks for the references to different markup systems, I haven't known many of them b

Re: PHP + TinyButStrong Python replacement

2008-05-07 Thread Mike Driscoll
On May 7, 6:12 am, pistacchio <[EMAIL PROTECTED]> wrote: > hi! i'm a php user and a python programmer. i'd love to use python for > my server side needs but i can't seem to find what i'm looking for. for > most of my php work i use mysql and tinyButStrong > (http://www.tinybutstrong.com) which is a

Re: Learning question...

2008-05-07 Thread swapsun
On May 7, 8:36 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Any idea why the following program does not work? I was learning IO on > > Python and the following generates a TypeError: range() integer end > > argument expected, got str. > > I am a beginner. > > Bec

Re: Learning question...

2008-05-07 Thread swapsun
On May 7, 8:42 am, Thomas Woelz <[EMAIL PROTECTED]> wrote: > On 7 maio, 09:25, [EMAIL PROTECTED] wrote: > > > Any idea why the following program does not work? I was learning IO on > > Python and the following generates a TypeError: range() integer end > > argument expected, got str. > > I am a beg

Re: Can't drag and drop onto .py in Windows XP?

2008-05-07 Thread Roger Upole
Sizer wrote: >I have several python utils that look at sys.argv to get a list of > filenames to process and mangle the files in various ways. If I have a > bar.bat file in Windows XP then I can just drag foo.avi onto bar.bat and > bar.bat gets called with foo.avi as an argument, everyone's happy.

Re: loading folder list from my mailbox in python

2008-05-07 Thread Mike Driscoll
On May 7, 1:15 am, [EMAIL PROTECTED] wrote: > Hey everyone, > I want to print the folder list of my mailbox using python (IMAP4), and > with hierarchy, i.e. it should print all the names of the folders of my > mailbox and the folders within them. > Can anyone please help me with this. Without know

Re: open filename with spaces in path

2008-05-07 Thread A.T.Hofkamp
On 2008-05-07, Chris <[EMAIL PROTECTED]> wrote: os.chdir('C:\temp\my test') > Traceback (most recent call last): > File "", line 1, in > WindowsError: [Error 123] The filename, directory name, or volume > label syntax is incorrect: 'C:\temp\\my test' Python strings have \ escapes, such as

Re: PHP + TinyButStrong Python replacement

2008-05-07 Thread Diez B. Roggisch
pistacchio wrote: > Mike Driscoll ha scritto: >> On May 7, 6:12 am, pistacchio <[EMAIL PROTECTED]> wrote: >>> hi! i'm a php user and a python programmer. i'd love to use python for >>> my server side needs but i can't seem to find what i'm looking for. for >>> most of my php work i use mysql and t

Re: saving a webpage's links to the hard disk

2008-05-07 Thread Diez B. Roggisch
Jetus wrote: > On May 4, 7:22 am, [EMAIL PROTECTED] wrote: >> On May 4, 12:33 am, "Gabriel Genellina" <[EMAIL PROTECTED]> >> wrote: >> >> > En Sun, 04 May 2008 01:33:45 -0300, Jetus <[EMAIL PROTECTED]> >> > escribió: >> >> > > Is there a good place to look to see where I can find some code that >>

Re: PHP + TinyButStrong Python replacement

2008-05-07 Thread pistacchio
Diez B. Roggisch ha scritto: pistacchio wrote: Mike Driscoll ha scritto: On May 7, 6:12 am, pistacchio <[EMAIL PROTECTED]> wrote: hi! i'm a php user and a python programmer. i'd love to use python for my server side needs but i can't seem to find what i'm looking for. for most of my php work

Re: Why don't generators execute until first yield?

2008-05-07 Thread castironpi
On May 7, 7:37 am, Marco Mariani <[EMAIL PROTECTED]> wrote: > Duncan Booth wrote: > > Perhaps if you'd copied all of my code (including the decorator that was > > the whole point of it)... > > Sure, I missed the point. Python's > symbols become quoting levels and > mess up messages. > > Anyway, I w

Re: PHP + TinyButStrong Python replacement

2008-05-07 Thread pistacchio
Mike Driscoll ha scritto: On May 7, 6:12 am, pistacchio <[EMAIL PROTECTED]> wrote: hi! i'm a php user and a python programmer. i'd love to use python for my server side needs but i can't seem to find what i'm looking for. for most of my php work i use mysql and tinyButStrong (http://www.tinybuts

Re: open filename with spaces in path

2008-05-07 Thread Chris
On May 7, 3:25 pm, "A.T.Hofkamp" <[EMAIL PROTECTED]> wrote: > On 2008-05-07, Chris <[EMAIL PROTECTED]> wrote: > > os.chdir('C:\temp\my test') > > Traceback (most recent call last): > >   File "", line 1, in > > WindowsError: [Error 123] The filename, directory name, or volume > > label syntax

Re: PHP + TinyButStrong Python replacement

2008-05-07 Thread George Sakkis
On May 7, 9:40 am, pistacchio <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch ha scritto: > > > > > pistacchio wrote: > > >> Mike Driscoll ha scritto: > >>> On May 7, 6:12 am, pistacchio <[EMAIL PROTECTED]> wrote: > hi! i'm a php user and a python programmer. i'd love to use python for > m

Re: Generate labels for a multi-level outline

2008-05-07 Thread castironpi
''' On May 6, 4:43 pm, [EMAIL PROTECTED] honoring: >>> a.next( ) ( "I", ) >>> a.throw( up ) ( "I", "A" ) >>> a.next( ) ( "I", "B" ) >>> a.next( ) ( "I", "C" ) >>> a.throw( down ) ( "II", ) ''' #funny declaration class up( Exception ): pass class down( Exception ): pass def outline( ): stack=

comparing dictionaries

2008-05-07 Thread brad
I want to compare two dicts that should have identical info just in a different data structure. The first dict's contents look like this. It is authoritative... I know for sure it has the correct key value pairs: {'001' : '01'} The second dict's contents are like this with a tuple instead of a

What is the purpose of ptyhon in Windows

2008-05-07 Thread [EMAIL PROTECTED]
hi All, I have no idea why I need to learn a new scripting language, nothing much to the sytnax, I need to understand what could be the prupose of another scripting language Cna you please help me with this, Is there a possibilty to work on bigger projects with Python -- http://mail.python.org/mai

Pydev 1.3.16 Released

2008-05-07 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.3.16 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions: --

Re: comparing dictionaries

2008-05-07 Thread cokofreedom
On May 7, 4:08 pm, brad <[EMAIL PROTECTED]> wrote: > I want to compare two dicts that should have identical info just in a > different data structure. The first dict's contents look like this. It > is authoritative... I know for sure it has the correct key value pairs: > > {'001' : '01'} > > The se

Re: PHP + TinyButStrong Python replacement

2008-05-07 Thread pistacchio
George Sakkis ha scritto: On May 7, 9:40 am, pistacchio <[EMAIL PROTECTED]> wrote: Diez B. Roggisch ha scritto: pistacchio wrote: Mike Driscoll ha scritto: On May 7, 6:12 am, pistacchio <[EMAIL PROTECTED]> wrote: hi! i'm a php user and a python programmer. i'd love to use python for my s

Re: What is the purpose of ptyhon in Windows

2008-05-07 Thread cokofreedom
On May 7, 4:08 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > hi All, > I have no idea why I need to learn a new scripting language, > nothing much to the sytnax, > I need to understand what could be the prupose of another scripting > language > > Cna you please help me with this, > Is there

Re: Scanning through Windows registry...

2008-05-07 Thread Tim Golden
Mike Driscoll wrote: On May 7, 4:45 am, Tim Golden <[EMAIL PROTECTED]> wrote: In a spirit of being helpful... :) [... snip registry walker ...] This is pretty cool stuff, Tim. Of course, it would also seriously screw up some programs if you decided to replace the wrong phrase. Just a word of

Re: comparing dictionaries

2008-05-07 Thread Carsten Haese
brad wrote: I want to compare two dicts that should have identical info just in a different data structure. The first dict's contents look like this. It is authoritative... I know for sure it has the correct key value pairs: {'001' : '01'} The second dict's contents are like this with a tuple

Re: Are rank noobs tolerated, here?

2008-05-07 Thread notbob
On 2008-05-06, hdante <[EMAIL PROTECTED]> wrote: > When you have a problem with your code, always post here the complete > code and a complete execution. For example: I'll keep this example. Thnx. > /--\ glued > | bruce | --> 42 > \--/ > > When you use a stamp, it r

Re: PHP + TinyButStrong Python replacement

2008-05-07 Thread python
Pistacchio, Templite http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496702 A light-weight (~40 lines), fully functional, general purpose templating engine, allowing you to embed python code directly into your text. This engine is suitable for any templating (not only HTML/XML), and is mi

Re: Scanning through Windows registry...

2008-05-07 Thread Mike Driscoll
On May 7, 9:19 am, Tim Golden <[EMAIL PROTECTED]> wrote: > Mike Driscoll wrote: > > On May 7, 4:45 am, Tim Golden <[EMAIL PROTECTED]> wrote: > >> In a spirit of being helpful... :) > > [... snip registry walker ...] > > > This is pretty cool stuff, Tim. Of course, it would also seriously > > screw

Re: What is the purpose of ptyhon in Windows

2008-05-07 Thread Mike Driscoll
On May 7, 9:08 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > hi All, > I have no idea why I need to learn a new scripting language, > nothing much to the sytnax, > I need to understand what could be the prupose of another scripting > language > > Cna you please help me with this, > Is there

listening on TCP port

2008-05-07 Thread petr . poupa
Hello, is there anybody who has experience with listening on TCP port with python? I am looking for anything codes, tutorials,... . Thanks for any information -- http://mail.python.org/mailman/listinfo/python-list

Re: python vs. grep

2008-05-07 Thread Pop User
Anton Slesarev wrote: But I have some problem with writing performance grep analog. I don't think you can ever catch grep. Searching is its only purpose in life and its very good at it. You may be able to come closer, this thread relates. http://groups.google.com/group/comp.lang.python/

Re: Why don't generators execute until first yield?

2008-05-07 Thread Diez B. Roggisch
> Now to the main point. When a generator function is run, it immediately > returns a generator, and it does not run any code inside the generator. > Not until generator.next() is called is any code inside the generator > executed, giving it traditional lazy evaluation semantics. Why don't > genera

Re: listening on TCP port

2008-05-07 Thread Jean-Paul Calderone
On Wed, 7 May 2008 08:03:35 -0700 (PDT), [EMAIL PROTECTED] wrote: Hello, is there anybody who has experience with listening on TCP port with python? I am looking for anything codes, tutorials,... . Thanks for any information Take a look at http://twistedmatrix.com/projects/core/documentation/h

Re: What is the purpose of ptyhon in Windows

2008-05-07 Thread WolfgangZ
[EMAIL PROTECTED] schrieb: hi All, I have no idea why I need to learn a new scripting language, nothing much to the sytnax, I need to understand what could be the prupose of another scripting language Cna you please help me with this, Is there a possibilty to work on bigger projects with Python

Re: Problem parsing SOAP envelope with ElementTree

2008-05-07 Thread Zvi
On May 7, 1:12 am, Waldemar Osuch <[EMAIL PROTECTED]> wrote: Thanks a lot :) P.S. It was a complete code, I didn't write anything else. -- http://mail.python.org/mailman/listinfo/python-list

Re: FreeBSD KeyboardInterrupt not captured

2008-05-07 Thread Rhamphoryncus
On May 7, 5:00 am, [EMAIL PROTECTED] wrote: > Hi Guys, > > during testing of my project on FreeBSD I've discovered stange > 'feature' of time.sleep(). It works if single thread is running, but > when multi-threaded, the SIGINT signal seems not to be handled in same > way. > > I've found three discu

Re: Am I missing something with Python not having interfaces?

2008-05-07 Thread Bjoern Schliessmann
jmDesktop wrote: > Studying OOP and noticed that Python does not have Interfaces. By "OOP", you mean "Java", right? 8) > Is that correct? Is my schooling for nought on these OOP concepts > if I use Python. Am I losing something if I don't use > the "typical" oop constructs found in other lang

Idea for P3K

2008-05-07 Thread M�ta-MCI (MVP)
Hi! print become a function ; OK I thought: and why the affection (=) would not become, also, a function? Examples: a = 123return 123 b,c = 543.21, "LOL"return (543.21, "LOL") @-salutations Michel Claveau -- http://mail.python.org/mailman/l

Re: listening on TCP port

2008-05-07 Thread Grant Edwards
On 2008-05-07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > is there anybody who has experience with listening on TCP port > with python? I am looking for anything codes, tutorials,... . http://docs.python.org/lib/module-socket.html -- Grant Edwards grante Yow!

Re: What is the purpose of ptyhon in Windows

2008-05-07 Thread Grant Edwards
On 2008-05-07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I have no idea why I need to learn a new scripting language, > nothing much to the sytnax, I need to understand what could be > the prupose of another scripting language Python is a general purpose programming language like Java, Small

Re: What is the purpose of ptyhon in Windows

2008-05-07 Thread Max Erickson
WolfgangZ <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: >> hi All, >> http://mail.python.org/mailman/listinfo/python-list >> > At least I'm living in a free country and nobody forces me to > learn python. So I don't fully understand why you HAVE TO learn > it. When your problems can be

letter frequency counter / your thoughts..

2008-05-07 Thread umpsumps
Hello, Here is my code for a letter frequency counter. It seems bloated to me and any suggestions of what would be a better way (keep in my mind I'm a beginner) would be greatly appreciated.. def valsort(x): res = [] for key, value in x.items(): res.append((value,

Re: License selection for free software

2008-05-07 Thread Carl Banks
On May 7, 3:51 am, Paul Rubin wrote: > Carl Banks <[EMAIL PROTECTED]> writes: > > Nonsense. They could be more than willing to contribute their > > patches, but aren't willing to accept the GPL's limitation to being > > used only in open source packages. > > Oh, I see wh

Re: letter frequency counter / your thoughts..

2008-05-07 Thread Paul Melis
[EMAIL PROTECTED] wrote: Here is my code for a letter frequency counter. It seems bloated to me and any suggestions of what would be a better way (keep in my mind I'm a beginner) would be greatly appreciated.. Not bad for a beginner I think :) def valsort(x): res = [] for key

Re: License selection for free software

2008-05-07 Thread Ville M. Vainio
Paul Boddie <[EMAIL PROTECTED]> writes: > original licence as well. Now, I did leave a fair amount of > information about the heritage of the code, so that anyone who is > scared of the LGPL could just go and get the original work, but that I doubt anyone is really afraid of LGPL. The only probl

Re: License selection for free software

2008-05-07 Thread Carl Banks
On May 7, 6:56 am, Paul Boddie <[EMAIL PROTECTED]> wrote: > On 6 Mai, 19:22, [EMAIL PROTECTED] (Ville M. Vainio) wrote: > > I don't think BSD/MIT like license really annoys anyone. Think python > > here ;-) > > As some have pointed out, it can discourage people from contributing. > I've said many t

Re: letter frequency counter / your thoughts..

2008-05-07 Thread castironpi
On May 7, 12:30 pm, Paul Melis <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Here is my code for a letter frequency counter.  It seems bloated to > > me and any suggestions of what would be a better way (keep in my mind > > I'm a beginner) would be greatly appreciated.. > > Not bad for

Re: Generate labels for a multi-level outline

2008-05-07 Thread castironpi
On May 7, 9:07 am, [EMAIL PROTECTED] wrote: > ''' > On May 6, 4:43 pm, [EMAIL PROTECTED] honoring: > > >>> a.next( ) > ( "I", ) > >>> a.throw( up ) > ( "I", "A" ) > >>> a.next( ) > ( "I", "B" ) > >>> a.next( ) > ( "I", "C" ) > >>> a.throw( down ) > > ( "II", ) > ''' > > #funny declaration > class u

Re: comparing dictionaries

2008-05-07 Thread Arnaud Delobelle
brad <[EMAIL PROTECTED]> writes: > I want to compare two dicts that should have identical info just in a > different data structure. The first dict's contents look like this. It > is authoritative... I know for sure it has the correct key value > pairs: > > {'001' : '01'} -> refdict > > The seco

Re: Idea for P3K

2008-05-07 Thread Arnaud Delobelle
"Méta-MCI (MVP)" <[EMAIL PROTECTED]> writes: > Hi! > > print become a function ; OK > > I thought: and why the affection (=) would not become, also, a function? > Examples: >a = 123return 123 >b,c = 543.21, "LOL"return (543.21, "LOL") Do you m

Re: letter frequency counter / your thoughts..

2008-05-07 Thread Arnaud Delobelle
[EMAIL PROTECTED] writes: > Hello, > > Here is my code for a letter frequency counter. It seems bloated to > me and any suggestions of what would be a better way (keep in my mind > I'm a beginner) would be greatly appreciated.. > > def valsort(x): > res = [] > for key, value in x.item

Re: letter frequency counter / your thoughts..

2008-05-07 Thread Ian Kelly
On Wed, May 7, 2008 at 11:30 AM, Paul Melis <[EMAIL PROTECTED]> wrote: > dic = {} > for letter in strng: > if letter not in dic: > dic[letter] = 0 > dic[letter] += 1 As a further refinement, you could use the defaultdict class from the collections module: di

Re: Generate labels for a multi-level outline (THANK-YOU!)

2008-05-07 Thread python
Castironpi and Dennis, WOW! Thank you very much for your examples!!! I wasn't trolling for free development, just whether such a library existed and/or design ideas (basic object or generator). I had started to develop my own solution which was much more complicated (re: ugly) than your 2 very e

Re: Bad form to access a *private variable* like _foo?

2008-05-07 Thread [EMAIL PROTECTED]
On May 6, 3:27 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > There are other ways. For example, > > sqlobject.sqlhub.threadingLocal.connection > > if your system is using multiple threads correctly. Generally speaking, > sqlhub could/should be used. That's actually quite involved. You must

Re: letter frequency counter / your thoughts..

2008-05-07 Thread castironpi
On May 7, 1:31 pm, "Ian Kelly" <[EMAIL PROTECTED]> wrote: > On Wed, May 7, 2008 at 11:30 AM, Paul Melis <[EMAIL PROTECTED]> wrote: > >     dic = {} > >     for letter in strng: > >         if letter not in dic: > >             dic[letter] = 0 > >         dic[letter] += 1 > > As a further refinement

Re: PHP + TinyButStrong Python replacement

2008-05-07 Thread Terry Reedy
"pistacchio" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | well, it doesn't matter if it's a single file or a package, but it | _does_ matter if you have to put them under the path where python is | installed because, in a typical shared web hosting environment (such the | one th

Re: Am I missing something with Python not having interfaces?

2008-05-07 Thread [EMAIL PROTECTED]
On 7 mai, 18:05, Bjoern Schliessmann wrote: > jmDesktop wrote: > > Studying OOP and noticed that Python does not have Interfaces. > > By "OOP", you mean "Java", right? 8) > > > Is that correct? Is my schooling for nought on these OOP concepts > > if I use Python. Am I losing something if I don't

Re: Idea for P3K

2008-05-07 Thread M�ta-MCI (MVP)
Hi! I don't often feel like using this word Look at languages like OCAML or F # @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Learning question...

2008-05-07 Thread Terry Reedy
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] | Any idea why the following program does not work? I was learning IO on | Python and the following generates a TypeError: range() integer end | argument expected, got str. | I am a beginner. | | | # prin

Re: Am I missing something with Python not having interfaces?

2008-05-07 Thread Daniel Marcel Eichler
Am Dienstag 06 Mai 2008 16:07:01 schrieb Mike Driscoll: > If so, then it looks like an Interface is a generic class with method > stubs. You can do that with Python just as easily by creating empty > methods with just the "pass" keyword. Well, no. It's a litte different. Interfaces force to impl

  1   2   >