On Jan 10, 1:26 pm, Hellmut Weber 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", "copyright"
* Paul Rudin:
Sebastian 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 functionality-wise.
If one isn't ob
On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote:
> * Paul Rudin:
>> Sebastian 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
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 unicode_lite
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 w
* Steven D'Aprano:
On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote:
* Paul Rudin:
Sebastian 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 nee
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 wrote:
> * Steven D'Aprano:
>>
>> On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote:
>>
>>> * Paul Rudin:
Sebastian writes:
> I have an array x=[1,2,3]
In python such an object is called a "list".
(
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, schr
geremy condra 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 point,
if (say) yo
* Chris Rebert:
On Mon, Jan 11, 2010 at 1:03 AM, Alf P. Steinbach wrote:
* Steven D'Aprano:
On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote:
* Paul Rudin:
Sebastian writes:
I have an array x=[1,2,3]
In python such an object is called a "list".
(In cpython it's implemented a
On Mon, Jan 11, 2010 at 2:20 AM, Alf P. Steinbach wrote:
> * Chris Rebert:
>> On Mon, Jan 11, 2010 at 1:03 AM, Alf P. Steinbach wrote:
>>> * Steven D'Aprano:
On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote:
> * Paul Rudin:
>> Sebastian writes:
> Using the term "array
> 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 l
* Chris Rebert:
On Mon, Jan 11, 2010 at 2:20 AM, Alf P. Steinbach wrote:
* Chris Rebert:
On Mon, Jan 11, 2010 at 1:03 AM, Alf P. Steinbach wrote:
* Steven D'Aprano:
On Mon, 11 Jan 2010 08:56:36 +0100, Alf P. Steinbach wrote:
* Paul Rudin:
Sebastian writes:
Using the term "array" accen
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 fracti
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 - whate
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 i
Aahz wrote:
In article ,
Jean-Michel Pichavant wrote:
class A:
def __init__(self, foo = None, bar = None):
if len(foo) > 5:
raise ValueError('foo cannot exceed 5 characters')
Bad Idea -- what happens when foo is None?
You're right.
That perfectly illustr
On Sun, Jan 10, 2010 at 3:09 PM, MRAB 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.
>
>
Oh, not the large halibut again! (I will be c
Victor Subervi wrote:
On Sat, Jan 9, 2010 at 11:56 AM, Gary Herron
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 may be a list or a
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
destinat
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.com>> wrote:
>>
>>Victor Subervi wrote:
>>
>>Hi;
>>I have a string.join statement on a
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 you
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.
--
http:/
Victor Subervi wrote:
On Sun, Jan 10, 2010 at 3:09 PM, MRAB 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.
Oh, not the large
On Mon, Jan 11, 2010 at 11:26 AM, Dave Angel wrote:
> Victor Subervi wrote:
>
>> On Sun, Jan 10, 2010 at 3:09 PM, MRAB wrote:
>>
>>
>>
>>> browser = form.getfirst('browser', 'all')
>>>
>>>
except:
browser = headers()
try:
>>> A bare except, and if an exception _do
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 (pyseri
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.
>
On Jan 11, 3:35 pm, Jeremy 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 =
On Jan 11, 8:44 am, Iain King wrote:
> On Jan 11, 3:35 pm, Jeremy 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', li
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 he
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 clas
On 11 Jan, 15:35, Jeremy 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 = re
Jeremy wrote:
On Jan 11, 8:44 am, Iain King wrote:
On Jan 11, 3:35 pm, Jeremy 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.MULTILI
On 11 Jan, 15:54, Kevin Walzer 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 in a single fooAp
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 rei
Jeremy wrote:
> On Jan 11, 8:44 am, Iain King wrote:
>> On Jan 11, 3:35 pm, Jeremy 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.:
>>
>> >
MRAB 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 pattern object i
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 allo
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 wrote:
How about:
import time
arizona_utc_offset = -7.00
h = (time.time() / 3600 + arizona_utc_offset) %
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 everythi
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 f
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 *o
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 tup
mk 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 thread_resul
> 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 e
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 com
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)
mk 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 = dict(iz
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 sys
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 platf
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 mat
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. D
Jeremy wrote:
> On Jan 11, 8:44 am, Iain King wrote:
>> On Jan 11, 3:35 pm, Jeremy 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.
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 co
Nobody 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__,
I have an event log with 100s of thousands of entries with logs of the
form:
I am using xml.sax to parse the event log. The trouble w
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 f
On Jan 11, 9:28 am, Duncan Booth wrote:
> MRAB 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
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 writes:
> I have an event log with 100s of thousands of entries with logs of the
> form:
>
> uniqueId="1261124569.35725_PFS_1_1340035961">
>
>
>
>
>
>
>
>
>
>
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, pronoun
In article , 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
>> examples and expert discussions on all major topics.
>>
>> The information is organized by
In article , Steve Holden
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
>>> examples and expert discussions on all major topics.
>>>
>>> The
In article , Steve Holden
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 to be your friend.
>>
>And dammit, why didn't I think to stri
On Jan 11, 11:20 am, 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'm guessing this is re.sub (or, more likely, a method sub of an
internal object
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 th
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.
Ho
On Jan 11, 12:54 pm, Carl Banks wrote:
> On Jan 11, 11:20 am, 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'm guessing this is re.s
On 2010-01-11, Steven Woody 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 cable?
> and I find
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
On Jan 11, 7:26 pm, John Bokma wrote:
> amadain writes:
> > I have an event log with 100s of thousands of entries with logs of the
> > form:
>
> > > uniqueId="1261124569.35725_PFS_1_1340035961">
> >
> >
> >
> >
> >
> >
> >
Jeremy schrieb:
On Jan 11, 12:54 pm, Carl Banks wrote:
On Jan 11, 11:20 am, 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'm guessing this is re.sub (or
On Jan 9, 9:51 pm, "Alf P. Steinbach" 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 th
On Mon, Jan 11, 2010 at 12:02 PM, Jeremy 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
> suggestions on how they
On Jan 11, 1:15 pm, "Diez B. Roggisch" wrote:
> Jeremy schrieb:
>
>
>
>
>
> > On Jan 11, 12:54 pm, Carl Banks wrote:
> >> On Jan 11, 11:20 am, Jeremy wrote:
>
> >>> I just profiled one of my Python scripts and discovered that >99% of
> >>> the time was spent in
> >>> {built-in method sub}
> >>>
Anthra Norell 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 ask
On Mon, Jan 11, 2010 at 15:02, Jeremy 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 each line is simpl
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
On Jan 11, 1: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 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
fun
On Jan 11, 2010, at 3:30 PM, Jeremy wrote:
On Jan 11, 1:15 pm, "Diez B. Roggisch" wrote:
Jeremy schrieb:
On Jan 11, 12:54 pm, Carl Banks wrote:
On Jan 11, 11:20 am, Jeremy wrote:
I just profiled one of my Python scripts and discovered that
>99% of
the time was spent in
{built-in met
On 2010-01-11, Steven D'Aprano 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 with a problem, think "I know,
>
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" wrote:
Jeremy schrieb:
On Jan 11, 12:54 pm, Carl Banks wrote:
On Jan 11, 11:20 am, Jeremy wrote:
I just profiled one of my Python scripts and discovered that >99% of
the time w
amadain writes:
> On Jan 11, 7:26 pm, John Bokma wrote:
>> amadain writes:
>> > > > uniqueId="1261124569.35725_PFS_1_1340035961">
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
>> >
On 1/11/2010 2:50 PM, tanix wrote:
In article, Terry
Reedy 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 issue.
This is one of counter vendors doing these popups.
They were c
>> (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
>> ValueErro
2010/1/11 Zabin :
> 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
1 - 100 of 143 matches
Mail list logo