regular expressions

2010-04-15 Thread chaaana
hi.. im parsing the text file containing the details of the testcases failed.From the file i wanted to obtain only the testcase names and enter them in the excel sheet. the pattern of the text file is: FILE : NW_PTH_TFG6_SCEN_4_2_FIFO.c, LINE : 240 TEST FAIL to get entire: 32768 bytes NW_PTH_TFG6

extract substring by regex from a text file

2010-04-15 Thread Alessio
Hi, I'm facing the problem in the subject: - I have a text file that I need to parse for producing a specifical string (Json like) extracting some information (substring) in it; - I created regural expressions capable to locate these substrings in my txt file; now I don't know how to continue. Wh

Hi,Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Jo Chan
Hi, everyone~~~ I am new. What is the most popular xml parser module used on python? Thanks for answering... -- -- Best Regards 陈松坚 信息科学与技术学院 中山大学 广州大学城 510006 Chen Songjian School of Information Science & Technology Sun Yat-sen(Zhongshan) University, Guangzhou Higher Education

test this maillist

2010-04-15 Thread 袁远松
I want to test how to use this maillist ,please reply to me,thank you !-- http://mail.python.org/mailman/listinfo/python-list

py2exe and msvcp90.dll

2010-04-15 Thread Alex Hall
Hi all, I am still fighting with py2exe; I keep getting "error: msvcp90.dll: no such file or directory" right after it says it is searching for required dlls. I have followed the py2exe tutorial, though, and I am not sure why it is not finding the dlls, which are in both c:\windows\system32 and in

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Stefan Behnel
Jo Chan, 14.04.2010 15:28: Hi, everyone~~~ I am new. What is the most popular xml parser module used on python? Thanks for answering... Why do you want to know? Just out of curiosity, or are you looking for a tool that you can use to get a specific job done? If it's the latter, you may want

user rights and python com servers

2010-04-15 Thread sniffer
hi all, i am facing a peculiar problem with a python com server i've developed the com server runs fine in winxp standalone systems but if the system is part of a domain then until the logged in user is given power user rights i am unable to register the dll using regsvr32 , a similar problem i fa

Re: Write web apps in Python?

2010-04-15 Thread Gilles Ganault
On Mon, 12 Apr 2010 05:37:54 -0700 (PDT), Luis M. González wrote: >You should first investigate the different python web frameworks, >choose one and then use the deployment options supported by your >choice. These frameworks support several ways to deploy your apps, >such as those you mentioned.

Re: msvcr90.dll is MIA?

2010-04-15 Thread Filip
Maybe this is a stupid question. I don't know, I don't use windows. But what's so special about msvcr and visual studio compiler? Python compiles fine with gcc under unixes, so is it a problem to compile python interpreter with mingw and get rid of the proprietary runtime dependecies? Or does the w

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Shashwat Anand
BeautifulSoup On Thu, Apr 15, 2010 at 1:39 PM, Stefan Behnel wrote: > Jo Chan, 14.04.2010 15:28: > > Hi, everyone~~~ I am new. >> What is the most popular xml parser module used on python? Thanks for >> answering... >> > > Why do you want to know? Just out of curiosity, or are you looking for

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Stefan Behnel
Shashwat Anand, 15.04.2010 11:55: > BeautifulSoup The OP asked for an XML parser. Stefan -- http://mail.python.org/mailman/listinfo/python-list

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Shashwat Anand
BeatifulSoup can be used as one IMO On Thu, Apr 15, 2010 at 3:50 PM, Stefan Behnel wrote: > Shashwat Anand, 15.04.2010 11:55: > > BeautifulSoup > > The OP asked for an XML parser. > > Stefan > > -- > http://mail.python.org/mailman/listinfo/python-list > -- http://mail.python.org/mailman/listinf

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Stefan Behnel
Shashwat Anand, 15.04.2010 12:29: On Thu, Apr 15, 2010 at 3:50 PM, Stefan Behnel wrote: Shashwat Anand, 15.04.2010 11:55: BeautifulSoup The OP asked for an XML parser. BeatifulSoup can be used as one IMO But it is not an XML parser according to the XML spec. So giving the impression that

Re: Write web apps in Python?

