Re: MODULE FOR I, P FRAME

2010-02-15 Thread DANNY
On Feb 16, 12:53 am, "Rhodri James" wrote: > On Sun, 14 Feb 2010 10:07:35 -, DANNY wrote: > > Hy, first thanks for your response! > > Well I am thinkin on coding in MPEG4/10, but I would just encode the > > video in that encoding, > > then stream it with VLC and save the video file on my disc

Re: Few Small Questions Regarding CGI

2010-02-15 Thread Tim Roberts
joy99 wrote: > >I am trying to learn CGI. I was checking Python Docs. There are >multiple modules. Which one to start with? Well, it seems to me that the first place to start is the built-in CGI module, in "cgi.py". I'm not aware of any other CGI-based modules in the standard library. -- Tim Ro

Looking for a Compiled Demo of MPL (matplotlib) Graphics

2010-02-15 Thread W. eWatson
Does anyone know where I can find a compiled demo that uses MPL graphics? I'd like, if possible, a Win version whose size is less than 10M, so that I can send it via e-mail, if necessary. It should use plot, so that someone can manipulate the plot with the navigation controls. At this point, I

Re: listing existing windows services with python

2010-02-15 Thread Alf P. Steinbach
* alex23: On Feb 16, 1:28 pm, "Alf P. Steinbach" wrote: It's probably Very Good, but one Microsoft-thing one should be aware of: using WMI functionality generally starts up a background WMI service... "Probably"? That means that since you say it's fantastic, it's probably very good. "Proba

Re: listing existing windows services with python

2010-02-15 Thread alex23
On Feb 16, 1:28 pm, "Alf P. Steinbach" wrote: > It's probably Very Good, but one Microsoft-thing one should be aware of: using > WMI functionality generally starts up a background WMI service... "Probably"? You haven't even used the module but you felt the need to contribute anyway? And I see tha

Re: listing existing windows services with python

2010-02-15 Thread Brian Curtin
On Mon, Feb 15, 2010 at 18:17, Alf P. Steinbach wrote: > * News123: > > Hi, >> >> >> What is the best way with python to get a list of all windows services. >> >> As a start I would be glad to receive only the service names. >> >> However it would be nicer if I could get all the properties of a

TkTable and Python 3.1

2010-02-15 Thread Charles McKnight
HI All, I'm fiddling around with Python and I'm trying to get tktable to work with Python 3.1 on Apple OS X 10.6 (Snow Leopard). Has anyone successfully accomplished this task, and if so, can you share how that you got it working? I've got Darwin Ports installed (current version) and I'm using Pyt

Re: How to use python to register a service (an existing .exe file)

2010-02-15 Thread Brian Curtin
On Mon, Feb 15, 2010 at 18:10, News123 wrote: > Hi, > > Is there a python way to register new windows services. > > > I am aware of the > instsrv.exe program, which can be used to install services. > I could use subprocess.Popen to call > > > instsrv.exe "service_name" program.exe > > > but wonde

Am I using ctypes correctly? Where are fprints going?

2010-02-15 Thread TP
>From the Cplusplus-sig, I gathered that instead of Boost.Python I should use ctypes for the following problem. But let me make sure I'm using it correctly. I am calling the C Leptonica Image Processing C Library (http://leptonica.com) from python. Within its leptprotos.h file are functions like

Re: listing existing windows services with python

2010-02-15 Thread Alf P. Steinbach
* alex23: News123 wrote: What is the best way with python to get a list of all windows services. As a start I would be glad to receive only the service names. However it would be nicer if I could get all the properties of a service as well. I highly recommend Tim Golden's fantastic WMI modu

Re: TypeError Exception in email lib

2010-02-15 Thread John Yeung
On Feb 15, 3:59 pm, John Yeung wrote: > It looks to me like you have to do something to make clean_stale_mail > more robust, rather than focusing on anything in the standard library. Let me quickly add: ...or fix whatever calls clean_stale_mail, etc. John -- http://mail.python.org/mailman/list

Re: Few Small Questions Regarding CGI

2010-02-15 Thread John Gordon
In <631b0785-38db-4c12-a82a-7b11e2235...@o16g2000prh.googlegroups.com> joy99 writes: > Can I use my personal computer as a client as well as a server? Yes, if you install a web server on your PC. You would then use "localhost" in your browser instead of a standard web address. Assuming you'r

Re: Web Service Using XML for input and output

2010-02-15 Thread Steve Holden
Shane McIntyre wrote: > I'm attempting to use a web service that takes XML as an input and > returns an XML output. I can connect to the service and attempt to pass > in the XML but do not get any results. I believe my problem is how to > package up the XML and send it in the request. The XML con

