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/%
> 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
> 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
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.
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
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
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
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
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
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
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 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
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
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
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
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 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
> >
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():
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
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
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
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, 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
> 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
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
>
> 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
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 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
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
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 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
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
> 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.
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 *
>
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,
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
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
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
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
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
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, 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
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 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 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
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
>
> 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
[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
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
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
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"
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
"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
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
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
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
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.
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
Jim Garrison wrote:
Use case: parsing a simple config file line where lines start with a
keyword and have optional arguments. I want to extract the keyword and
then pass the rest of the line to a function to process it. An obvious
use of split(None,1)
cmd,args= = line.split(None,1);
if
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
worried.
Yes unfortunately its
[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.write
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, but PP seems
to only really work fo
Caveat: none of the solutions (including mine) deal with the case of
the field being longer than the width. You might want to throw an
exception.
Alternatively, you can just crop the results. Tweaking MRAB's
elegant solution:
field_widths = [14, 6, 18, 21, 21, 4, 6]
infile = open("input.
Albert Hopkins wrote:
On Thu, 2009-03-19 at 11:57 -0500, Jim Garrison wrote:
Use case: parsing a simple config file line where lines start with a
keyword and have optional arguments. I want to extract the keyword and
then pass the rest of the line to a function to process it. An obvious
use of
> Could you perhaps be persuaded to post in ASCII?
Sorry, Aahz, Gmail sends the mail as base64 encoded if there are
non-ascii characters. This is the first problem that I've encountered
with this, what mailer are you using?
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
--
http:/
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 multiple threads: one for each
file currently being analyzed.
T
Terry Reedy wrote:
digz wrote:
Hi,
I am trying to convert a | delimited file to fixed width by right
padding with spaces, Here is how I have written the program , just get
the feeling this can be done in a much better ( python functional )
way rather than the procedural code i have below . Any
[posted and e-mailed]
In article ,
Dotan Cohen wrote:
>
>PiBUaGVyZSBhcmUgYWJvdXQgNDAgcGVvcGxlIHN1cHBvcnRpbmcgdGhlIE1hcnMgTGFuZGVyIG1p
>c3Npb24gdXNpbmcKPiBQeXRob24gYW5kIGFpbWluZyBmb3IgYSBsYXVuY2ggd2luZG93IHRoaXMg
>U2VwdGVtYmVyLiBXaXNoIHRoZW0gbHVjayEKPgoKV2hhdCwgZXhhY3RseSwgYXJlIHRoZXkgdXNp
>bmcgU
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 newbie.
> > > > I will not ask any more such questions in th
> 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?
--
Dotan Cohen
http://what-is-what.com
http://gibberish.co.il
א-ב-ג-ד-ה-ו-ז-ח-ט-י-ך-כ-ל-ם-מ-ן-נ-ס-ע-ף-פ-ץ-צ-ק
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.
Thank you again.
Manu
--
http://mail.python.org/mailman/listinfo/py
s...@pobox.com wrote:
> >> In fact, graphics were added for several organizations. I believe
> >> they will be chosen randomly. NASA is still there.
>
> MiO> In that case, they must be using the random number generator from
> MiO> Dilbert. You know, the one that said 9, 9, 9, 9,.
In the end, I used a cStringIO object to store the chromosomes -
because there are only 23, I can use one character for each chromosome
and represent the whole lot with a giant string and a dictionary to
say what each character means. Then I used numpy arrays for the data
and coordinates. This sque
CJ Kucera wrote:
> Anyway, the issue turned out to be zlib.decompress() - for larger sets
> of data, if I wasn't specifying "bufsize," the malloc()s that it was
> doing behind-the-scenes must have been clobbering memory. As soon as I
> specified bufsize, everything was totally kosher.
Okay, I've
On Thu, 2009-03-19 at 11:57 -0500, Jim Garrison wrote:
> Use case: parsing a simple config file line where lines start with a
> keyword and have optional arguments. I want to extract the keyword and
> then pass the rest of the line to a function to process it. An obvious
> use of split(None,1)
>
r wrote:
> On Mar 12, 3:31 am, Michele Simionato
> wrote:
>
>> That's pretty much impossible. I am sure NASA uses all programming
>> languages in existence,
>> plus probably many internal ones we never heard of.
>
> True but...
>
all([NASA.does_endorse(lang) for lang in NASA['languages']])
mattia wrote:
Hi all, I need to receive in input a date represented by a string in the
form "/mm/dd" (or reversed), then I need to assure that the date is
= the current date and then split the dates in variables like year,
month, day. Is there some module to do this quickly?
Look into tim
On Mar 19, 9:50 am, 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 multiple threads: one for each
> file currently being analyzed.
>
> My code i
Use case: parsing a simple config file line where lines start with a
keyword and have optional arguments. I want to extract the keyword and
then pass the rest of the line to a function to process it. An obvious
use of split(None,1)
cmd,args= = line.split(None,1);
if cmd in self.switch: s
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
worried.
I haven't seen a description on port
On Mar 19, 8:51 am, digz wrote:
> Hi,
> I am trying to convert a | delimited file to fixed width by right
> padding with spaces, Here is how I have written the program , just get
> the feeling this can be done in a much better ( python functional )
> way rather than the procedural code i have bel
digz wrote:
Hi,
I am trying to convert a | delimited file to fixed width by right
padding with spaces, Here is how I have written the program , just get
the feeling this can be done in a much better ( python functional )
way rather than the procedural code i have below . Any help
appreciated
#!
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 multiple threads: one for each
file currently being analyzed.
My code iterates through all of the directories within a dire
>> Hi all, I need to receive in input a date represented by a string in
>> the form "/mm/dd" (or reversed), then I need to assure that the
>> date is = the current date and then split the dates in variables like
>> year, month, day. Is there some module to do this quickly?
The
Ted> Is it possible to grab the fieldnames that the csv DictReader
Ted> module automatically reads from the first line of the input file?
Like this, perhaps?
>>> rdr = csv.DictReader(open("f.csv", "rb"))
>>> rdr.fieldnames
['col1', 'col2', 'color']
>>> rdr.next()
{'co
Emanuele D'Arrigo wrote:
Hi everybody,
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(pattern))
if(re.compil
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 newbie.
> > > I will not ask any more such questions in the future.
>
> > Gaaah! Your question was just fine
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 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 p
Hi all, I need to receive in input a date represented by a string in the
form "/mm/dd" (or reversed), then I need to assure that the date is
>= the current date and then split the dates in variables like year,
month, day. Is there some module to do this quickly?
--
http://mail.python.org/mail
Here is the latest version of the code:
currentdata_file = r"C:\Users\Owner\Desktop\newdata.txt" # the latest
download from the clock
lastdata_file = r"C:\Users\Owner\Desktop\mydata.txt" # the prior
download from the clock
output_file = r"C:\Users\Owner\Desktop\out.txt" # will hold delta
clock dat
Terry Reedy wrote:
Anthra Norell wrote:
Would anyone who knows the inner workings volunteer to clarify whether
or not every additional derivation of a class hierarchy adds an
indirection to the base class's method calls and attribute read-writes.
More potential search layers rather than poin
digz wrote:
Hi,
I am trying to convert a | delimited file to fixed width by right
padding with spaces, Here is how I have written the program , just get
the feeling this can be done in a much better ( python functional )
way rather than the procedural code i have below . Any help
appreciated
#!
On Thu, 2009-03-19 at 08:42 -0700, Emanuele D'Arrigo wrote:
> Hi everybody,
>
> 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 = [ ]
> compi
Emanuele D'Arrigo wrote:
[snip]
If the answer is no, am I right to state the in the case portrayed
above the only way to be safe is to use the following code instead?
for item in compiledPatterns:
if(item.pattern == pattern):
print("The compiled pattern is stored.")
break
Co
Emanuele D'Arrigo wrote:
Hi everybody,
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(pattern))
if(re.compil
Hi,
I am trying to convert a | delimited file to fixed width by right
padding with spaces, Here is how I have written the program , just get
the feeling this can be done in a much better ( python functional )
way rather than the procedural code i have below . Any help
appreciated
#!/usr/bin/pytho
Sorry for the double-post, the first one was sent by mistake before
completion.
Hi everybody,
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 = [ ]
comp
Hi everybody,
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(pattern))
if(re.compile(pattern) in compiledPatte
On Mar 19, 4:39 am, Kottiyath wrote:
>
> 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 coul
Luis Zarrabeitia wrote:
What's the preferred style to document code in python? ...
def somefunction(arg1, arg2, out = sys.stdout):
""" This function does blahblablha with the string arg1, using
the tuple of ints arg2 as the control sequence, and prints the
result to out (defaults to
1 - 100 of 158 matches
Mail list logo