parsing a file for analysis

2011-02-25 Thread Rita
I have a large text (4GB) which I am parsing. I am reading the file to collect stats on certain items. My approach has been simple, for row in open(file): if "INFO" in row: line=row.split() user=line[0] host=line[1] __time=line[2] ... I was wondering if there is a framewor

Re: subprocess pipe question

2011-02-25 Thread Rita
The results look right! I did a rather large test and the checksum passed. I will hold off any speed ups as you suggested. On Wed, Feb 23, 2011 at 8:37 PM, Rob Williscroft wrote: > Rita wrote in > news:AANLkTi=88dcpm_kqrs2g620obsnxz0majubfwpeme...@mail.gmail.com in > gmane.comp.python.general:

Re: py3k: datetime resolution / isoformat

2011-02-25 Thread Chris Rebert
On Fri, Feb 25, 2011 at 6:21 PM, wrote: > > When I do: > >    datetime.datetime.now().isoformat(' ') > > I get the time with the microseconds. The docs says: > "if microsecond is 0 -MM-DDTHH:MM:SS+HH:MM". > > How do I set microsecond to 0? > >     >>> datetime.datetime.microsecond = 0 >    Tr

Re: py3k: datetime resolution / isoformat

2011-02-25 Thread MRAB
On 26/02/2011 02:21, s...@uce.gov wrote: When I do: datetime.datetime.now().isoformat(' ') I get the time with the microseconds. The docs says: "if microsecond is 0 -MM-DDTHH:MM:SS+HH:MM". How do I set microsecond to 0? >>> datetime.datetime.microsecond = 0 Traceback (most recent call l

Re: py3k: datetime resolution / isoformat

2011-02-25 Thread Ned Deily
In article , s...@uce.gov wrote: > When I do: > > datetime.datetime.now().isoformat(' ') > > I get the time with the microseconds. The docs says: > "if microsecond is 0 -MM-DDTHH:MM:SS+HH:MM". > > How do I set microsecond to 0? >>> datetime.datetime.now().replace(microsecond=0).isoform

py3k: datetime resolution / isoformat

2011-02-25 Thread spam
When I do: datetime.datetime.now().isoformat(' ') I get the time with the microseconds. The docs says: "if microsecond is 0 -MM-DDTHH:MM:SS+HH:MM". How do I set microsecond to 0? >>> datetime.datetime.microsecond = 0 Traceback (most recent call last): File "", line 1, i

Re: Tkinter: The good, the bad, and the ugly!

2011-02-25 Thread Gregory Ewing
[Sorry to revive an old thread, but I was away when it occurred and I'd like to make a comment...] Kevin Walzer wrote: This library isn't much different from other Python GUI toolkits--it's dependent on underlying, rather large, platform-specific implementations--but it provides an even higher

ANN: Intro+Intermediate Python course, SF, May 24-26

2011-02-25 Thread wesley chun
Need to get up-to-speed with Python as quickly and as in-depth as possible? Already coding Python but still have areas of uncertainty you need to fill? Then come join me, Wesley Chun, author of Prentice-Hall's bestseller "Core Python" for a comprehensive intro/intermediate course coming up this May

Re: wxPython SQLite and Reportlab demo

2011-02-25 Thread Beppe
On 25 Feb, 08:33, Tim Roberts wrote: > Beppe wrote: > > >I would recommend this my little work on sourceforge. > > >http://sourceforge.net/projects/pyggybank/ > > >you can download an exe (pyggy_w32.7z)  make with py2exe > >and the source  (pyggy_source.7z) > >the project is named Pyggy Bank. > >

Re: getpass and IDEs

2011-02-25 Thread Andrew
On Fri, 25 Feb 2011 20:27:42 +0100, Wolfgang Rohdewald wrote: > On Freitag 25 Februar 2011, Andrew wrote: >> But I'm curious what's different >> about IDE environments that makes it impossible to suppress >> output on them, and if there's anything that might be done >> about this. > > I'd say yo

Re: Parsing numeric ranges

2011-02-25 Thread Suneel Kingrani
very well done.. But I thought it may require a little bit of change in the proposed code.. :) def _revision_list_with_ranges_to_list_without_ranges(revision_list): for revision in revision_list.split(','): if '-' in str(revision): from_revision, _, to_revisio

Re: Can you recommend an Experienced Python/SQL contract developer for this 6 - 12 month contract in NYC?

2011-02-25 Thread Daniel Mahoney
> Thanks, > > Ben Diamond > The Forum Group > Information Technologies Division > 260 Madison Ave > Suite 200 > NY, NY 10016 > T. 212 687 4050 x355 > > C. 201 313 6009 > www.forumgrp.com PLEASE, don't include all that Microsoft HTML crap at the end of your post! Good

Re: getpass and IDEs

2011-02-25 Thread Wolfgang Rohdewald
On Freitag 25 Februar 2011, Andrew wrote: > I find that calling getpass produces a warning noting that it > can't suppress output, if I'm using idle, wingide, or a few > others. If I'm running from the console it works fine, but > then I can't make use of ide-integrated debugging. > > I know I cou

Can you recommend an Experienced Python/SQL contract developer for this 6 - 12 month contract in NYC?

2011-02-25 Thread Ben B. Diamond
Experienced Python/SQL contract developer * 3+ years experience writing clean, concise Python * 3+ years experience tracing, debugging, and maintaining existing code * Experience working closely with a team in a fluid environment with evolving requirements * Strong CS fundamentals (algorithms & da

Re: Connect to FTP

2011-02-25 Thread Chris Rebert
On Fri, Feb 25, 2011 at 6:37 AM, sofia stouki wrote: > > Hi all, > > I am trying to put together a script (Python 2.5, windows xp) that connects > to an ftp server and retrieves/uploads files. > > I am sure what I have put together is completely insufficient and I get the > errors: > > Traceback

Re: Removing hidden directory in os.walk()

2011-02-25 Thread Chris Rebert
On Fri, Feb 25, 2011 at 9:40 AM, Gaëtan Podevijn wrote: > Hello, > I would like that os.walk() does not walk through hidden directories. I know > that with topdow = true, I can modify the subdirectory list in place, but > how should I remove every hidden directory from this place in list ? Assumi

Removing hidden directory in os.walk()

2011-02-25 Thread Gaëtan Podevijn
Hello, I would like that os.walk() does not walk through hidden directories. I know that with topdow = true, I can modify the subdirectory list in place, but how should I remove every hidden directory from this place in list ? Thank you, Gaëtan -- http://mail.python.org/mailman/listinfo/python-l

Re: Parsing numeric ranges

2011-02-25 Thread Simon Brunning
On 25 February 2011 09:27, Seldon wrote: > Hi all, > I have to convert integer ranges expressed in a popular "compact" notation > (e.g. 2, 5-7, 20-22, 41) to a the actual set of numbers (i.e. > 2,5,7,20,21,22,41). > > Is there any library for doing such kind of things or I have to write it > from

Re: Suggestion Reqd for Designing a Website in Python

2011-02-25 Thread joy99
On Feb 25, 8:03 pm, Daniel Fetchinson wrote: > >> >I have developed one big Machine Learning software a Machine > >> >Translation system in Python. > >> >Now, I am thinking to make a User Interface of it and upload it in a > >> >web site. > > >> Do you mean you want people to download this from a

Make a buildout based application standalone

2011-02-25 Thread Oleksandr Kozachuk
Hi! I try to create a standalone installable version of BlueBream, but also with other appications: What is required to do, to install some Buildout based application without internet connection? The first problem is to create a full dependency list and download all packages. The next is to insta

getpass and IDEs

2011-02-25 Thread Andrew
I find that calling getpass produces a warning noting that it can't suppress output, if I'm using idle, wingide, or a few others. If I'm running from the console it works fine, but then I can't make use of ide-integrated debugging. I know I could just set up a test account for development purpose

Re: Yappi error "context not found"

2011-02-25 Thread Brian
Thanks - I've opened a ticket at http://code.google.com/p/yappi/issues/detail?id=21 -- http://mail.python.org/mailman/listinfo/python-list

Re: Suggestion Reqd for Designing a Website in Python

2011-02-25 Thread Daniel Fetchinson
>> >I have developed one big Machine Learning software a Machine >> >Translation system in Python. >> >Now, I am thinking to make a User Interface of it and upload it in a >> >web site. >> >> Do you mean you want people to download this from a web site as an >> executable, and then run it locally o

Re: Suggestion Reqd for Designing a Website in Python

2011-02-25 Thread joy99
On Feb 25, 12:36 pm, Tim Roberts wrote: > joy99 wrote: > > >Dear Group, > >I have developed one big Machine Learning software a Machine > >Translation system in Python. > >Now, I am thinking to make a User Interface of it and upload it in a > >web site. > > Do you mean you want people to download

Connect to FTP

2011-02-25 Thread sofia stouki
Hi all,   I am trying to put together a script (Python 2.5, windows xp) that connects to an ftp server and retrieves/uploads files.   I am sure what I have put together is completely insufficient and I get the errors:   Traceback (most recent call last):   File "C:\Documents and Settings\\Deskto

Re: lxml

2011-02-25 Thread Colin J. Williams
On 24-Feb-11 19:39 PM, alex23 wrote: On Feb 24, 6:20 pm, Stefan Behnel wrote: MRAB, 24.02.2011 01:25: The latest stable release is here: http://pypi.python.org/pypi/lxml/2.2.8 Not quite the latest "stable release" (that would be 2.3), but at least one that's pre-built for Windows. Chris

Re: Parsing numeric ranges

2011-02-25 Thread Seldon
On 02/25/2011 10:44 AM, Alain Ketterlin wrote: Seldon writes: I have to convert integer ranges expressed in a popular "compact" notation (e.g. 2, 5-7, 20-22, 41) to a the actual set of numbers (i.e. 2,5,7,20,21,22,41). What form does the input have? Are they strings, or some other representa

Re: Python encoding question

2011-02-25 Thread Dave Angel
On 01/-10/-28163 02:59 PM, Marc Muehlfeld wrote: Hi, TEST = cursor.fetchone() print TEST[0] print TEST When I run this script It prints me: München ('M\xc3\xbcnchen',) Why is the Umlaut of TEST[0] printed and not from TEST? When you print a string, it simply prints it, control character

Re: Re: Python fails on math

2011-02-25 Thread Heather Brown
On 01/-10/-28163 02:59 PM, Grant Edwards wrote: On 2011-02-25, Steven D'Aprano wrote: C double *variables* are, but as John suggests, C compilers are allowed (to my knowledge) to keep intermediate results of an expression in the larger-precision FPU registers. The final result does get shoved

Today's Hottest actresses

2011-02-25 Thread Ashraf Ali
Hello friends, what's going on? Would you like to watch hollywood, bollywood. tollywood, hot actresses pictures,biography, filmography. Just visit www.hotpics00.blogspot.com www.hollywood-99.blogspot.com www.hollywoodactors-99.blogspot.com www.bollywoodactors00.blogspot.com -- http://mail.python.o

Re: Python encoding question

2011-02-25 Thread Jean-Michel Pichavant
Marc Muehlfeld wrote: Hi, I'm doing my first steps with python and I have a problem with understanding an encoding problem I have. My script: import os os.environ["NLS_LANG"] = "German_Germany.UTF8" import cx_Oracle connection = cx_Oracle.Connection("username/password@SID") cursor = connectio

Python encoding question

2011-02-25 Thread Marc Muehlfeld
Hi, I'm doing my first steps with python and I have a problem with understanding an encoding problem I have. My script: import os os.environ["NLS_LANG"] = "German_Germany.UTF8" import cx_Oracle connection = cx_Oracle.Connection("username/password@SID") cursor = connection.cursor() cursor.execu

Re: Newbie...

2011-02-25 Thread Steven D'Aprano
On Fri, 25 Feb 2011 03:45:29 -0500, Corey Richardson wrote: > On 02/25/2011 03:39 AM, Corey Richardson wrote: >> Also, if one understands how a unicode byte looks like in a string, >> it's pretty easy to understand, and looks a hell of a lot clearer than >> a bunch of chr()'s without any space bet

Re: Parsing numeric ranges

2011-02-25 Thread Alain Ketterlin
Seldon writes: > I have to convert integer ranges expressed in a popular "compact" > notation (e.g. 2, 5-7, 20-22, 41) to a the actual set of numbers (i.e. > 2,5,7,20,21,22,41). What form does the input have? Are they strings, or some other representation? > Is there any library for doing such

Re: Parsing numeric ranges

2011-02-25 Thread Corey Richardson
On 02/25/2011 04:27 AM, Seldon wrote: > Hi all, > I have to convert integer ranges expressed in a popular "compact" > notation (e.g. 2, 5-7, 20-22, 41) to a the actual set of numbers (i.e. > 2,5,7,20,21,22,41). > > Is there any library for doing such kind of things or I have to write it > from

Parsing numeric ranges

2011-02-25 Thread Seldon
Hi all, I have to convert integer ranges expressed in a popular "compact" notation (e.g. 2, 5-7, 20-22, 41) to a the actual set of numbers (i.e. 2,5,7,20,21,22,41). Is there any library for doing such kind of things or I have to write it from scratch ? Thanks in advance for any answers. Se

Re: 2to3 chokes on bad character

2011-02-25 Thread Peter Otten
John Machin wrote: > On Feb 25, 12:00 am, Peter Otten <__pete...@web.de> wrote: >> John Machin wrote: > >> > Your Python 2.x code should be TESTED before you poke 2to3 at it. In >> > this case just trying to run or import the offending code file would >> > have given an informative syntax error (

Re: Newbie...

2011-02-25 Thread Corey Richardson
On 02/25/2011 03:39 AM, Corey Richardson wrote: > Also, if one understands how a unicode byte looks like in a string, it's > pretty easy to understand, and looks a hell of a lot clearer than a > bunch of chr()'s without any space between. That's just my two cents. Err..not a unicode byte, but it's

File-backed file system manipulation question

2011-02-25 Thread Chris Willmore
Hi All, I have seen questions regarding mounting and dealing with root owned data, but nothing that appears to solve my particular issue. I am creating an application that needs to mount VM images and do some manipulation (swap kernel, change fstab, etc). Most of the files and directories in

Re: Newbie...

2011-02-25 Thread Corey Richardson
On 02/25/2011 03:18 AM, wisecrac...@tesco.net wrote: > True, but it is inside a Python file too. So therefore the idea is in a > working state. Then copyright the code. >>> # >>> import afg[RETURN/ENTER] > >> I thought you said you use only "STANDARD Python"? What's afg? It doesn't >> seem very

Re: Newbie...

2011-02-25 Thread wisecracker
HI Steven... > For *small* snippets, say, a single function, you can use the ActiveState > Cookbook: > http://code.activestate.com/recipes/langs/python/ > A few random comments about your code: Thanks duly noted... >> # Original idea copyright, (C)2009, B.Walker, G0LCU. > You can't copyright i