Re: listing existing windows services with python

2010-02-15 Thread alex23
News123 wrote: > What is the best way with python to get a list of all windows services. > > As a start I would be glad to receive only the service names. > > However it would be nicer if I could get all the properties of a service > as well. I highly recommend Tim Golden's fantastic WMI module[1

Web Service Using XML for input and output

2010-02-15 Thread Shane McIntyre
I'm attempting to use a web service that takes XML as an input and returns an XML output.  I can connect to the service and attempt to pass in the XML but do not get any results. I believe my problem is how to package up the XML and send it in the request.  The XML consists of about 20 tag/value

Re: Time out a regular expression in Python 2.6.4?

2010-02-15 Thread MRAB
Steve Holden wrote: Jonathan Gardner wrote: On Feb 15, 7:59 am, Steve Holden wrote: pyt...@bdurham.com wrote: Is there any way to time out a regular expression in Python 2.6.4? Motiviation: Our application allows users to enter regular expressions as validation criteria. If a user enters a pa

Re: Time out a regular expression in Python 2.6.4?

2010-02-15 Thread Steve Holden
Jonathan Gardner wrote: > On Feb 15, 7:59 am, Steve Holden wrote: >> pyt...@bdurham.com wrote: >>> Is there any way to time out a regular expression in Python 2.6.4? >>> Motiviation: Our application allows users to enter regular expressions >>> as validation criteria. If a user enters a pathologic

Re: Parsing for email addresses

2010-02-15 Thread Ben Finney
galileo228 writes: > I'm trying to write python code that will open a textfile and find the > email addresses inside it. I then want the code to take just the > characters to the left of the "@" symbol, and place them in a list. Email addresses can have more than one �...@’ character. In fact, t

Re: Few Small Questions Regarding CGI

2010-02-15 Thread Mel
joy99 wrote: > Dear Group, > > I am trying to learn CGI. I was checking Python Docs. There are > multiple modules. Which one to start with? > Is there any other material or URL for step by step learning of CGI. > > My next question is: > I want to test it. I have a small personal computer. I hav

Re: Parsing for email addresses

2010-02-15 Thread Tim Chase
Jonathan Gardner wrote: On Feb 15, 3:34 pm, galileo228 wrote: I'm trying to write python code that will open a textfile and find the email addresses inside it. I then want the code to take just the characters to the left of the "@" symbol, and place them in a list. (So if galileo...@gmail.com w

Re: Modifying Class Object

2010-02-15 Thread John Posner
On 2/15/2010 6:09 PM, Steven D'Aprano wrote: On Mon, 15 Feb 2010 21:25:23 +, Arnaud Delobelle wrote: John Posner writes: [...] x = s[0] [...] assigns the name *x* to the object that *s[0]* refers to s[0] does not refer to an object, it *is* an object (once evaluated of course, o

Re: listing existing windows services with python

2010-02-15 Thread Alf P. Steinbach
* News123: Hi, What is the best way with python to get a list of all windows services. As a start I would be glad to receive only the service names. However it would be nicer if I could get all the properties of a service as well. Thanks for any info and bye * Library: If there is some

Re: Which mock library do you prefer?

2010-02-15 Thread Ben Finney
Lacrima writes: > Minimock has wider usage and community, but I have some troubles using > it. Maybe I am wrong, but with minimock you always have to keep track > the order of imports in your test modules. Well, may be I just don't > understand fully how minimock works. I'm not sure why you thin

How to use python to register a service (an existing .exe file)

2010-02-15 Thread News123
Hi, Is there a python way to register new windows services. I am aware of the instsrv.exe program, which can be used to install services. I could use subprocess.Popen to call instsrv.exe "service_name" program.exe but wondered, whether there's already an existing function. Thans in advance

listing existing windows services with python

2010-02-15 Thread News123
Hi, What is the best way with python to get a list of all windows services. As a start I would be glad to receive only the service names. However it would be nicer if I could get all the properties of a service as well. Thanks for any info and bye N -- http://mail.python.org/mailman/listinf

Re: Time out a regular expression in Python 2.6.4?

2010-02-15 Thread Jonathan Gardner
On Feb 15, 7:59 am, Steve Holden wrote: > pyt...@bdurham.com wrote: > > Is there any way to time out a regular expression in Python 2.6.4? > > > Motiviation: Our application allows users to enter regular expressions > > as validation criteria. If a user enters a pathological regular > > expression

Re: Few Small Questions Regarding CGI

