Re: printing out elements in list

2006-05-08 Thread Tim N. van der Leeuw
other element you write: alist[::2] Which takes all elements of your list, starting at position 0, adding 2 to the index each step, so next is item 2, then 4, etc, until end of list. Now we have all the 'even-numbered' elements in the list, to get the 'odd-numbered elements' write

Re: How can I do this with python ?

2006-05-08 Thread Tim N. van der Leeuw
? Please specify! Cheers, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Python memory deallocate

2006-05-11 Thread Tim N. van der Leeuw
d to iterate over some numbers, it's better to use 'xrange' instead of 'range': 'xrange' will not create the whole list of numbers in advance, but will create an iterator, producing the desired numbers one by one. With such large ranges, this will reduce memory consu

Re: New tail recursion decorator

2006-05-12 Thread Tim N. van der Leeuw
th the factorial-function as defined in the cookbook-recipe is much much faster than calculating the same factorial(1000) with the factorial-function you gave! I cannot yet explain why the first function has so much better performance than the second function - about a factor 10 difference, in both python2.4.3 and python 2.5a2 Cheers, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: New tail recursion decorator

2006-05-12 Thread Tim N. van der Leeuw
what would be the stacklimit on my system (Python 2.4.3 on WinXP SP2). I already calculated the factorial of 50 using the recursive (non-decorated) function... Cheers, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: New tail recursion decorator

2006-05-12 Thread Tim N. van der Leeuw
Duncan Booth wrote: > Tim N. van der Leeuw wrote: > [...] > @tail_recursion > def factorial2(n): > # do the stuff > pass > > your 'do the stuff' actually had an erroneous call to 'factorial'. If you > are going to rename the function you ha

Re: Windows & Apache 1.3 & mod_python.dll

2006-05-16 Thread Tim N. van der Leeuw
Any particular reason for not using Apache 2, and mod_python 3.x? Anyways, looks to me like there's a problem with the path where the DLL is installed, vs. where it's search for by Apache? I had no particular problems installing Apache 2 and mod_python 3.x on WinXP, using the mod_python installer

Re: Option parser question - reading options from file as well as command line

