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
?
Please specify!
Cheers,
--Tim
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
ze.py
# Thanks seems to work for me
cheers
--
Tim
[email protected]
--
https://mail.python.org/mailman/listinfo/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
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"
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
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
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
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...
ld be great to
make it work from this script.
Thanks in advance
Tim
--
https://mail.python.org/mailman/listinfo/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
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
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
7701 - 7730 of 7730 matches
Mail list logo