2010-02-15 Thread Jonathan Gardner
On Feb 15, 2:04 pm, joy99 wrote: > > I am trying to learn CGI. I was checking Python Docs. There are > multiple modules. Which one to start with? > Is there any other material or URL for step by step learning of CGI. > I would suggest skipping 15 years of internet progress and going with a more m

Re: Parsing for email addresses

2010-02-15 Thread Jonathan Gardner
On Feb 15, 3:34 pm, galileo228 wrote: > > I'm trying to write python code that will open a textfile and find the > email addresses inside it. I then want the code to take just the > characters to the left of the "@" symbol, and place them in a list. > (So if galileo...@gmail.com was in the file, '

Re: Modifying Class Object

2010-02-15 Thread Alf P. Steinbach
* Steven D'Aprano: On Mon, 15 Feb 2010 21:25:23 +, Arnaud Delobelle wrote: John Posner writes: [...] x = s[0] [...] assigns the name *x* to the object that *s[0]* refers to s[0] does not refer to an object, it *is* an object (once evaluated of course, otherwise it's just a Python e

Parsing for email addresses

2010-02-15 Thread galileo228
Hey all, I'm trying to write python code that will open a textfile and find the email addresses inside it. I then want the code to take just the characters to the left of the "@" symbol, and place them in a list. (So if galileo...@gmail.com was in the file, 'galileo228' would be added to the list.

Re: Modifying Class Object