2010-04-15 Thread Bruno Desthuilliers
Gilles Ganault a écrit : So it looks like, unlike PHP, the prefered solution in Python is to build a complete application as a long-running process, and either use its embedded web server or configure a stand-alone web server to act as reverse proxy using either FastCGI or WSGI to connect the two

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Stefan Behnel
Jo Chan, 15.04.2010 10:52: > I just want to get the content from a XML. That's not a very specific description of what you want to do. What's "the content"? The plain text content? Or do you care about the structure? And what parts of the structure? > I learn that there are two > modules in pyth

Re: Windows installer of Python

2010-04-15 Thread moerchendiser2k3
Hm, I thought there will be installed something like the Microsoft Redistributable 2008 Package to make Python run? -- http://mail.python.org/mailman/listinfo/python-list

Re: Tough sorting problem: or, I'm confusing myself

2010-04-15 Thread david jensen
On Apr 14, 6:06 pm, Raymond Hettinger wrote: > > I'm not sure a heap will help much, and at least to me, > > doesn't improve readability. > > nlargest() should save quite a few comparisons and run much faster > than sorted(). > > Not sure what the readability issue is.  The phrase "nlargest(2, > i

Re: missing dll follow-up

2010-04-15 Thread Jonathan Hartley
Alex Hall wrote: > The vcredist_x86 was, I thought, supposed to give me > the dll, but it does not seem to have done so. The installer puts the DLL in the directory C:\WINDOWS\WinSxS (or at least it does for me, on WinXP) I shall update the py2exe tutorial page to reflect this. Under that dir, th

Re: missing dll follow-up

2010-04-15 Thread Jonathan Hartley
On Apr 15, 12:11 pm, Jonathan Hartley wrote: > Alex Hall wrote: > > The vcredist_x86 was, I thought, supposed to give me > > the dll, but it does not seem to have done so. > > The installer puts the DLL in the directory C:\WINDOWS\WinSxS > (or at least it does for me, on WinXP) I shall update the

Re: missing dll follow-up