2006-05-17 Thread Tim N. van der Leeuw
software, or freely downloadable? (I'd love to be able to write messages to IBM MQ Series from Python) Cheers, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Time to bundle PythonWin

2006-05-17 Thread Tim N. van der Leeuw
27;, but quoting isn't hard using google groups. Just clicking the right links instead of the 'reply' link beneath the message. On-Topic: I'd welcome PythonWin added to the Python Windows MSI installer too, for purposes similar to the O-Ps. Do not possess the necessary skill to w

Re: Option parser question - reading options from file as well as command line

2006-05-17 Thread Tim N. van der Leeuw
Andrew Robert wrote: > Tim N. van der Leeuw wrote: > > Andrew Robert wrote: [...] > Hi Tim, > > I am using the pymqi module which is freely available at > http://pymqi.sourceforge.net/ . > > Documentation on the module can be found at > http://pymqi.sourceforge.ne

Re: Process forking on Windows

2006-05-18 Thread Tim N. van der Leeuw
Well, if your original program is long-running, your sub-process is short-running, and you cannot 'disconnect' from the MQ Monitor other than by terminating a process, yes then I can see how using a subprocess could solve your problem... But I don't know why the SubProcess module doesn't do what you want. Cheers, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Option parser question - reading options from file as well as command line

2006-05-22 Thread Tim N. van der Leeuw
is an option '-f' or '--file'followed by the filename with options you wish to add to the command-line). The implementation reads the entire contents of the file into memory. (c) Copyright 2006 Tim N. van der Leeuw ([EMAIL PROTECTED]) """ import re from optpa

Re: documentation for win32com?

2006-05-24 Thread Tim N. van der Leeuw
e plugin doesn't work well for it). > Also, searching this group and the pywin32 mailing list > for "excel.application" turns up a bunch of sample code. > > hth >Roger > > Cheers, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: John Bokma harassment

2006-05-24 Thread Tim N. van der Leeuw
s essays to so many newsgroups, yet he continues doing it. If that's enough to quit his subscription with his ISP I don't know, but since I've stopped following threads originated by him I don't know what other grounds there would be. Cheers, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Python regex question

2008-08-15 Thread Tim N. van der Leeuw
Hey Gerhard, Gerhard Häring wrote: > > Tim van der Leeuw wrote: >> Hi, >> >> I'm trying to create a regular expression for matching some particular >> XML strings. I want to extract the contents of a particular XML tag, >> only if it fol

Re: Bitwise OR?

2006-03-24 Thread Tim N. van der Leeuw
xkenneth wrote: > Why is 3500 | -67 equal to 3500 instead of -3567? Well that's funny... On my computer, python says it's -67. Java also says it's -67. Haven't yet looked at the actual bits of both values. What Python implementation and what machine do you

Re: Bitwise OR?

2006-03-24 Thread Tim N. van der Leeuw
of the operands as sets of bits. Bitwise OR is the union of 2 sets of bits. Don't think of the operands to bit operators as numbers, and don't try to do your sums using bitwise or! :-) --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Bitwise OR?

2006-03-24 Thread Tim N. van der Leeuw
duces more digits. I also wonder if it wouldn't be faster to put the numbers into a list and join the list into a string -- did you test with that? Cheers, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: pre-PEP: The create statement

2006-04-06 Thread Tim N. van der Leeuw
he python-dev mailing lists and what the reactions of python-devs and GvR was? regards, --Tim -- http://mail.python.org/mailman/listinfo/python-list

Re: Correct module for site customization of path

2024-11-01 Thread Tim Johnson via Python-list
ze.py # Thanks seems to work for me cheers -- Tim [email protected] -- https://mail.python.org/mailman/listinfo/python-list

Correct module for site customization of path

2024-10-31 Thread Tim Johnson via Python-list
boatload of documentation of site path configuration, but still, I am not sure what option to take. Recommendations are invited and welcome. Thanks -- Tim [email protected] -- https://mail.python.org/mailman/listinfo/python-list

Re: ModuleNotFoundError for youtube_dl

2024-12-09 Thread Tim Johnson via Python-list
On 12/9/24 14:59, Tim Johnson wrote: Recently did a refresh of ubuntu 24.04 With no code changes am now getting a *ModuleNotFoundError *for youtube_dl Relevant code is import sys sys.path.append("/home/tim/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl"

ModuleNotFoundError for youtube_dl

2024-12-09 Thread Tim Johnson via Python-list
Recently did a refresh of ubuntu 24.04 With no code changes am now getting a *ModuleNotFoundError *for youtube_dl Relevant code is import sys sys.path.append("/home/tim/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl") import youtube_dl ' Navigatin

Re: subprocess.Popen does not launch audacity

2025-01-10 Thread Tim Johnson via Python-list
On 1/10/25 12:53, Thomas Passin via Python-list wrote: On 1/10/2025 4:00 PM, Tim Johnson via Python-list wrote: On 1/10/25 11:32, MRAB via Python-list wrote: ,,, snipped Below is the pertinent code:    Popen(choice, stdout=PIPE, stderr=PIPE,     stdin=PIPE, close_fds=True

Re: No module name mutagen

2025-01-01 Thread Tim Johnson via Python-list
On 12/31/24 15:00, Tim Johnson wrote: . Snipped I resolved this by extrapolating known paths of other non-distro pipx installs, and am back in business now. I'm taking lots of notes. For some reason, even after running updatedb, I had no luck finding with locate. I was not

No module name mutagen

2024-12-31 Thread Tim Johnson via Python-list
I am at a loss. don't know what to do. I am only using python script for command line utilities on my desktop and local network. Must I be using a virtual environment? If so, I would be happy to set one up if I am given the python-approved directions (lots of conflicting info out there...

subprocess.Popen does not launch audacity

2025-01-10 Thread Tim Johnson via Python-list
ld be great to make it work from this script. Thanks in advance Tim -- https://mail.python.org/mailman/listinfo/python-list

Re: subprocess.Popen does not launch audacity

2025-01-10 Thread Tim Johnson via Python-list
On 1/10/25 11:32, MRAB via Python-list wrote: ,,, snipped Below is the pertinent code:    Popen(choice, stdout=PIPE, stderr=PIPE,     stdin=PIPE, close_fds=True) My guess is my argument list is either insufficient or an argument is causing the problem, but am unsure of which

Re: Trailer for upcoming Python documentary

2025-05-18 Thread Tim Daneliuk via Python-list
On 5/18/25 15:16, Larry Martell wrote: https://youtu.be/pqBqdNIPrbo?si=P2ukSXnDj3qy3HBJ Get ready Guido: "I'd like to thank the Academy ..." -- https://mail.python.org/mailman/listinfo/python-list

Re: Python documentary

2025-08-29 Thread Tim Williams via Python-list
On Fri, Aug 29, 2025 at 3:37 PM Larry Martell via Python-list < [email protected]> wrote: > https://www.youtube.com/watch?v=GfH4QL4VqJ0 > > Watched this last night. Overall I enjoyed it (but my wife, who is not a > programmer, fell asleep). My only quibble is that they spent too much time > t

<    73   74   75   76   77   78