psaff...@googlemail.com wrote:
I'm filing 160 million data points into a set of bins based on their
position. At the moment, this takes just over an hour using interval
trees. I would like to parallelise this to take advantage of my quad
core machine. I have some experience of Parallel Python, bu
John Posner wrote:
[snip]
field_widths = [14, 6, 18, 21, 21, 4, 6]
out = open("/home/chatdi/ouptut.csv", 'w')
for line in open("/home/chatdi/input.csv", "r"):
fields = line.rstrip().split('|')
padded_fields = [field.ljust(width) for field, width in zip(fields,
field_widths)]
out.
On Wed, 18 Mar 2009 21:30:59 -0700, gaeasiankom wrote:
> What actually I'm try to do is :
>
> I'm having a Login page which developed in HTML. When I click on the
> "Login" button I want the page to validate (at datastore of google app)
> using python and redirect to other HTML page. As what I un
I have a large set of documents in various text formats. I know that
each document contains its authors name, email and phone number.
Sometimes it also contains the authors home address.
The task is to find out the name, email and phone of as many documents
as possible. Since the documents are not
Dotan Cohen wrote:
>> There are about 40 people supporting the Mars Lander mission using
>> Python and aiming for a launch window this September. Wish them luck!
>>
>
> What, exactly, are they using Python for?
>
Mostly for testing, I understand, but during their training I was the
Python guy amo
"Emanuele D'Arrigo" wrote:
> Thank you everybody for the informative replies.
>
> I'll have to comb my code for all the instances of "item in sequence"
> statement because I suspect some of them are as unsafe as my first
> example. Oh well. One more lesson learned.
You may have far fewer unsafe
BJörn Lindqvist wrote:
I have a large set of documents in various text formats. I know that
each document contains its authors name, email and phone number.
Sometimes it also contains the authors home address.
The task is to find out the name, email and phone of as many documents
as possible. Si
Ted> Thanks. Is there any way to make this work before actually reading
Ted> in a row of data? In version 2.5, I need to first do a rdr.next()
Ted> before rdr.fieldnames gives me anything.
If you know the csv file contains column headers this should work:
f = open("f.csv", "rb"
aiwarrior wrote:
> On Mar 13, 9:31 pm, Albert Hopkins wrote:
>> On Fri, 2009-03-13 at 21:04 +, tinn...@isbd.co.uk wrote:
>>> What's the neatest way to do the following in case insensitive fashion:-
>>> if stringA in stringB:
>>> bla bla bla
>>> I know I can just do:-
>>> if str
On Mar 19, 1:25 pm, Paul Hildebrandt
wrote:
> On Mar 19, 9:41 am, Kottiyath wrote:
>
>
>
> > On Mar 19, 9:33 pm, Kottiyath wrote:
>
> > > On Mar 19, 8:42 pm, Paul McGuire wrote:
>
> > > > On Mar 19, 4:39 am, Kottiyath wrote:
>
> > > > > I understand that my question was foolish, even for a new
[posted and e-mailed]
In article ,
Minesh Patel wrote:
>
>Can you suggest any Python libraries for true parallelism or should I
>just stick with Python Threads or asyncore
Python threads are mostly only parallel for I/O (you have to write
special C code to release the GIL). If you want paralle
>
> if stringA.lower() in stringB.lower():
> bla bla bla
>
from string import lower
if lower(stringA) in lower(stringB):
# was this what you were after?
Cheers,
Jervis
--
http://mail.python.org/mailman/listinfo/python-list
jefm wrote:
> We are looking to use Python on an embedded Linux ARM system.
> What I gather from googling the subject is that it is not that
> straight forward (a fair amount of patching & hacking).
> Nobody out there that has done it claims it is easy, which makes me
> worried.
>
> I haven
>> > I understand that my question was foolish, even for a newbie.
>> > I will not ask any more such questions in the future.
>>
>> Gaaah! Your question was just fine, a good question on coding style.
>> I wish more people would ask such questions so that bad habits could
>> be avoided.
>>
>> The n
On Mar 19, 11:54 am, jefm wrote:
> Hi,
> We are looking to use Python on an embedded Linux ARM system.
> What I gather from googling the subject is that it is not that
> straight forward (a fair amount of patching & hacking).
> Nobody out there that has done it claims it is easy, which makes me
>
I was wondering if anyone had documents or articles what gave an in-
depth view of the object system in Python. Ones concerning dispatch,
how self really works, and maybe some meta-programming that comes
along with the new style classes.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 2009-03-20 at 07:25 +1100, Jervis Whitley wrote:
> >
> >if stringA.lower() in stringB.lower():
> >bla bla bla
> >
>
> from string import lower
>
> if lower(stringA) in lower(stringB):
> # was this what you were after?
>
This is analogous to standing behind a
Here's a new, fun recipe for you guys:
http://code.activestate.com/recipes/576694/
Enjoy,
Raymond
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Mar 20, 2009 at 8:28 AM, Albert Hopkins wrote:
> On Fri, 2009-03-20 at 07:25 +1100, Jervis Whitley wrote:
>> >
>> > if stringA.lower() in stringB.lower():
>> > bla bla bla
>> >
>>
>> from string import lower
>>
>> if lower(stringA) in lower(stringB):
>> # was thi
Hi,
Executing the example below doesn't produce the expected behavior, but
using the commented code does. Is this normal, or is it a problem with
Python? I've tested it with version 2.6.1 on Windows XP.
Thanks,
--
from abc import *
from types import *
import re
class Base (ObjectType):
__m
I need to import cdr files to python and just make some calculations
(surface size of some objects, perimeters..)
Don't need to show them or manipulate with them...
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 2009-03-20 at 08:52 +1100, Jervis Whitley wrote:
> On Fri, Mar 20, 2009 at 8:28 AM, Albert Hopkins
> wrote:
> > On Fri, 2009-03-20 at 07:25 +1100, Jervis Whitley wrote:
> >> >
> >> >if stringA.lower() in stringB.lower():
> >> >bla bla bla
> >> >
> >>
> >> from string impor
John Mendelewski gmail.com> writes:
>
> I was wondering if anyone had documents or articles what gave an in-
> depth view of the object system in Python. Ones concerning dispatch,
> how self really works, and maybe some meta-programming that comes
> along with the new style classes.
What do you
Hi people.
I've got a small piece of code that I don't understand. Basically, a
variable inside an if statement inside a for loop doesn't seem to be
updating. Is this a scope issue ?
Thanks
Code segment:
# run through the cycle and calculate the temperature and pressure at
each position,
Márcio Faustino gmail.com> writes:
>
> Hi,
>
> Executing the example below doesn't produce the expected behavior, but
> using the commented code does. Is this normal, or is it a problem with
> Python? I've tested it with version 2.6.1 on Windows XP.
>
> Thanks,
>
> --
>
> from abc import *
>
> newCylinderTempertature = newCylinderTemperature + deltaTemp
Take a careful look at the variable name here: "Tempertature". Python's
dynamic nature provides a lot of wonderful benefits, but you've just hit
one of the drawbacks - you don't get any protection from typos in
variable names.
Linuxguy123 gmail.com> writes:
>
>
> Hi people.
>
> I've got a small piece of code that I don't understand. Basically, a
> variable inside an if statement inside a for loop doesn't seem to be
> updating. Is this a scope issue ?
No, it's because you mispelled the variables.
--
http://ma
On Mar 19, 10:35 am, Jean-Paul Calderone wrote:
> On Thu, 19 Mar 2009 09:50:51 -0700, Ryan Rosario
> wrote:
> >I have a parser that needs to process 7 million files. After running
> >for 2 days, it had only processed 1.5 million. I want this script to
> >parse several files at once by using mult
In article ,
Linuxguy123 wrote:
>
>I've got a small piece of code that I don't understand. Basically, a
>variable inside an if statement inside a for loop doesn't seem to be
>updating. Is this a scope issue ?
Nope, it's a spelling issue. I suggest you change your code to a more
readable:
new
On Thu, 19 Mar 2009 14:40:55 -, Gary Wood wrote:
#i adjusted the main function helps me see the code as the program runs
Put it back the way it was (you've broken it rather thoroughly there),
and put the debug "print" calls in printLocations where they stand some
chance of showing you wha
I have a fairly simple bit of code, something like:
# This should be importing the subclasses somehow, so that the factory
# can make them.
# import Parser.One
# import Parser.Two
# or.. from Parser import *?
class Parser():
def parse:
'Implemented only in subclass'
def make_parser
Aahz wrote:
> In article <49b58b35$0$3548$426a7...@news.free.fr>,
> Bruno Desthuilliers wrote:
>> Tomasz Rola a écrit :
>>>
>>> I may not be objective (tried Java, hated it after 6 years).
>>
>> Arf - only took me 6 months !-)
>
> That long? It only took me six minutes.
I was young and fool
>
> I agree that it's an alternative. There are a number of alternatives.
> However the OP was asking for a "neater/easier" alternative. I argue
> that introducing an external module/function to do the exact same thing
> as a built-in type's method doesn't exactly qualify as a "neater/easier"
> alt
In article <9a5d59e1-2798-4864-a938-9b39792c5...@s9g2000prg.googlegroups.com>,
Raymond Hettinger wrote:
>
>Here's a new, fun recipe for you guys:
>
>http://code.activestate.com/recipes/576694/
That is *sick* and perverted.
--
Aahz (a...@pythoncraft.com) <*> http://www.pythoncr
> Thank you for your response. I did not realize that. That seems like a
> huge limitation for such a great language.
> I will look into forking off processes instead of using threads.
If that's what you need to do, yes it is. If it isn't, no it's not. No
language is optimum for all possible appli
On Mar 19, 6:19 pm, Benjamin Peterson wrote:
> John Mendelewski gmail.com> writes:
>
>
>
> > I was wondering if anyone had documents or articles what gave an in-
> > depth view of the object system in Python. Ones concerning dispatch,
> > how self really works, and maybe some meta-programming tha
Hi:
I wrote a Python program which, during execution, shows me messages on
console indicating at every moment the time and steps being performed
so I can have a 'log online' and guess remaining time for termination,
I used many 'print' instructions to show those messages, i.e. print
"I am in step
On Mar 19, 7:00 pm, Vizcayno wrote:
> Hi:
> I wrote a Python program which, during execution, shows me messages on
> console indicating at every moment the time and steps being performed
> so I can have a 'log online' and guess remaining time for termination,
> I used many 'print' instructions to
Vizcayno wrote:
Hi:
I wrote a Python program which, during execution, shows me messages on
console indicating at every moment the time and steps being performed
so I can have a 'log online' and guess remaining time for termination,
I used many 'print' instructions to show those messages, i.e. pr
John Mendelewski gmail.com> writes:
>
> What goes on behind the scenes to make a.do() evaluate the do
> method with a bound to self in that method? Is this implemented
> in C, Python? I think I have a grasp of how to use objects, but
> I was wondering about the implementation I suppose.
This is
On Thu, Mar 19, 2009 at 6:52 PM, Austin Schutz wrote:
>
> I have a fairly simple bit of code, something like:
>
> # This should be importing the subclasses somehow, so that the factory
> # can make them.
> # import Parser.One
> # import Parser.Two
> # or.. from Parser import *?
> class Parser():
On Mar 18, 7:25 pm, Carl wrote:
> On Mar 18, 1:56 pm, a...@pythoncraft.com (Aahz) wrote:
>
>
>
> > In article ,
> > R. David Murray wrote:
>
> > >That said, I've heard mention here of something that can apparently be
> > >used for this. I think it was some incarnation of Webkit. I remember
> >
Austin Schutz wrote:
>
> I have a fairly simple bit of code, something like:
>
> # This should be importing the subclasses somehow, so that the factory
> # can make them.
> # import Parser.One
> # import Parser.Two
> # or.. from Parser import *?
> class Parser():
>def parse:
> 'Impleme
On Mar 19, 11:39 am, I V wrote:
> On Wed, 18 Mar 2009 21:30:59 -0700, gaeasiankom wrote:
> > What actually I'm try to do is :
>
> > I'm having a Login page which developed in HTML. When I click on the
> > "Login" button I want the page to validate (at datastore of google app)
> > using python and
I'm on linux actually. I found that so long as I implement
__reduce__, then pickling works, and my extension works with Queue
objects correctly. So far the C Api is really cool. I can do all the
math stuff where I need the speed, and still be able to use python
which is way more expressive.
tra
Hi,
I'm new to writing Python code. This is a simple client I wrote, it
works, but I feel it doesn't look as clean as it could. Can anyone
make suggestions how to streamline this code?
Also, I am using two nested functions, it seems that nested functions
aren't used that much in Python - is that
On Mar 20, 1:42 am, "Emanuele D'Arrigo" wrote:
> I just had a bit of a shiver for something I'm doing often in my code
> but that might be based on a wrong assumption on my part. Take the
> following code:
>
> pattern = "aPattern"
>
> compiledPatterns = [ ]
> compiledPatterns.append(re.compile(pat
Just a follow-up:
I've just uploaded a version of Easygui that works with Python 2.x and
3.x.
http://easygui.sourceforge.net/current_version/index.html
I blog a bit about it at
http://pythonconquerstheuniverse.blogspot.com/2009/03/moving-to-python-30-part3.html
--
http://mail.python.org/mailman/l
On Mar 19, 10:18 pm, John Mendelewski
wrote:
> I was wondering if anyone had documents or articles what gave an in-
> depth view of the object system in Python. Ones concerning dispatch,
> how self really works, and maybe some meta-programming that comes
> along with the new style classes.
The se
En Fri, 20 Mar 2009 00:16:29 -0200, Travis Miller
escribió:
So far the C Api is really cool. I can do all the
math stuff where I need the speed, and still be able to use python
which is way more expressive.
Sure! One gets the best of both worlds that way.
--
Gabriel Genellina
--
http://m
Hello everyone,
I have started using multiprocessing module, which is now available
with Python 2.6.
It definitely opens up new possibilities.
Now, I developed a small GUI package, which is to be used from other
programs.
It uses multiprocessing and Pipes are used to pump image data/command
to th
CJ Kucera wrote:
> Okay, I've got a reproducible testcase of this available up here:
> http://apocalyptech.com/pygtk-zlib/
Hello, two brief notes here:
1) Someone on the PyGTK list mentioned that I should really be using
StringIO instead of my own hacky attempt at one, in there, and of course
he
John Mendelewski wrote:
I was wondering if anyone had documents or articles what gave an in-
depth view of the object system in Python.
http://effbot.org/zone/python-objects.htm
--
http://mail.python.org/mailman/listinfo/python-list
Esmail wrote:
Hi,
I'm new to writing Python code. This is a simple client I wrote, it
works, but I feel it doesn't look as clean as it could. Can anyone
make suggestions how to streamline this code?
Also, I am using two nested functions, it seems that nested functions
aren't used that much in P
On Mar 20, 4:21 am, Tim Rowe wrote:
> > Thank you for your response. I did not realize that. That seems like a
> > huge limitation for such a great language.
> > I will look into forking off processes instead of using threads.
>
> If that's what you need to do, yes it is. If it isn't, no it's not.
> Any idea on why this is happening?
Can you provide a complete example? Your code looks correct, and should
just work.
How do you know the result contains only 't' (i.e. how do you know it
does not contain 'e', 's', 't')?
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
> I saw in a different post that psycopg2 does work on Python 3.x as
> long as a patch is applied (by Martin v. Löwis):
>
[...]
> Do you know where can I find this patch
It's linked in
http://wiki.python.org/moin/Early2to3Migrations
and lives in
http://www.dcl.hpi.uni-potsdam.de/home/loewis/ps
Hi,
>>> snapdir = './mango.txt_snaps'
>>> snap_cnt = 1
>>> block = 0
>>> import os
>>> os.chdir('/mnt/gfs_local')
>>> snap = open(snapdir + '/snap%s/%s' % (repr(snap_cnt), repr(block)),'r')
>>> snap.read()
'dfdfdgagdfgdf\ngdgfadgagadg\nagafg\n\nfs\nf\nsadf\n\nsdfsdfsadf\n'
>>> snapdir + '/snap%s/%
101 - 158 of 158 matches
Mail list logo