2010-04-15 Thread Jonathan Hartley
On Apr 15, 12:11 pm, Jonathan Hartley wrote: > The installer puts the DLL in the directory C:\WINDOWS\WinSxS > (or at least it does for me, on WinXP) I shall update the py2exe > tutorial page to reflect this. Done. Final para of section 5.2.2 now reads: """ The installer puts a copy of the DLLs i

sqldict - You have a dict with unlimited capacity, what do you do? (it can store arbitrary objects too)

2010-04-15 Thread Krister Hedfors
sqldict - dict with sqlalchemy database-agnostic back-end You can now create a dict out of arbitrary key/value columns of any existing database table, in addition to ordinary dedicated strict or auto-pickling sqldicts. Basic use: $ easy_install sqldict $ easy_install sqlalchemy >>> from sq

Re: extract substring by regex from a text file

2010-04-15 Thread Neil Cerutti
On 2010-04-15, Alessio wrote: > Hi, > > I'm facing the problem in the subject: > - I have a text file that I need to parse for producing a specifical > string (Json like) extracting some information (substring) in it; > - I created regural expressions capable to locate these substrings in > my txt

A question about the posibility of raise-yield in Python

2010-04-15 Thread Дамјан Георгиевски
I'm writing this as a complete newbie (on the issue), so don't be surprised if it's the stupidest idea ever. I was wondering if there was ever a discusision in the python community on a 'raise-yield' kind-of combined expression. I'd like to know if it was proposed/rejected/discussed/not-decided

Re: Object serialization: transfer from a to b (non-implemented code on b)

2010-04-15 Thread Gabriel Rossetti
Andreas Löscher wrote: Am Mittwoch, den 14.04.2010, 11:33 +0200 schrieb Gabriel Rossetti: Paul Rubin wrote: Gabriel Rossetti writes: I am trying to serialize a function, class, etc and transfer it You mean the actual code? You have to use marshal rather than

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Jo Chan
On Thu, Apr 15, 2010 at 6:52 PM, Stefan Behnel wrote: > Jo Chan, 15.04.2010 10:52: > > I just want to get the content from a XML. > > That's not a very specific description of what you want to do. What's "the > content"? The plain text content? Or do you care about the structure? And > what parts

Re: Hi, Everyone: what's the most popular xml parser module on python?

2010-04-15 Thread Jo Chan
I want to say I just have to deal with some regular text input (the input file is as XML format) so I need to read all the nodes out and get what they are. Thanks for your great help though. I should have made my point clearer. :) On Thu, Apr 15, 2010 at 6:52 PM, Stefan Behnel wrote: > Jo Chan,

Re: C-style static variables in Python?

2010-04-15 Thread Albert van der Horst
In article , Steve Holden wrote: >Terry Reedy wrote: >> On 4/1/2010 6:34 PM, kj wrote: >>> >>> >>> When coding C I have often found static local variables useful for >>> doing once-only run-time initializations. For example: >>> >>> int foo(int x, int y, int z) { >>> >>>static int first_time

pylint bugs day #2 tomorrow

2010-04-15 Thread Sylvain Thénault
Hi there, just a quick note to remind pylint felows that we will hold the second pylint bugs day tomorrow, from about 8am to 18pm UTC+2. See you on our jabber forum or in our paris office! -- Sylvain Thénault LOGILAB, Paris (France) Formations Python, Debian, Méth.

Re: lambda with floats

2010-04-15 Thread Albert van der Horst
In article <3790faeb-ae4c-4b45-b0a6-41cb32e46...@k13g2000yqe.googlegroups.com>, Patrick Maupin wrote: >On Apr 6, 11:10=A0pm, Patrick Maupin wrote: >> On Apr 6, 11:04=A0pm, Patrick Maupin wrote: >> >> >> >> > On Apr 6, 10:16=A0pm, monkeys paw wrote: >> >> > > I have the following acre meter whi

Re: Object serialization: transfer from a to b (non-implemented code on b)

2010-04-15 Thread Andreas Löscher
> import types > import marshal > def a(): pass > > > ... > > > s=marshal.dumps(a.__code__) > f=types.FunctionType(marshal.loads(s), {}) > f > > > > > > > What version of python do you have? If I try your code above I get : > > >>

Re: regular expressions

2010-04-15 Thread Terry Reedy
On 4/15/2010 2:57 AM, chaaana wrote: hi.. im parsing the text file containing the details of the testcases failed.From the file i wanted to obtain only the testcase names and enter them in the excel sheet. the pattern of the text file is: FILE : NW_PTH_TFG6_SCEN_4_2_FIFO.c, LINE : 240 TEST FAIL

Re: Write web apps in Python?

2010-04-15 Thread Gilles Ganault
On Thu, 15 Apr 2010 12:41:56 +0200, Bruno Desthuilliers wrote: >The PHP execution model (mostly based on CGI FWIW) tends to be a bit >unpractical for non-trivial applications since you have to rebuild the >whole world for each and any incoming request, while with a long-running >process, you lo

Re: A question about the posibility of raise-yield in Python

2010-04-15 Thread Terry Reedy
On 4/15/2010 9:34 AM, Дамјан Георгиевски wrote: I'm writing this as a complete newbie (on the issue), so don't be surprised if it's the stupidest idea ever. I was wondering if there was ever a discusision in the python community on a 'raise-yield' kind-of combined expression. I'd like to know if

Re: py2exe and msvcp90.dll

2010-04-15 Thread Gaicitadie
On 4月15日, 下午12时19分, Alex Hall wrote: > Hi all, > I am still fighting with py2exe; I keep getting "error: msvcp90.dll: > no such file or directory" right after it says it is searching for > required dlls. I have followed the py2exe tutorial, though, and I am > not sure why it is not finding the dll

Urllib2 urlopen and read - difference

2010-04-15 Thread koranthala
Hi, Suppose I am doing the following: req = urllib2.urlopen('http://www.python.org') data = req.read() When is the actual data received? is it done by the first line? or is it done only when req.read() is used? My understanding is that when urlopen is done itself, we would have received al

Re: regular expressions

2010-04-15 Thread Tim Chase
On 04/15/2010 11:05 AM, Terry Reedy wrote: On 4/15/2010 2:57 AM, chaaana wrote: hi.. im parsing the text file containing the details of the testcases failed.From the file i wanted to obtain only the testcase names and enter them in the excel sheet. the pattern of the text file is: FILE : NW_PT

Re: Urllib2 urlopen and read - difference

2010-04-15 Thread J. Cliff Dyer
On Thu, 2010-04-15 at 11:25 -0700, koranthala wrote: > Hi, >Suppose I am doing the following: > req = urllib2.urlopen('http://www.python.org') > data = req.read() > >When is the actual data received? is it done by the first line? or > is it done only when req.read() is used? > My underst

Re: Urllib2 urlopen and read - difference

2010-04-15 Thread J. Cliff Dyer
On Thu, 2010-04-15 at 11:25 -0700, koranthala wrote: > Hi, >Suppose I am doing the following: > req = urllib2.urlopen('http://www.python.org') > data = req.read() > >When is the actual data received? is it done by the first line? or > is it done only when req.read() is used? > My underst

feature request for a wget -r like implementation in python3

2010-04-15 Thread gert
So I can make a recursive http download script My goal is a one click instruction to install and launch my project http://code.google.com/p/appwsgi/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Suppress output to stdout/stderr in InteractiveInterpreter

2010-04-15 Thread Dave W.
> > I thought I could get away with importing print_function > > from __future__ ... but my re-pointed print function never gets > > called. > -snip- > >def __enter__(self): > >print = self.printhook > That redefines the print function local to __enter__. You need to > change the gl

Re: py2exe and msvcp90.dll

2010-04-15 Thread Joaquin Abian
On Apr 15, 6:19 am, Alex Hall wrote: > Hi all, > I am still fighting with py2exe; I keep getting "error: msvcp90.dll: > no such file or directory" right after it says it is searching for > required dlls. I have followed the py2exe tutorial, though, and I am > not sure why it is not finding the dll

python wia and RegisterEvent

2010-04-15 Thread gelonida
Hi, I'd like to register an event in order to be informed, whenever a Windows WIA device is connected or disconnected. In python I can use WIA devices, but I don't know how to register events I have existing C# code, which works and looks like. class MgrHandlerClass { public void

Re: Windows installer of Python

2010-04-15 Thread Martin v. Loewis
moerchendiser2k3 wrote: > Hm, I thought there will be installed something > like the Microsoft Redistributable 2008 Package to make Python run? No, the Python installer integrates the Microsoft Merge Module for the Visual Studio Runtime Dynamic Link Libraries. That removes the need to install the

Re: ctypes question

2010-04-15 Thread Brendan Miller
On Wed, Apr 14, 2010 at 12:12 PM, Mark Dickinson wrote: > On Apr 14, 7:09 pm, Brendan Miller wrote: >> I'm using python 2.5.2. >> >> I have a ctypes function with argtypes like this: >> >> _create_folder.argyptes = [c_void_p, c_int] > > Is that line a cut-and-paste?  If so, try 'argtypes' instead

Re: Suppress output to stdout/stderr in InteractiveInterpreter

2010-04-15 Thread Dave W.
> After your reply, I went back and > discovered that everything was actually working fine with 'global' > in place Oops, I lied. It still doesn't work. It doesn't seem possible (or at least not easy) to *globally* override the built-in print function. The best

Re: py2exe and msvcp90.dll

2010-04-15 Thread Waldemar Osuch
On Apr 14, 10:19 pm, Alex Hall wrote: > Hi all, > I am still fighting with py2exe; I keep getting "error: msvcp90.dll: > no such file or directory" right after it says it is searching for > required dlls. I have followed the py2exe tutorial, though, and I am > not sure why it is not finding the dl

Re: Suppress output to stdout/stderr in InteractiveInterpreter

2010-04-15 Thread Robert Kern
On 2010-04-15 17:54 PM, Dave W. wrote: After your reply, I went back and discovered that everything was actually working fine with 'global' in place Oops, I lied. It still doesn't work. It doesn't seem possible (or at least not easy) to *globally* override the

Globally override built-in print function?

2010-04-15 Thread Dave W.
I naively thought I could capture output from exec()'ed print invocations by (somehow) overriding 'print' globally. But this seems not to be possible. Or at least not easy: c:\d>test.py Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] win32 Type "help", "copyright", "

Re: Globally override built-in print function?

2010-04-15 Thread Robert Kern
On 2010-04-15 18:08 PM, Dave W. wrote: I naively thought I could capture output from exec()'ed print invocations by (somehow) overriding 'print' globally. But this seems not to be possible. Or at least not easy: c:\d>test.py Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (

how to get elements of a com object (wmi log events)

2010-04-15 Thread News123
Just having a short question: I found a code snippet, that fetches windows event logs via a wmi query. import win32com.client strComputer = "." objWMIService = win32com.client.Dispatch("WbemScripting.SWbemLocator") objSWbemServices = objWMIService.ConnectServer(strComputer,"root\cimv2") colItem

py2exe saga continues...

2010-04-15 Thread Alex Hall
Hi all, I started a new thread as I already have several out there, all talking about basically the same thing. After re-visiting a StackOverflow post, thanks to the person who gave me that link, I tossed msvcp90.dll and msvcr90.dll (I use wx) into c:\python26\dlls and it now compiles! I think I ke

Re: msvcr90.dll is MIA?

2010-04-15 Thread Neil Hodgson
Filip: > But what's so special about msvcr and visual studio compiler? Python > compiles fine with gcc under unixes, so is it a problem to compile > python interpreter with mingw and get rid of the proprietary runtime > dependecies? MinGW uses an older version of Microsoft's runtime MSVCRT.DLL.

Re: user rights and python com servers

2010-04-15 Thread Mark Hammond
On 15/04/2010 6:05 PM, sniffer wrote: hi all, i am facing a peculiar problem with a python com server i've developed the com server runs fine in winxp standalone systems but if the system is part of a domain then until the logged in user is given power user rights i am unable to register the dll

Re: py2exe saga continues...

2010-04-15 Thread Mark Hammond
On 16/04/2010 10:52 AM, Alex Hall wrote: 1. Is there a way to start with no command line window popping up? My main script is a pyw, but it still shows a dos window when the generated .exe file is clicked. Leaving out the "console" parameter of setup, though, results in no .exe file at all, so I

Re: python wia and RegisterEvent

2010-04-15 Thread Mark Hammond
On 16/04/2010 7:15 AM, gelonida wrote: Hi, I'd like to register an event in order to be informed, whenever a Windows WIA device is connected or disconnected. In python I can use WIA devices, but I don't know how to register events I have existing C# code, which works and looks like. class

Re: py2exe saga continues...

2010-04-15 Thread alex23
Alex Hall wrote: > I started a new thread as I already have several out there, all > talking about basically the same thing. Would you mind not doing that and sticking to the one thread to talk about an issue, preferably one with a subject that actually describes the question? Every time you star

Re: feature request for a wget -r like implementation in python3

2010-04-15 Thread alex23
On Apr 16, 5:37 am, gert wrote: > So I can make a recursive http download script > My goal is a one click instruction to install and launch my > projecthttp://code.google.com/p/appwsgi/ Here's Guido's take on wget: import sys, urllib def reporthook(*a): print a for url in sys.argv[1

How to run program in Linux

2010-04-15 Thread Jim Byrnes
I am just learning Python and am new to Linux so I am probably doing something to trip myself up. I am trying to run an example GUI program that fetches a record from a database. All the files are in the same folder. The program runs but its results vary depending on how I started it. If I

Re: Globally override built-in print function?

2010-04-15 Thread Dave W.
> > I naively thought I could capture output from exec()'ed print > > invocations by (somehow) overriding 'print' globally. But this > > seems not to be possible. > >old_print = __builtins__.print >__builtins__.print = printhook >yield >__builtins__.print = old_print I'm pretty

Re: py2exe saga continues...

2010-04-15 Thread Alex Hall
On 4/15/10, Mark Hammond wrote: > On 16/04/2010 10:52 AM, Alex Hall wrote: >> 1. Is there a way to start with no command line window popping up? My >> main script is a pyw, but it still shows a dos window when the >> generated .exe file is clicked. Leaving out the "console" parameter of >> setup,

Re: Download Visual Studio Express 2008 now

2010-04-15 Thread Neil Hodgson
Martin v. Loewis: > Python 2.6, 2.7, and 3.1 are all built with that release (i.e. 2008). > Because of another long tradition, Python extension modules must be > built with the same compiler version (more specifically, CRT version) as > Python itself. So to build extension modules for any of these

Re: user rights and python com servers

2010-04-15 Thread sniffer
On Apr 16, 6:01 am, Mark Hammond wrote: > On 15/04/2010 6:05 PM, sniffer wrote: > > > hi all, > > i am facing a peculiar problem with a python com server i've developed > > the com server runs fine in winxp  standalone systems but if the > > system is part of a domain then until the logged in user

Re: Suppress output to stdout/stderr in InteractiveInterpreter

2010-04-15 Thread Dave W.
> > Think I'll start a new post with the subject: "Globally override > > built-in print function?" > Don't bother. Replacing sys.stdout is the right thing to do. It > won't interfere with the C++ streams... -snip- I'm not so certain. Won't the C++ host app share the same stdin/stdout/stderr file

Re: user rights and python com servers

2010-04-15 Thread Mark Hammond
On 16/04/2010 2:40 PM, sniffer wrote: Thanks Mark, just one question does the explanation given above by you also apply to winxp systems in a domain, Yeah - IIRC, domain users can't change much of the registry by default, primarily as they aren't in the 'administrators' or 'power user' group