2010-02-15 Thread Steven D'Aprano
On Mon, 15 Feb 2010 21:25:23 +, Arnaud Delobelle wrote: > John Posner writes: [...] >>> x = s[0] > [...] >> assigns the name *x* to the object that *s[0]* refers to > > s[0] does not refer to an object, it *is* an object (once evaluated of > course, otherwise it's just a Python expressio

Re: how to structure a directory with many scripts and shared code

2010-02-15 Thread Steven D'Aprano
On Mon, 15 Feb 2010 16:29:05 +0100, Benedict Verheyen wrote: > However, when i make a subdirectory, for example database and put a > script in there, how would i import logutils or mailtutils from within > the database subdirectory? This fails: > from tools.logutils import logger Sounds like

Re: MODULE FOR I, P FRAME

2010-02-15 Thread Rhodri James
On Sun, 14 Feb 2010 10:07:35 -, DANNY wrote: Hy, first thanks for your response! Well I am thinkin on coding in MPEG4/10, but I would just encode the video in that encoding, then stream it with VLC and save the video file on my disc. Then I would play it with my player I think you're

Re: Replace various regex

2010-02-15 Thread Martin
On Feb 15, 2:27 pm, Jean-Michel Pichavant wrote: > Martin wrote: > > On Feb 15, 2:03 pm, Jean-Michel Pichavant > > wrote: > > >> Martin wrote: > > >>> Hi, > > >>> I am trying to come up with a more generic scheme to match and replace > >>> a series ofregex, which look something like this... > > >

Re: Plugin architecture

2010-02-15 Thread Florian Ludwig
Hi mk, On Mon, 2010-02-15 at 19:43 +0100, mk wrote: > Hello everyone, > > I'm thinking about writing plugin-style architecture for (a new) > web-based app (with SQLAlchemy as backend). > > [...] > > How would you approach designing such architecture using features > available in Python (and som

Re: TypeError Exception in email lib

2010-02-15 Thread BJ Swope
On Mon, Feb 15, 2010 at 3:42 PM, MRAB wrote: > BJ Swope wrote: > [snip] >> >> def clean_stale_mail(): >>    msg_date1= the_email.get('Date') > > What is the value of 'msg_date1' at this point? > >>    msg_date2 = email.utils.parsedate_tz(msg_date1) > > What is the value of 'msg_date2' at this poin

Re: plugin / intra process communication system

2010-02-15 Thread Florian Ludwig
On Sun, 2010-02-14 at 18:47 +0100, Diez B. Roggisch wrote: > > Here there problem with the trac (and other plugin systems I've > seen) > > approach: > > > > You need to define something like: > > | > > | class IAuthPlugin(Interface): [...] > > | > > in your blog software. > > Why? Any reason you c

Few Small Questions Regarding CGI

2010-02-15 Thread joy99
Dear Group, I am trying to learn CGI. I was checking Python Docs. There are multiple modules. Which one to start with? Is there any other material or URL for step by step learning of CGI. My next question is: I want to test it. I have a small personal computer. I have internet but is connected by

Re: Modifying Class Object

2010-02-15 Thread Arnaud Delobelle
John Posner writes: [...] >> x = s[0] [...] > assigns the name *x* to the object that *s[0]* refers to s[0] does not refer to an object, it *is* an object (once evaluated of course, otherwise it's just a Python expression). -- Arnaud -- http://mail.python.org/mailman/listinfo/python-list

Re: TypeError Exception in email lib

2010-02-15 Thread John Yeung
On Feb 15, 2:54 pm, BJ Swope wrote: > def clean_stale_mail(): >     msg_date1= the_email.get('Date') >     msg_date2 = email.utils.parsedate_tz(msg_date1) >     try: >         utc_msg_date = email.utils.mktime_tz(msg_date2) >     except OverflowError: >         M.store(msg_id, '+FLAGS.SILENT', '\

Re: error: Setup script exited with error: command 'gcc' failed with exit status 1

2010-02-15 Thread Philip Semanchuk
On Feb 15, 2010, at 3:33 PM, chiranjeevi muttoju wrote: Hi, When i'm trying to install some modules for python i'm getting the fallowing error.. error: Setup script exited with error: command 'gcc' failed with exit status 1 can any one know what it exactly means.. if any body know please repl

Re: TypeError Exception in email lib

2010-02-15 Thread MRAB
BJ Swope wrote: [snip] Speak of the devil and demons appear... /logs/python/imap_fetcher/spam_serv1.bigbluenetworks.com.py Parsing of emails for spam at serv1.bigbluenetworks.com failed. Traceback (most recent call last): File "/logs/python/imap_fetcher/spam_serv1.bigbluenetworks.com.py",

error: Setup script exited with error: command 'gcc' failed with exit status 1

2010-02-15 Thread chiranjeevi muttoju
Hi, When i'm trying to install some modules for python i'm getting the fallowing error.. error: Setup script exited with error: command 'gcc' failed with exit status 1 can any one know what it exactly means.. if any body know please reply. i have gcc version 4.1.2 20080704 (Red Hat 4.1.2-46). i'

Re: Talking with ebay using Python

2010-02-15 Thread Chris Rebert
> On 15 February 2010 20:04, Chris Rebert wrote: >> On Mon, Feb 15, 2010 at 6:10 AM, starglider develop >> wrote: >> > Hi, >> > I need a way of talking with the eBay API: >> > Made search, >> > Ask for item status. >> > >> > What can it be done, and where can I get the info. >> >> In the future,

Re: Talking with ebay using Python

2010-02-15 Thread Chris Rebert
On Mon, Feb 15, 2010 at 6:10 AM, starglider develop wrote: > Hi, > I need a way of talking with the eBay API: > Made search, > Ask for item status. > > What can it be done, and where can I get the info. In the future, search Google and PyPI (http://pypi.python.org/pypi). (PyPI is like CPAN for Py

Re: Which mock library do you prefer?

2010-02-15 Thread Phlip
Lacrima wrote: > Thanks for your reply! Isn't what you are talking about integration > tests? And unit tests should be fully isolated? So even for method > 'some_method()' of class A I should mock instance of class A (i.e. to > mock 'self') to test 'some_method()'. "Unit test" is a high-end QA co

Re: TypeError Exception in email lib

2010-02-15 Thread BJ Swope
On Mon, Feb 15, 2010 at 2:47 PM, BJ Swope wrote: > On Mon, Feb 15, 2010 at 2:31 PM, Stephen Hansen wrote: >> On Mon, Feb 15, 2010 at 10:53 AM, BJ Swope wrote: >>> >>>  File "/usr/lib/python2.5/email/_parseaddr.py", line 142, in mktime_tz >>>    if data[9] is None: >>> TypeError: 'NoneType' objec

Re: Using class attributes

2010-02-15 Thread Chris Rebert
On Mon, Feb 15, 2010 at 10:29 AM, Leo Breebaart wrote: > I have a base class Foo with a number of derived classes FooA, > FooB, FooC, etc. Each of these derived classes needs to read > (upon initialisation) text from an associated template file > FooA.tmpl, FooB.tmpl, FooC.tmpl, etc. > > I can der

Re: TypeError Exception in email lib

2010-02-15 Thread Dave Angel
BJ Swope wrote: File "/usr/lib/python2.5/email/_parseaddr.py", line 142, in mktime_tz if data[9] is None: TypeError: 'NoneType' object is unsubscriptable I'm parsing a bunch of spam and using the date field from the spams for a date-time stamp. I've fixed the lib on my box to place the ca

Re: TypeError Exception in email lib

2010-02-15 Thread BJ Swope
On Mon, Feb 15, 2010 at 2:31 PM, Stephen Hansen wrote: > On Mon, Feb 15, 2010 at 10:53 AM, BJ Swope wrote: >> >>  File "/usr/lib/python2.5/email/_parseaddr.py", line 142, in mktime_tz >>    if data[9] is None: >> TypeError: 'NoneType' object is unsubscriptable >> >> I'm parsing a bunch of spam an

Re: TypeError Exception in email lib

2010-02-15 Thread Stephen Hansen
On Mon, Feb 15, 2010 at 10:53 AM, BJ Swope wrote: > File "/usr/lib/python2.5/email/_parseaddr.py", line 142, in mktime_tz >if data[9] is None: > TypeError: 'NoneType' object is unsubscriptable > > I'm parsing a bunch of spam and using the date field from the spams > for a date-time stamp. >

Re: Modifying Class Object

2010-02-15 Thread John Posner
Alf said (2/13/2010 8:34 PM): Names in Python refer to objects. Those references can be copied via assignment. That's (almost) all. And it provides a very short and neat way to describe pass by sharing. Alf also said (2/13/2010 8:43 PM): * Steve Howell: > This thread is interesting on man

Re: TypeError Exception in email lib

2010-02-15 Thread MRAB
BJ Swope wrote: File "/usr/lib/python2.5/email/_parseaddr.py", line 142, in mktime_tz if data[9] is None: TypeError: 'NoneType' object is unsubscriptable I'm parsing a bunch of spam and using the date field from the spams for a date-time stamp. I've fixed the lib on my box to place the ca

Re: get a field

2010-02-15 Thread MRAB
Tim Chase wrote: Holden wrote: mierdatutis mi wrote: I have this: pe="http://www.rtve.es/mediateca/videos/20100211/saber-comer---patatas-castellanas-costillas-11-02-10/691046.shtml"; I would like to extract this: 691046.shtml But is dynamically. Not always have the same lenght the string

TypeError Exception in email lib

2010-02-15 Thread BJ Swope
File "/usr/lib/python2.5/email/_parseaddr.py", line 142, in mktime_tz if data[9] is None: TypeError: 'NoneType' object is unsubscriptable I'm parsing a bunch of spam and using the date field from the spams for a date-time stamp. I've fixed the lib on my box to place the call inside a try/ex

Re: Plugin architecture

2010-02-15 Thread Daniel Fetchinson
> I'm thinking about writing plugin-style architecture for (a new) > web-based app (with SQLAlchemy as backend). > > Say, there's core web app and someone decides to write plugin Accounting > for this web app that would work with SQA objects of the core app or > other plugins. > > I found this: > >

Plugin architecture

2010-02-15 Thread mk
Hello everyone, I'm thinking about writing plugin-style architecture for (a new) web-based app (with SQLAlchemy as backend). Say, there's core web app and someone decides to write plugin Accounting for this web app that would work with SQA objects of the core app or other plugins. I found

Re: Which mock library do you prefer?

2010-02-15 Thread Lacrima
On Feb 15, 6:57 pm, Phlip wrote: > Lacrima wrote: > > I am newbie mastering test driven development. I can't clarify myself > > which mock library to use. > > There are number of them and which one do you prefer? > > > Two libraries that attracted my attention are: > > * minimock > > * dingus > >

Using class attributes

2010-02-15 Thread Leo Breebaart
I have a base class Foo with a number of derived classes FooA, FooB, FooC, etc. Each of these derived classes needs to read (upon initialisation) text from an associated template file FooA.tmpl, FooB.tmpl, FooC.tmpl, etc. I can derive the template filename string for each instance by doing someth

Re: get a field

2010-02-15 Thread Tim Chase
Holden wrote: mierdatutis mi wrote: I have this: pe="http://www.rtve.es/mediateca/videos/20100211/saber-comer---patatas-castellanas-costillas-11-02-10/691046.shtml"; I would like to extract this: 691046.shtml But is dynamically. Not always have the same lenght the string. s = "http://serv

Re: saving a TIFF

2010-02-15 Thread Benjamin Kaplan
On Mon, Feb 15, 2010 at 12:55 PM, fernando sedano wrote: > I'm trying to save an image created from two arrays (I'm using numpy and > PIL): > > > n=(b4a-b3a)/(b4a+b3a); > ndvi = Image.fromarray(n) > ndvi.save("F:\Fire_scar_mapping\ILS3\ndvi_test","TIFF") > > ...but I get the following erro

saving a TIFF

2010-02-15 Thread fernando sedano
I'm trying to save an image created from two arrays (I'm using numpy and PIL): n=(b4a-b3a)/(b4a+b3a); ndvi = Image.fromarray(n) ndvi.save("F:\Fire_scar_mapping\ILS3\ndvi_test","TIFF") ...but I get the following error message: IOError: [Errno 22] invalid mode ('wb') or filename: 'F:\\Fir

Re: Loop problem while generating a new value with random.randint()

2010-02-15 Thread Paulo Repreza
Thanks for the help! Using while True helps alot! Paulo Repreza -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Optimization

2010-02-15 Thread mukesh tiwari
On Feb 15, 1:07 am, Steve Howell wrote: > On Feb 14, 11:52 am, Mark Dickinson wrote: > > > > > > > On Feb 14, 4:53 pm, mukesh tiwari > > wrote: > > > > Hello everyone. I am new to python and previously i did programming in > > > c/c++.Could some one please help me to improve the run time for thi

Re: Which mock library do you prefer?

2010-02-15 Thread Steve Howell
On Feb 15, 8:15 am, Lacrima wrote: > Hello! > > I am newbie mastering test driven development. I can't clarify myself > which mock library to use. > There are number of them and which one do you prefer? > > Two libraries that attracted my attention are: > * minimock > * dingus > As for me the late

Re: Executing a command from within python using the subprocess module

2010-02-15 Thread Nobody
On Tue, 16 Feb 2010 00:11:36 +0800, R (Chandra) Chandrasekhar wrote: > One other question I forgot to ask is this why is there a terminal > backslash in > >> subprocess.call("""\ > > Removing the backslash makes the function fail. > > I wonder why, because """ is supposed to allow multi-line s

Re: Which mock library do you prefer?

2010-02-15 Thread Phlip
Lacrima wrote: > I am newbie mastering test driven development. I can't clarify myself > which mock library to use. > There are number of them and which one do you prefer? > > Two libraries that attracted my attention are: > * minimock > * dingus > As for me the latest one, dingus, is the easiest

Re: Fighting with subprocess.Popen

2010-02-15 Thread Nobody
On Sun, 14 Feb 2010 21:43:22 +0100, Christian Heimes wrote: >> Below is a test case that demonstrates this. Tests 1 & 2 concatenate the >> command and the argument, Tests 3 & 4 mimic the python docs and use the form >> Popen(["mycmd", "myarg"], ...), which never seems to work. > > It doesn't work

Re: get a field

2010-02-15 Thread Steve Holden
mierdatutis mi wrote: > Hi, > > I have this: > > pe="http://www.rtve.es/mediateca/videos/20100211/saber-comer---patatas-castellanas-costillas-11-02-10/691046.shtml"; > > > I would like to extract this: 691046.shtml > > But is dynamically. Not always have the same lenght the string. > > Could

Re: get a field

2010-02-15 Thread Jean-Michel Pichavant
mierdatutis mi wrote: Hi, I have this: pe="http://www.rtve.es/mediateca/videos/20100211/saber-comer---patatas-castellanas-costillas-11-02-10/691046.shtml"; I would like to extract this: 691046.shtml But is dynamically. Not always have the same lenght the string. Could you help me how could

Re: Executing a command from within python using the subprocess module

2010-02-15 Thread Peter Otten
R (Chandra) Chandrasekhar wrote: > Peter Otten wrote: > >> import subprocess >> >> def convert(width=5, height=30, colors=['#abcdef', '#456789'], >> filename="tmp/image with space in its name.png"): >> lookup = locals() >> assert all("\n" not in str(s) for s in lookup.values(

Re: Loop problem while generating a new value with random.randint()

2010-02-15 Thread Steve Holden
Paulo Repreza wrote: > Greetings, > > I'm having problems with a little script that I'm trying to finish, I > don't know if I'm in the right track but I know somebody is going to > help me. > > The script: > > # Import modules random for function randint > > import random > > # Generating a co

Re: Loop problem while generating a new value with random.randint()

2010-02-15 Thread Arnaud Delobelle
Jean-Michel Pichavant writes: > Paulo Repreza wrote: >> Greetings, >> >> I'm having problems with a little script that I'm trying to finish, >> I don't know if I'm in the right track but I know somebody is going >> to help me. >> >> The script: >> >> # Import modules random for function randint >

Re: Executing a command from within python using the subprocess module

2010-02-15 Thread R (Chandra) Chandrasekhar
Alf P. Steinbach wrote: * R (Chandra) Chandrasekhar: width = 5 height = 30 colors = ['#abcdef]', '#456789'] filename = "/tmp/image.png" # I want to get the equivalent of variable interpolation in Perl # so that the command # # convert -size 5x30 gradient:#abcdef-#456789 /tmp/image.png # # is d

Re: Loop problem while generating a new value with random.randint()

2010-02-15 Thread Bruno Desthuilliers
Jean-Michel Pichavant a écrit : Paulo Repreza wrote: Greetings, I'm having problems with a little script that I'm trying to finish, I don't know if I'm in the right track but I know somebody is going to help me. (snip - problem already addressed by Jean-Michel...) while var != ranum:

Re: Executing a command from within python using the subprocess module

2010-02-15 Thread Steve Holden
R (Chandra) Chandrasekhar wrote: > Peter Otten wrote: >> import subprocess >> >> def convert(width=5, height=30, colors=['#abcdef', '#456789'], >> filename="tmp/image with space in its name.png"): >> lookup = locals() >> assert all("\n" not in str(s) for s in lookup.values()) >>

Re: how to structure a directory with many scripts and shared code

2010-02-15 Thread sstein...@gmail.com
On Feb 15, 2010, at 11:06 AM, Jean-Michel Pichavant wrote: > 3/ make sure your working copy of myBeautifulPackage is in your PYTHONPATH. Or, make a simple setup.py which imports distribute or setuptools and use: # python setup.py develop which will put your code into the PYTHONPATH by

Re: how to structure a directory with many scripts and shared code

2010-02-15 Thread Benedict Verheyen
Jean-Michel Pichavant wrote: > Hi, > > 1/ Provide the output of the error so we can provide some useful help. > 2/ Embed your structure into a package. Names like 'tools', 'lib', > 'mail', 'log' are too generic and will clash with other badly designed > module/package names. Choose a name for yo

Which mock library do you prefer?

2010-02-15 Thread Lacrima
Hello! I am newbie mastering test driven development. I can't clarify myself which mock library to use. There are number of them and which one do you prefer? Two libraries that attracted my attention are: * minimock * dingus As for me the latest one, dingus, is the easiest (see this screencast: h

get a field

2010-02-15 Thread mierdatutis mi
Hi, I have this: pe=" http://www.rtve.es/mediateca/videos/20100211/saber-comer---patatas-castellanas-costillas-11-02-10/691046.shtml " I would like to extract this: 691046.shtml But is dynamically. Not always have the same lenght the string. Could you help me how could I do extract this in py

Re: Loop problem while generating a new value with random.randint()

2010-02-15 Thread Jean-Michel Pichavant
Paulo Repreza wrote: Greetings, I'm having problems with a little script that I'm trying to finish, I don't know if I'm in the right track but I know somebody is going to help me. The script: # Import modules random for function randint import random # Generating a constant. var = 65 #

Re: Executing a command from within python using the subprocess module

2010-02-15 Thread R (Chandra) Chandrasekhar
Peter Otten wrote: import subprocess def convert(width=5, height=30, colors=['#abcdef', '#456789'], filename="tmp/image with space in its name.png"): lookup = locals() assert all("\n" not in str(s) for s in lookup.values()) subprocess.call("""\ convert -size {width}x{heig

Re: how to structure a directory with many scripts and shared code

2010-02-15 Thread Jean-Michel Pichavant
Benedict Verheyen wrote: Hi, i wanted to ask how you guys structure your code. I mainly have scripts that automate small tasks. These scripts use a common set of utility code. My code is structured like this, for example: script_1.py script_2.py script_3.py tools\ |->__init__.py |->logu

Loop problem while generating a new value with random.randint()

2010-02-15 Thread Paulo Repreza
Greetings, I'm having problems with a little script that I'm trying to finish, I don't know if I'm in the right track but I know somebody is going to help me. The script: # Import modules random for function randint import random # Generating a constant. var = 65 # Generating a random number

Re: Executing a command from within python using the subprocess module

2010-02-15 Thread John Posner
On 2/15/2010 7:35 AM, R (Chandra) Chandrasekhar wrote: Dear Folks, I want to execute a command from within python using the subprocess module. Coming from a Perl background, I thought I could use variable interpolation in strings, but found that this is neither supported Yes, it is: see the u

Re: Time out a regular expression in Python 2.6.4?

2010-02-15 Thread Steve Holden
pyt...@bdurham.com wrote: > Is there any way to time out a regular expression in Python 2.6.4? > > Motiviation: Our application allows users to enter regular expressions > as validation criteria. If a user enters a pathological regular > expression, we would like to timeout the evaluation of this

Re: Executing a command from within python using the subprocess module

2010-02-15 Thread R (Chandra) Chandrasekhar
Peter Otten wrote: import subprocess def convert(width=5, height=30, colors=['#abcdef', '#456789'], filename="tmp/image with space in its name.png"): lookup = locals() assert all("\n" not in str(s) for s in lookup.values()) subprocess.call("""\ convert -size {width}x{hei

Time out a regular expression in Python 2.6.4?

2010-02-15 Thread python
Is there any way to time out a regular expression in Python 2.6.4? Motiviation: Our application allows users to enter regular expressions as validation criteria. If a user enters a pathological regular expression, we would like to timeout the evaluation of this expression after a short period of t

how to structure a directory with many scripts and shared code

2010-02-15 Thread Benedict Verheyen
Hi, i wanted to ask how you guys structure your code. I mainly have scripts that automate small tasks. These scripts use a common set of utility code. My code is structured like this, for example: script_1.py script_2.py script_3.py tools\ |->__init__.py |->logutils.py |->mailutils.py

Re: constructor overwrite

2010-02-15 Thread Bruno Desthuilliers
Mug a écrit : hi ,i had a problem on constructor overwrite: i have something like: class obj: def __init__(self, x=100, y=None): if y is None: self.x=x else: self.y=y With such an initializer, you'll have instances with an attribute 'y' and no attribute 'x', and in

Re: constructor overwrite

2010-02-15 Thread Steve Holden
Mug wrote: > hi ,i had a problem on constructor overwrite: > i have something like: > > class obj: > def __init__(self, x=100, y=None): > if y is None: > self.x=x > else: > self.y=y > so i can call : > objet = obj() # x=100 y=None > or > objet = obj(40) # x= 40 y=None

Re: constructor overwrite

2010-02-15 Thread Arnaud Delobelle
Mug writes: > hi ,i had a problem on constructor overwrite: > i have something like: > > class obj: > def __init__(self, x=100, y=None): > if y is None: > self.x=x > else: > self.y=y > so i can call : > objet = obj() # x=100 y=None > or > objet = obj(40) # x= 40 y=Non

constructor overwrite

2010-02-15 Thread Mug
hi ,i had a problem on constructor overwrite: i have something like: class obj: def __init__(self, x=100, y=None): if y is None: self.x=x else: self.y=y so i can call : objet = obj() # x=100 y=None or objet = obj(40) # x= 40 y=None but if i do : objet = obj('not cool'

Re: Replace various regex

2010-02-15 Thread Jean-Michel Pichavant
Martin wrote: On Feb 15, 2:03 pm, Jean-Michel Pichavant wrote: Martin wrote: Hi, I am trying to come up with a more generic scheme to match and replace a series of regex, which look something like this... 19.01,16.38,0.79,1.26,1.00 ! canht_ft(1:npft) 5.0, 4.0, 2.0, 4

Re: Replace various regex

2010-02-15 Thread Martin
On Feb 15, 2:03 pm, Jean-Michel Pichavant wrote: > Martin wrote: > > Hi, > > > I am trying to come up with a more generic scheme to match and replace > > a series of regex, which look something like this... > > > 19.01,16.38,0.79,1.26,1.00 ! canht_ft(1:npft) > > 5.0, 4.0, 2.0, 4.0, 1.0 !

CFP - SLE'2010

2010-02-15 Thread Anthony Cleve
CALL FOR PAPERS 3rd International Conference on Software Language Engineering SLE 2010 12-13 Oct 2010 -- Eindhoven, The Netherlands http://planet-sl.org/sle2010/ Co-located with the International Conference on Generative Programming and Component Engineering (GPCE'10). -

Talking with ebay using Python

2010-02-15 Thread starglider develop
Hi, I need a way of talking with the eBay API: Made search, Ask for item status. What can it be done, and where can I get the info. Thank you in advance for your help. -- http://mail.python.org/mailman/listinfo/python-list

Re: Replace various regex

2010-02-15 Thread Jean-Michel Pichavant
Martin wrote: Hi, I am trying to come up with a more generic scheme to match and replace a series of regex, which look something like this... 19.01,16.38,0.79,1.26,1.00 ! canht_ft(1:npft) 5.0, 4.0, 2.0, 4.0, 1.0 ! lai(1:npft) Ideally match the pattern to the right of the "!" sign (e.g

Re: trouble installing matplotlib - syslibroot: multiply specified

2010-02-15 Thread katrine
On Feb 15, 12:20 pm, "Alf P. Steinbach" wrote: > * katrine: > > > > > Hope you guys don't mind a question about building matplotlib from a > > biologist who wants to learn how to use python. > > > I am trying to install matplotlib on my mac with OS X 10.4.11, using > > python 2.6.4 and Xcode 2.2.1

Re: Printing with raw_input

2010-02-15 Thread Shashwat Anand
raw_input uses sys.stderr I guess ? On Mon, Feb 15, 2010 at 5:35 PM, Peter Otten <__pete...@web.de> wrote: > Joan Miller wrote: > > >> > Does `raw_input` uses internally `sys.stdout.write`? > > > It was to display the output inside a GUI app. overriding > > `sys.stdout`. And as `print` also uses

  1   2   >