Hi All,
Hope everyone had a nice break? Here's to the new year and our first Python
Ireland meetup of the year!
When: Wed, 13th Jan, 2010 @ 19:00
Where: Trinity Capital Hotel, Pearse St., D2
More details:-
http://www.python.ie/meetup/2010/pub_meetup__trinity_capital_hotel_-_wed_13th_jan/
On Jan 10, 1:26 pm, Hellmut Weber m...@hellmutweber.de wrote:
Hi,
being a causal python user (who likes the language quite a lot)
it took me a while to realize the following:
l...@sylvester py_count $ python
Python 2.6.3 (r263:75183, Oct 26 2009, 12:34:23)
[GCC 4.4.1] on linux2
Type help,
* Paul Rudin:
Sebastian sebastian.lan...@gmx.de writes:
I have an array x=[1,2,3]
In python such an object is called a list.
(In cpython it's implemented as an automatically resizable array.)
I don't think the OP's terminology needs correction.
A Python list is an array
On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote:
* Paul Rudin:
Sebastian sebastian.lan...@gmx.de writes:
I have an array x=[1,2,3]
In python such an object is called a list.
(In cpython it's implemented as an automatically resizable array.)
I don't think the OP's
Thank you for your answers! I actually implemented it using for loops
before I posted here, but I was curious if there is a more elegant
solution (judging from the post, Alf will probably say, that for loops
are already elegant).
Sebastian
--
http://mail.python.org/mailman/listinfo/python-list
Hi all
This problem is similar to one I posted recently regarding the
multiprocessing module and unicode.
However, although this one manifests itself while using the multiprocessing
module, is caused by Python itself (2.6.2).
At the top of my program I have 'from __future__ import
Alf P. Steinbach wrote:
Re the thing I don't understand: it's the same in C++, people using hours
on figuring out how to do something very simple in an ungrokkable indirect
and compiled way using template metaprogramming stuff, when they could
just write a simple 'for' loop and be done with
* Steven D'Aprano:
On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote:
* Paul Rudin:
Sebastian sebastian.lan...@gmx.de writes:
I have an array x=[1,2,3]
In python such an object is called a list.
(In cpython it's implemented as an automatically resizable array.)
I don't think
Cheers guys - I'll check the books out :)
Thanks very much.
--
http://mail.python.org/mailman/listinfo/python-list
In Python 3.1 is there any difference in the buffering behavior of the
initial sys.stdout and sys.stderr streams?
No.
Were they different at some earlier point in Python's evolution?
That depends on the operating system. These used to be whatever the
C library set up as stdout and stderr.
On Mon, Jan 11, 2010 at 1:03 AM, Alf P. Steinbach al...@start.no wrote:
* Steven D'Aprano:
On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote:
* Paul Rudin:
Sebastian sebastian.lan...@gmx.de writes:
I have an array x=[1,2,3]
In python such an object is called a list.
(In
Hi,
thanks to all who answered.
I'm using Python 2.6.5 on my machine and consulted the corresponding
documentation.
I do appreciate the modified definition of python 3, that seems much
more reasonable.
Thanks for indicating.
Greetings from Munich in Winter
Hellmut
Am 10.01.2010 17:34,
geremy condra debat...@gmail.com writes:
And having no dependencies frees you from the burden of testing
where your software will be deployed? I don't think so.
If you just use the stdlib and are a bit careful about OS dependent
features, your code can run pretty much everywhere. More to the
* Chris Rebert:
On Mon, Jan 11, 2010 at 1:03 AM, Alf P. Steinbach al...@start.no wrote:
* Steven D'Aprano:
On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote:
* Paul Rudin:
Sebastian sebastian.lan...@gmx.de writes:
I have an array x=[1,2,3]
In python such an object is called a
On Mon, Jan 11, 2010 at 2:20 AM, Alf P. Steinbach al...@start.no wrote:
* Chris Rebert:
On Mon, Jan 11, 2010 at 1:03 AM, Alf P. Steinbach al...@start.no wrote:
* Steven D'Aprano:
On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote:
* Paul Rudin:
Sebastian sebastian.lan...@gmx.de
I have an array x=[1,2,3]
Is there an operator which I can use to get the result
[1,1,1,2,2,2,3,3,3] ?
I tried x*3, which resulted in [1,2,3,1,2,3,1,2,3]
Have you tried:
y = x*3
y.sort()
Munir
--
http://mail.python.org/mailman/listinfo/python-list
I'm not sure whose fault this is, the author of python-magic or
easy_install (I'm guessing easy_install) but in any case
easy_install python-magic
(as root) fails with
Searching for python-magic
Reading http://pypi.python.org/simple/python-magic/
Reading http://hupp.org/adam/hg/python-magic
No
* Chris Rebert:
On Mon, Jan 11, 2010 at 2:20 AM, Alf P. Steinbach al...@start.no wrote:
* Chris Rebert:
On Mon, Jan 11, 2010 at 1:03 AM, Alf P. Steinbach al...@start.no wrote:
* Steven D'Aprano:
On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote:
* Paul Rudin:
Sebastian
W. eWatson wrote:
Maybe there's a more elegant way to do this. I want to express the
result of datetime.datetime.now() in fractional hours.
Here's one way.
dt=datetime.datetime.now()
xtup = dt.timetuple()
h = xtup[3]+xtup[4]/60.0+xtup[5]/3600.00+xtup[6]/10**6
# now is in fractions of
You're invited to the first test of the Global Python bimonthly evening
meetings at BerkeleyTIP-Global. :)
Join in tonight, Monday Jan 11, 5-6P Pacific, 8-9P Eastern, = Tues Jan
12 1A-2A UTC.
http://sites.google.com/site/berkeleytip/schedule
On #berkeleytip on irc.freenode.net,
on voip -
W. eWatson wrote:
Maybe there's a more elegant way to do this. I want to express the
result of datetime.datetime.now() in fractional hours.
Here's one way.
dt=datetime.datetime.now()
xtup = dt.timetuple()
h = xtup[3]+xtup[4]/60.0+xtup[5]/3600.00+xtup[6]/10**6
# now is in fractions of an hour
Martin P. Hellwig wrote:
W. eWatson wrote:
Maybe there's a more elegant way to do this. I want to express the
result of datetime.datetime.now() in fractional hours.
Here's one way.
dt=datetime.datetime.now()
xtup = dt.timetuple()
h = xtup[3]+xtup[4]/60.0+xtup[5]/3600.00+xtup[6]/10**6
# now
Aahz wrote:
In article mailman.2244.1261418090.2873.python-l...@python.org,
Jean-Michel Pichavant jeanmic...@sequans.com wrote:
class A:
def __init__(self, foo = None, bar = None):
if len(foo) 5:
raise ValueError('foo cannot exceed 5 characters')
Bad Idea
On Sun, Jan 10, 2010 at 3:09 PM, MRAB pyt...@mrabarnett.plus.com wrote:
browser = form.getfirst('browser', 'all')
except:
browser = headers()
try:
A bare except, and if an exception _does_ occur, they'll be a NameError
because 'headers' isn't defined.
slap with large halibut/
Oh, not
Victor Subervi wrote:
On Sat, Jan 9, 2010 at 11:56 AM, Gary Herron
gher...@islandtraining.com mailto:gher...@islandtraining.com wrote:
Victor Subervi wrote:
Hi;
I have a string.join statement on a variable that comes from a
cgi.FieldStorage().getlist. The variable
Hi.
I'm trying to figure out how to force URLencoding in my Python 2.4.3
environment receiving data an input argument but I'm really at a loss
here.
What am I doing wrong?
#!/usr/bin/env python
import sys
from urllib import urlencode, urlopen
from urllib2 import Request
import urlparse
On Mon, Jan 11, 2010 at 10:00 AM, Jean-Michel Pichavant
jeanmic...@sequans.com wrote:
Victor Subervi wrote:
On Sat, Jan 9, 2010 at 11:56 AM, Gary Herron
gher...@islandtraining.commailto:
gher...@islandtraining.com wrote:
Victor Subervi wrote:
Hi;
I have a string.join
Terry Reedy wrote:
On 1/10/2010 4:15 AM, Peter Billam wrote:
Greetings. Is there a way to get at the Computer Music Toolkit (CMT)
http://www.ladspa.org/cmt/
functionality from Python (Python3 in my case) ?
You can access compiled C shared libraries most easily via the ctypes
module.
so if
does anyone know a way to package a static version of a python module?
This is, the same that pyinstaller does with single scripts, but with a
complete module directory.
I'm specially interested in packaging all pyqt4, sip and qt4 dependencies
within the module itself.
thanks,
Jaime.
--
Victor Subervi wrote:
On Sun, Jan 10, 2010 at 3:09 PM, MRAB pyt...@mrabarnett.plus.com wrote:
browser = form.getfirst('browser', 'all')
except:
browser = headers()
try:
A bare except, and if an exception _does_ occur, they'll be a NameError
because 'headers' isn't defined.
On Mon, Jan 11, 2010 at 11:26 AM, Dave Angel da...@ieee.org wrote:
Victor Subervi wrote:
On Sun, Jan 10, 2010 at 3:09 PM, MRAB pyt...@mrabarnett.plus.com wrote:
browser = form.getfirst('browser', 'all')
except:
browser = headers()
try:
A bare except, and if an exception _does_
Hi,
I am using pyserial. But I always get the local echo after I write
some characters onto serial port and I find no way to disable this
behavior. When I say 'local echo', I mean the next read operation will
get characters that was just write to the same port.
I run my program on cygwin
Steven Woody wrote:
Hi,
I am using pyserial. But I always get the local echo after I write
some characters onto serial port and I find no way to disable this
behavior. When I say 'local echo', I mean the next read operation will
get characters that was just write to the same port.
I run
On Jan 11, 3:35 pm, Jeremy jlcon...@gmail.com wrote:
Hello all,
I am using re.split to separate some text into logical structures.
The trouble is that re.split doesn't find everything while re.findall
does; i.e.:
found = re.findall('^ 1', line, re.MULTILINE)
len(found)
6439
On Jan 11, 8:44 am, Iain King iaink...@gmail.com wrote:
On Jan 11, 3:35 pm, Jeremy jlcon...@gmail.com wrote:
Hello all,
I am using re.split to separate some text into logical structures.
The trouble is that re.split doesn't find everything while re.findall
does; i.e.:
found =
try
---
#!/usr/bin/env python
from types import ListType, IntType
def array_expander( ar=None, ex=None ):
if type( ex ) != IntType:
return []
if ex = 0:
return []
if type( ar ) != ListType:
return []
# working code starts
I'm trying to make use of a Python library, aemreceive, that provides a
procedural API. (aemreceive is a library for Python on the Mac that
allows the application to receive and respond to Apple Events.)
My Python apps basically run in a single fooApp class, and everything
runs inside the
On 11 Jan, 15:35, Jeremy jlcon...@gmail.com wrote:
Hello all,
I am using re.split to separate some text into logical structures.
The trouble is that re.split doesn't find everything while re.findall
does; i.e.:
found = re.findall('^ 1', line, re.MULTILINE)
len(found)
6439
tables
Jeremy wrote:
On Jan 11, 8:44 am, Iain King iaink...@gmail.com wrote:
On Jan 11, 3:35 pm, Jeremy jlcon...@gmail.com wrote:
Hello all,
I am using re.split to separate some text into logical structures.
The trouble is that re.split doesn't find everything while re.findall
does; i.e.:
found
On 11 Jan, 15:54, Kevin Walzer k...@codebykevin.com wrote:
I'm trying to make use of a Python library, aemreceive, that provides a
procedural API. (aemreceive is a library for Python on the Mac that
allows the application to receive and respond to Apple Events.)
My Python apps basically run
Anybody have any experience with creating a basic POS register system
in Python? Any existing projects out there you are aware of? This
would be a GUI app, standalone with some basic export and print
functions. I see this as a great opportunity to deepen my Python
experience but dont want to
Jeremy wrote:
On Jan 11, 8:44 am, Iain King iaink...@gmail.com wrote:
On Jan 11, 3:35 pm, Jeremy jlcon...@gmail.com wrote:
Hello all,
I am using re.split to separate some text into logical structures.
The trouble is that re.split doesn't find everything while re.findall
does;
MRAB pyt...@mrabarnett.plus.com wrote:
Yep. Thanks for pointing that out. I guess I just assumed that
re.split was similar to re.search/match/findall in what it accepted as
function parameters. I guess I'll have to use a \n instead of a ^ for
split.
You could use the .split method of a
On 2010-01-09 03:52 AM, Anthra Norell wrote:
Daniel Fetchinson wrote:
I have a plain text file which I would like to protect in a very
simple minded, yet for my purposes sufficient, way. I'd like to
encrypt/convert it into a binary file in such a way that possession of
a password allows
Austyn wrote:
Here's an improvement in case you want your code to work outside of
Arizona:
from time import time, timezone
h = ((time() - timezone) / 3600) % 24
On Jan 10, 9:04 pm, Austyn aus...@gmail.com wrote:
How about:
import time
arizona_utc_offset = -7.00
h = (time.time() / 3600 +
Kevin Walzer a écrit :
I'm trying to make use of a Python library, aemreceive, that provides a
procedural API. (aemreceive is a library for Python on the Mac that
allows the application to receive and respond to Apple Events.)
My Python apps basically run in a single fooApp class, and
Hello everyone,
I have two lists of IP addresses:
hostips = [ 'a', 'b', 'c', 'd', 'e' ]
thread_results = [ 'd', 'b', 'c' ]
I need to sort thread_results in the same order as hostips.
(Obviously, hostips can contain any valid ip addresses as strings, they
are sorted alphabetically here just
mk wrote:
Incidentally, it *seems* that list comprehension preserves order:
hostips_limited = [ h for h in hostips if h in thread_results ]
Empirically speaking it seems to work (I tested it on real ips), but
please correct me if that's wrong.
Regards,
mk
Sounds good to me.
List are
mk wrote:
Hello everyone,
I have two lists of IP addresses:
hostips = [ 'a', 'b', 'c', 'd', 'e' ]
thread_results = [ 'd', 'b', 'c' ]
I need to sort thread_results in the same order as hostips.
P.S. One clarification: those lists are actually more complicated
(thread_result is a list of
mk mrk...@gmail.com writes:
Hello everyone,
I have two lists of IP addresses:
hostips = [ 'a', 'b', 'c', 'd', 'e' ]
thread_results = [ 'd', 'b', 'c' ]
I need to sort thread_results in the same order as hostips.
[...solution:]
hostips_limited = []
for h in hostips:
if h in
Numeric.log10() will check to see if the errno was set to ERANGE. It does not
check if a floating point exception flag was set, which is tricky to do
across
platforms. The newer numpy can do it because we've finally managed to
implement
all of that platform-specific code, but the
mk wrote:
mk wrote:
Hello everyone,
I have two lists of IP addresses:
hostips = [ 'a', 'b', 'c', 'd', 'e' ]
thread_results = [ 'd', 'b', 'c' ]
I need to sort thread_results in the same order as hostips.
P.S. One clarification: those lists are actually more complicated
(thread_result is a
When creating a function is there any difference between putting
everything under the def or not?
Here I created a function called CscoPortNum to convert the network
port number field in a Cisco syslog string from a an ascii name back
into its numeric form if required. Does it matter at all that
mk wrote:
mk wrote:
Hello everyone,
I have two lists of IP addresses:
hostips = [ 'a', 'b', 'c', 'd', 'e' ]
thread_results = [ 'd', 'b', 'c' ]
I need to sort thread_results in the same order as hostips.
P.S. One clarification: those lists are actually more complicated
On Sun, 10 Jan 2010 23:13:55 -0800, Dan Bishop wrote:
If you actually need to perform comparisons across types, you can rely
upon the fact that tuple comparisons are non-strict and use e.g.:
a = 5
b = '5'
(type(a).__name__, a) (type(b).__name__, b)
True
mk mrk...@gmail.com writes:
I have two lists of IP addresses:
hostips = [ 'a', 'b', 'c', 'd', 'e' ]
thread_results = [ 'd', 'b', 'c' ]
I need to sort thread_results in the same order as hostips.
Assuming each address in hostips appears just once:
from itertools import izip,count
d
On Mon, 11 Jan 2010 10:09:36 +0100, Martin v. Loewis wrote:
In Python 3.1 is there any difference in the buffering behavior of the
initial sys.stdout and sys.stderr streams?
No.
Were they different at some earlier point in Python's evolution?
That depends on the operating system. These
On 2010-01-11 12:27 PM, CELEN Erman wrote:
Numeric.log10() will check to see if the errno was set to ERANGE. It does not
check if a floating point exception flag was set, which is tricky to do across
platforms. The newer numpy can do it because we've finally managed to implement
all of that
Scott wrote:
When creating a function is there any difference between putting
everything under the def or not?
Here I created a function called CscoPortNum to convert the network
port number field in a Cisco syslog string from a an ascii name back
into its numeric form if required. Does it
On Mon, 11 Jan 2010 23:27:03 +0800, Steven Woody wrote:
I am using pyserial. But I always get the local echo after I write
some characters onto serial port and I find no way to disable this
behavior. When I say 'local echo', I mean the next read operation will
get characters that was just
Scott wrote:
When creating a function is there any difference between putting
everything under the def or not?
Here I created a function called CscoPortNum to convert the network
port number field in a Cisco syslog string from a an ascii name back
into its numeric form if required. Does it
Jeremy wrote:
On Jan 11, 8:44 am, Iain King iaink...@gmail.com wrote:
On Jan 11, 3:35 pm, Jeremy jlcon...@gmail.com wrote:
Hello all,
I am using re.split to separate some text into logical structures.
The trouble is that re.split doesn't find everything while re.findall
does; i.e.:
On Mon, 11 Jan 2010 18:57:24 +0100, mk wrote:
I have two lists of IP addresses:
hostips = [ 'a', 'b', 'c', 'd', 'e' ]
thread_results = [ 'd', 'b', 'c' ]
I need to sort thread_results in the same order as hostips.
P.S. One clarification: those lists are actually more complicated
Nobody nob...@nowhere.com writes:
On Sun, 10 Jan 2010 23:13:55 -0800, Dan Bishop wrote:
If you actually need to perform comparisons across types, you can rely
upon the fact that tuple comparisons are non-strict and use e.g.:
a = 5
b = '5'
(type(a).__name__, a)
I have an event log with 100s of thousands of entries with logs of the
form:
event eventTimestamp=2009-12-18T08:22:49.035
uniqueId=1261124569.35725_PFS_1_1340035961
result value=Blocked/
filters
filter code=338 type=Filter_Name
diagnostic
result
r0g wrote:
Scott wrote:
When creating a function is there any difference between putting
everything under the def or not?
Here I created a function called CscoPortNum to convert the network
port number field in a Cisco syslog string from a an ascii name back
into its numeric form if
On Jan 11, 9:28 am, Duncan Booth duncan.bo...@invalid.invalid wrote:
MRAB pyt...@mrabarnett.plus.com wrote:
Yep. Thanks for pointing that out. I guess I just assumed that
re.split was similar to re.search/match/findall in what it accepted as
function parameters. I guess I'll have to use
I just profiled one of my Python scripts and discovered that 99% of
the time was spent in
{built-in method sub}
What is this function and is there a way to optimize it?
Thanks,
Jeremy
--
http://mail.python.org/mailman/listinfo/python-list
amadain mfmdev...@gmail.com writes:
I have an event log with 100s of thousands of entries with logs of the
form:
event eventTimestamp=2009-12-18T08:22:49.035
uniqueId=1261124569.35725_PFS_1_1340035961
result value=Blocked/
filters
filter code=338 type=Filter_Name
MRAB wrote:
Scott wrote:
for prtnmS in open(portfpth):
prtnmS = prtnmS.rstrip()
There's nothing wrong with building dicts or other lookup tables outside
a function in order to avoid re-creating them every time the function is
called.
However, please consider writing complete,
In article mailman.757.1263177422.28905.python-l...@python.org, Terry Reedy
tjre...@udel.edu wrote:
On 1/8/2010 11:50 AM, tanix wrote:
Python Goldmine collection contains the extensive collection of articles
going back several years. It includes thousands of code
examples and expert
In article mailman.758.1263178849.28905.python-l...@python.org, Steve Holden
st...@holdenweb.com wrote:
Terry Reedy wrote:
On 1/8/2010 11:50 AM, tanix wrote:
Python Goldmine collection contains the extensive collection of articles
going back several years. It includes thousands of code
In article mailman.759.1263180916.28905.python-l...@python.org, Steve Holden
st...@holdenweb.com wrote:
Steve Holden wrote:
[...]
Because I habitually run the NoScript extension to Firefox the popups
didn't appear, but there didn't seem to be any original content on this
site. Google continues
On Jan 11, 11:20 am, Jeremy jlcon...@gmail.com wrote:
I just profiled one of my Python scripts and discovered that 99% of
the time was spent in
{built-in method sub}
What is this function and is there a way to optimize it?
I'm guessing this is re.sub (or, more likely, a method sub of an
Jeremy wrote:
I just profiled one of my Python scripts and discovered that 99% of
the time was spent in
{built-in method sub}
What is this function and is there a way to optimize it?
Thanks,
Jeremy
--
http://mail.python.org/mailman/listinfo/python-list
Jeremy wrote:
I just profiled one of my Python scripts and discovered that 99% of
the time was spent in
{built-in method sub}
What is this function and is there a way to optimize it?
I think it's the subtraction operator. The only way to optimise it is to
reduce the number of subtractions
On Jan 11, 2010, at 2:50 PM, Phlip wrote:
MRAB wrote:
Scott wrote:
for prtnmS in open(portfpth):
prtnmS = prtnmS.rstrip()
There's nothing wrong with building dicts or other lookup tables
outside
a function in order to avoid re-creating them every time the
function is
called.
On Jan 11, 12:54 pm, Carl Banks pavlovevide...@gmail.com wrote:
On Jan 11, 11:20 am, Jeremy jlcon...@gmail.com wrote:
I just profiled one of my Python scripts and discovered that 99% of
the time was spent in
{built-in method sub}
What is this function and is there a way to optimize it?
On 2010-01-11, Steven Woody narkewo...@gmail.com wrote:
I am using pyserial. But I always get the local echo after I
write some characters onto serial port
I really doubt you're getting a local echo. Is the data coming
out the serial port? Do you get the echo if you disconnect the
serial
Robert Kern wrote:
On 2010-01-09 03:52 AM, Anthra Norell wrote:
Daniel Fetchinson wrote:
I have a plain text file which I would like to protect in a very
simple minded, yet for my purposes sufficient, way. I'd like to
encrypt/convert it into a binary file in such a way that
possession of
On Jan 11, 7:26 pm, John Bokma j...@castleamber.com wrote:
amadain mfmdev...@gmail.com writes:
I have an event log with 100s of thousands of entries with logs of the
form:
event eventTimestamp=2009-12-18T08:22:49.035
uniqueId=1261124569.35725_PFS_1_1340035961
result value=Blocked/
Jeremy schrieb:
On Jan 11, 12:54 pm, Carl Banks pavlovevide...@gmail.com wrote:
On Jan 11, 11:20 am, Jeremy jlcon...@gmail.com wrote:
I just profiled one of my Python scripts and discovered that 99% of
the time was spent in
{built-in method sub}
What is this function and is there a way to
On Jan 9, 9:51 pm, Alf P. Steinbach al...@start.no wrote:
* Lie Ryan:
On 1/9/2010 8:43 AM, suresh.amritapuri wrote:
Hi,
In PIL, how to display multiple images in say m rows and n colums when
I have m*n images.
suresh
Tkinter has PhotoImage widget and PIL has support for this
On Mon, Jan 11, 2010 at 12:02 PM, Jeremy jlcon...@gmail.com wrote:
Your guess is correct. I had forgotten that I was using that
function.
I am using the re.sub command to remove trailing whitespace from lines
in a text file. The commands I use are copied below. If you have any
On Jan 11, 1:15 pm, Diez B. Roggisch de...@nospam.web.de wrote:
Jeremy schrieb:
On Jan 11, 12:54 pm, Carl Banks pavlovevide...@gmail.com wrote:
On Jan 11, 11:20 am, Jeremy jlcon...@gmail.com wrote:
I just profiled one of my Python scripts and discovered that 99% of
the time was
Anthra Norell anthra.nor...@bluewin.ch writes:
Why EVER make anything yourself when you can buy it?
http://en.wikipedia.org/wiki/Dunning-Kruger_effect
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, 11 Jan 2010 11:20:34 -0800, Jeremy wrote:
I just profiled one of my Python scripts
Well done! I'm not being sarcastic, or condescending, but you'd be AMAZED
(or possibly not...) at how many people try to optimize their scripts
*without* profiling, and end up trying to speed up parts
Hey everyone!
I am a new python programmer. I am trying to get the general file
functionality with options of save and save as working. These save
functions save a folder with multiple files. Upon using the os.system
copy function- if my destination directory has files with similar
names- i am
On Mon, Jan 11, 2010 at 15:02, Jeremy jlcon...@gmail.com wrote:
I am using the re.sub command to remove trailing whitespace from lines
in a text file. The commands I use are copied below. If you have any
suggestions on how they could be improved, I would love to know.
Just curious, but if
On 1/11/2010 3:02 PM, Jeremy wrote:
I am using the re.sub command to remove trailing whitespace from lines
in a text file.
help(str.rstrip)
Help on method_descriptor:
rstrip(...)
S.rstrip([chars]) - str
Return a copy of the string S with trailing whitespace removed.
If chars is
On Jan 11, 1:50 pm, Phlip phlip2...@gmail.com wrote:
MRAB wrote:
Scott wrote:
for prtnmS in open(portfpth):
prtnmS = prtnmS.rstrip()
There's nothing wrong with building dicts or other lookup tables outside
a function in order to avoid re-creating them every time the function is
On Mon, 11 Jan 2010 18:57:09 +, MRAB wrote:
There's nothing wrong with building dicts or other lookup tables outside
a function in order to avoid re-creating them every time the function is
called.
Actually there is, but the benefit (avoiding the re-creation of the
table) may be worth
There's nothing wrong with building dicts or other lookup tables outside
a function in order to avoid re-creating them every time the function is
called.
Brilliant! I didn't think of that. I guess I accidentally did it right
this time as I query that dictionary quite a few times from the
On Jan 11, 2010, at 3:30 PM, Jeremy wrote:
On Jan 11, 1:15 pm, Diez B. Roggisch de...@nospam.web.de wrote:
Jeremy schrieb:
On Jan 11, 12:54 pm, Carl Banks pavlovevide...@gmail.com wrote:
On Jan 11, 11:20 am, Jeremy jlcon...@gmail.com wrote:
I just profiled one of my Python scripts and
On 2010-01-11, Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
[regarding profiling results]
I think you'll find that Python's regex engine is pretty much
optimised as well as it can be, short of a major re-write. But
to quote Jamie Zawinski:
Some people, when confronted
How do you access the command line from the
python interpreter?
on unix:
type python
print 'hey'
'hey'
# I want to access the shell here, how do i do that?
--
http://mail.python.org/mailman/listinfo/python-list
Philip Semanchuk schrieb:
On Jan 11, 2010, at 3:30 PM, Jeremy wrote:
On Jan 11, 1:15 pm, Diez B. Roggisch de...@nospam.web.de wrote:
Jeremy schrieb:
On Jan 11, 12:54 pm, Carl Banks pavlovevide...@gmail.com wrote:
On Jan 11, 11:20 am, Jeremy jlcon...@gmail.com wrote:
I just profiled one
amadain mfmdev...@gmail.com writes:
On Jan 11, 7:26 pm, John Bokma j...@castleamber.com wrote:
amadain mfmdev...@gmail.com writes:
event eventTimestamp=2009-12-18T08:22:49.035
uniqueId=1261124569.35725_PFS_1_1340035961
result value=Blocked/
filters
filter code=338
On 1/11/2010 2:50 PM, tanix wrote:
In articlemailman.757.1263177422.28905.python-l...@python.org, Terry
Reedytjre...@udel.edu wrote:
This site pops up spam windowns. One was blocked, one managed to bypass
the popup blocker. Tnis is not friendly behaviour.
I am sorry. But this is a known
(I also noticed that this behavior is same under standard NumPy 1.4
with standard Python 2.6 on Windows. If you call numpy.log10(0.0) you
will get an -inf and no exceptions will be raised. Which is not the
case with Python's standard math.log10(0.0) which will raise a
ValueError)
1 - 100 of 200 matches
Mail list logo