Pydev 1.3.0 Released

2007-03-12 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.3.0 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions:

Re: Watching a file another app is writing

2007-03-12 Thread Gordon Airporte
Nick Vatamaniuc wrote: You might need to look at pywin32 for Windows specific ways to listen to file changed event. On Unix a quick shortcut would be to simply read the output of 'tail - f file' command... Ah, I forgot I have Cygwin installed, so I do have tail. Unfortunately Windows

using python to visit web sites and print the web sites image to files

2007-03-12 Thread imx
Hi there, I wonder whether python can be used to simulate a real user to do the following: 1) open a web site in a browser; 2) printscreen, so to copy the current active window image to clipboard; 3) save the image file to a real file Any pointer will be apprieciated! Xiong --

can not load mod_python on apache

2007-03-12 Thread liecto
winxp sp2 modpython 3.3.1 apache 2.2.4 python 2.5 when i start apache ,it failed. and the error is == The Apache service named reported the following error: httpd.exe: Syntax error on line 166 of F:/mylg/apache-more/local/apache/Apache2/conf/httpd.conf: Cannot load

Re: Putting Metaclasses to Work

2007-03-12 Thread Michele Simionato
On Mar 11, 7:31 pm, Alan Isaac [EMAIL PROTECTED] wrote: Forman's book is out of print. Is there a good substitute? Thanks, Alan Isaac The book is about a non-standard implementation of C++ featuring metaclasses. It it not that relevant if you are interested in metaclasses in Python. You can

Re: UTF-8

2007-03-12 Thread Eric Brunel
On Sat, 10 Mar 2007 15:00:04 +0100, Olivier Verdier [EMAIL PROTECTED] wrote: [snip] The default encoding i wish to set is UTF-8 since it encodes unicode and is nowadays the standard encoding. I can't agree with that: there are still many tools completely ignoring the encoding problem, and

New to Python

2007-03-12 Thread Alberto Vieira Ferreira Monteiro
Hi, I am new to Python, how stupid can be the questions I ask? For example, how can I add (mathematically) two tuples? x = (1,2) y = (3,4) How can I get z = (1 + 3, 2 + 4) ? Alberto Monteiro -- http://mail.python.org/mailman/listinfo/python-list

Re: New to Python

2007-03-12 Thread Bert Heymans
On Mar 12, 3:02 am, Alberto Vieira Ferreira Monteiro [EMAIL PROTECTED] wrote: Hi, I am new to Python, how stupid can be the questions I ask? For example, how can I add (mathematically) two tuples? x = (1,2) y = (3,4) How can I get z = (1 + 3, 2 + 4) ? Alberto Monteiro Alberto - List

Re: New to Python

2007-03-12 Thread Paul Rubin
Alberto Vieira Ferreira Monteiro [EMAIL PROTECTED] writes: Hi, I am new to Python, how stupid can be the questions I ask? Well, it's a matter of how you ask them, but anyway newcomers are welcome here. For example, how can I add (mathematically) two tuples? x = (1,2) y = (3,4) How can I get

Re: Watching a file another app is writing

2007-03-12 Thread Gabriel Genellina
En Mon, 12 Mar 2007 04:25:48 -0300, Gordon Airporte [EMAIL PROTECTED] escribió: Nick Vatamaniuc wrote: You might need to look at pywin32 for Windows specific ways to listen to file changed event. This article explains it in detail:

Re: Are Lists thread safe?

2007-03-12 Thread Duncan Booth
Gabriel Genellina [EMAIL PROTECTED] wrote: INPLACE_ADD would call MyList.__iadd__ which you have wrapped. But you have a race condition between that moment and the following STORE_ATTR, a context switch may happen in the middle. It may not be possible to create an absolutely thread-safe

Re: Watching a file another app is writing

2007-03-12 Thread Roel Schroeven
Gordon Airporte schreef: Nick Vatamaniuc wrote: You might need to look at pywin32 for Windows specific ways to listen to file changed event. On Unix a quick shortcut would be to simply read the output of 'tail - f file' command... Ah, I forgot I have Cygwin installed, so I do have

Re: Weekly Python Patch/Bug Summary

2007-03-12 Thread Georg Brandl
Kurt B. Kaiser schrieb: Patch / Bug Summary ___ Patches : 380 open (-36) / 3658 closed (+65) / 4038 total (+29) We should really try to keep the numbers in this magnitude :) Georg -- http://mail.python.org/mailman/listinfo/python-list

Re: distributed queue?

2007-03-12 Thread A.T.Hofkamp
On 2007-03-10, Paul Rubin http wrote: Does anyone have an implementation of a distributed queue? I.e. I have a long running computation f(x) and I'd like to be able to evaluate it (for different values of x) on a bunch of different batchlib and the underlying exec_proxy are designed to handle

Re: New to Python

2007-03-12 Thread Stargaming
Bert Heymans schrieb: On Mar 12, 3:02 am, Alberto Vieira Ferreira Monteiro [EMAIL PROTECTED] wrote: Hi, I am new to Python, how stupid can be the questions I ask? For example, how can I add (mathematically) two tuples? x = (1,2) y = (3,4) How can I get z = (1 + 3, 2 + 4) ? Alberto Monteiro

Using .NET COM-objects and GetType

2007-03-12 Thread svwi
Hi. I need to dynamically retreive the type name of a COM-object exposed by a C# COM server. This was previously successfully done in .NET framwork 1.X with the method GetType(), inherited by all classes from System.Object. Moving to .NET framework 2.0, it stopped working. All I get from

Re: New to Python

2007-03-12 Thread Diez B. Roggisch
Alberto Vieira Ferreira Monteiro wrote: Hi, I am new to Python, how stupid can be the questions I ask? For example, how can I add (mathematically) two tuples? x = (1,2) y = (3,4) How can I get z = (1 + 3, 2 + 4) ? Others have shown you ways to accomplish this, and stated correctly that

programmatically manipulation environment variables of the calling shell

2007-03-12 Thread Maxim Veksler
Hello list, I'm trying to write a python script that would allow me to manipulate shell variables of the calling shell. I'm trying to write some logic that would know to add LD_LIBRARY_PATH to the users environment. In bash this is done with export, can I do this with python? (If at all possible

Re: Object instance reporting to a container class instance

2007-03-12 Thread Greenberg
Daniel Lipovetsky wrote: I would like for an object to report to a container object when a new instance is created or deleted. I could have a container object that is called when a new instance is created, as below. I've run into a similar problem before, in my case it was easiest to allow

Re: programmatically manipulation environment variables of the calling shell

2007-03-12 Thread Diez B. Roggisch
Maxim Veksler wrote: Hello list, I'm trying to write a python script that would allow me to manipulate shell variables of the calling shell. I'm trying to write some logic that would know to add LD_LIBRARY_PATH to the users environment. In bash this is done with export, can I do this

Re: can not load mod_python on apache

2007-03-12 Thread Bruno Desthuilliers
liecto a écrit : winxp sp2 modpython 3.3.1 apache 2.2.4 python 2.5 when i start apache ,it failed. and the error is == The Apache service named reported the following error: httpd.exe: Syntax error on line 166 of F:/mylg/apache-more/local/apache/Apache2/conf/httpd.conf:

Re: New to Python

2007-03-12 Thread Alberto Monteiro
I wrote: Hi, I am new to Python, how stupid can be the questions I ask? For example, how can I add (mathematically) two tuples? x = (1,2) y = (3,4) How can I get z = (1 + 3, 2 + 4) ? Wow, I really didn't expect that my silly little newbie question would get so many _different_ answers!

Re: programmatically manipulation environment variables of the calling shell

2007-03-12 Thread Gerard Flanagan
On Mar 12, 11:33 am, Maxim Veksler [EMAIL PROTECTED] wrote: Hello list, I'm trying to write a python script that would allow me to manipulate shell variables of the calling shell. I'm trying to write some logic that would know to add LD_LIBRARY_PATH to the users environment. In bash this is

Re: number generator

2007-03-12 Thread Duncan Booth
[EMAIL PROTECTED] (Alex Martelli) wrote: Without any specification regarding the distributions required for the 5 random numbers it's really impossible to say whether these are better or worse than other proposed solutions. FWIW, I decided it would be fun to see what kind of implementation I

Re: programmatically manipulation environment variables of the calling shell

2007-03-12 Thread Tommy Nordgren
On 12 mar 2007, at 11.33, Maxim Veksler wrote: Hello list, I'm trying to write a python script that would allow me to manipulate shell variables of the calling shell. I'm trying to write some logic that would know to add LD_LIBRARY_PATH to the users environment. In bash this is done with

Re: programmatically manipulation environment variables of the calling shell

2007-03-12 Thread Maxim Veksler
On 3/12/07, Tommy Nordgren [EMAIL PROTECTED] wrote: On 12 mar 2007, at 11.33, Maxim Veksler wrote: Hello list, I'm trying to write a python script that would allow me to manipulate shell variables of the calling shell. I'm trying to write some logic that would know to add

Re: number generator

2007-03-12 Thread Nick Craig-Wood
Paul Rubin http wrote: The fencepost method still seems to be simplest: t = sorted(random.sample(xrange(1,50), 4)) print [(j-i) for i,j in zip([0]+t, t+[50])] Mmm, nice. Here is another effort which is easier to reason about the distribution produced but not as efficient. def

Re: Bitpacked Data

2007-03-12 Thread Nick Craig-Wood
none wrote: i need to interface python with a bitpacked data file, the structure recorded in the file is the following: struct { var_1 4bit var_2 6bit var_3 2bit var_3 4bit } how can read the struct and convert data into dictionary You could try Construct

Re: How to modify the source of a python file inside a python egg file?

2007-03-12 Thread Diez B. Roggisch
[EMAIL PROTECTED] wrote: How to modify the source of a python file inside a python egg file? I can see the file by unzipping it, but how can I package it back as a python egg file after my modification. So far I never tried this - but how about zipping it? Besides, you can install eggs

Re: programmatically manipulation environment variables of the calling shell

2007-03-12 Thread Michal 'vorner' Vaner
Hello, On Mon, Mar 12, 2007 at 11:40:11AM +0100, Diez B. Roggisch wrote: Maxim Veksler wrote: I'm trying to write a python script that would allow me to manipulate shell variables of the calling shell. I'm trying to write some logic that would know to add LD_LIBRARY_PATH to the users

Re: programmatically manipulation environment variables of the calling shell

2007-03-12 Thread Diez B. Roggisch
Michal 'vorner' Vaner wrote: Hello, On Mon, Mar 12, 2007 at 11:40:11AM +0100, Diez B. Roggisch wrote: Maxim Veksler wrote: I'm trying to write a python script that would allow me to manipulate shell variables of the calling shell. I'm trying to write some logic that would know to add

Single string print statements on multiple lines.

2007-03-12 Thread HeEm
In my 100 level CS course, I was asked to create multiple lines of output within a single string. Of course I know how to: print I am print a python print newbie. How can I get this accomplished using a single string (assuming this means a one line statement). Is there and escape character or

Re: Single string print statements on multiple lines.

2007-03-12 Thread Diez B. Roggisch
HeEm wrote: In my 100 level CS course, I was asked to create multiple lines of output within a single string. Of course I know how to: print I am print a python print newbie. How can I get this accomplished using a single string (assuming this means a one line statement). Is there

Re: setuptools and code.google.com

2007-03-12 Thread Jorge Godoy
[EMAIL PROTECTED] (Alex Martelli) writes: Hey, I'd just love to make it as easy as possible to get gmpy -- that's why I (shudder!-) even build and upload Windows installers... Brave man! :-) OK, the .zip file IS there -- I don't know how to build .egg ones but of course I could study up on

Re: How to modify the source of a python file inside a python egg file?

2007-03-12 Thread Jorge Godoy
[EMAIL PROTECTED] [EMAIL PROTECTED] writes: How to modify the source of a python file inside a python egg file? I can see the file by unzipping it, but how can I package it back as a python egg file after my modification. The correct way is to download the source, make your changes and

Re: New to Python

2007-03-12 Thread Paulo da Silva
Alberto Vieira Ferreira Monteiro escreveu: Hi, I am new to Python, how stupid can be the questions I ask? For example, how can I add (mathematically) two tuples? x = (1,2) y = (3,4) How can I get z = (1 + 3, 2 + 4) ? Alberto Monteiro I think that what you want is numpy. I don't know too

Re: Single string print statements on multiple lines.

2007-03-12 Thread MonkeeSage
HeEm wrote: In my 100 level CS course, I was asked to create multiple lines of output within a single string. Of course I know how to: If this is for a CS course, you shouldn't really be cheating and asking for an answer here, should you? I mean, the whole point of taking (and paying for!) a

Re: New to Python

2007-03-12 Thread Dustan
On Mar 12, 5:07 am, Alberto Monteiro [EMAIL PROTECTED] wrote: I wrote: Hi, I am new to Python, how stupid can be the questions I ask? For example, how can I add (mathematically) two tuples? x = (1,2) y = (3,4) How can I get z = (1 + 3, 2 + 4) ? Wow, I really didn't expect that my

Re: New to Python

2007-03-12 Thread Alberto Monteiro
Dustan wrote: What is the best way to get documentation about the functions and classes of python? I tried to google, but usually I can just find the __doc__ of the objects, without examples or anything that can help me use it. Refer to this as a reference: http://docs.python.org/ I

Philippine Celebrities Sex Tips

2007-03-12 Thread karajitsu
you can find it here the Philippine Sexy Celebrities Sex Tips at http://www.pinoysexguru.blogspot.com -- http://mail.python.org/mailman/listinfo/python-list

Re: number generator

2007-03-12 Thread Carsten Haese
On Sat, 2007-03-10 at 22:27 -0500, Terry Reedy wrote: Anton Vredegoor [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] | Terry Reedy wrote: | | Partitioning positive count m into n positive counts that sum to m is a | standard combinatorial problem at least 300 years old. The

Re: Formatted Input

2007-03-12 Thread Larry Bates
Deep wrote: Hi all, I am a newbie to python I have an input of form one number space another number ie. 4 3 how can i assign these numbers to my variables?? Or with list comprehension: n1, n2 = [int(n) for n in raw_input().split()] Neither of these methods checks for errors (e.g.

Re: How to test if a key in a dictionary exists?

2007-03-12 Thread Larry Bates
Frank wrote: Hi, does anyone know how one can test if, e.g., a dictionary 'name' has a key called 'name_key'? This would be possible: keys_of_names = names.keys() L = len(keys_of_names) for i in range(L): if keys_of_names[i] == name_key: print 'found' But certainly not

Re: PIL: reading bytes from Image

2007-03-12 Thread Larry Bates
cyberco wrote: Thanks, I've tried the StringIO option as follows: = img = Image.open('/some/path/img.jpg') img.thumbnail((640,480)) file = StringIO, StringIO() img.save(file, 'JPEG') = But it gives me:

Re: New to Python

2007-03-12 Thread Diez B. Roggisch
I do have previous experience with programming (much more than it's reasonable for one lifetime, BTW. I have the curse of never forgetting things I learn, so sometimes I catch myself thinking in archaic and extinct languages), but I found python particularly hard to learn (not as much as

Re: New to Python

2007-03-12 Thread Lucas Torri
Something like that? z = tuple(map(lambda x,y: x+y, x, y)) On 3/11/07, Alberto Vieira Ferreira Monteiro [EMAIL PROTECTED] wrote: Hi, I am new to Python, how stupid can be the questions I ask? For example, how can I add (mathematically) two tuples? x = (1,2) y = (3,4) How can I get z = (1 +

backslashes in lists

2007-03-12 Thread Fabio Gomes
Hi list, I'm trying to use a string with backslashes in a list. But Python parses strings in lists with repr(). alist = ['a', 'b', 'c:\some\path'] alist['a', 'b', 'c:\\some\\path'] print alist['a', 'b', 'c:\\some\\path'] I already tried str() and raw (r) but it didn't work. All I want is to

Re: backslashes in lists

2007-03-12 Thread Lucas Torri
The backslash is a key to enter especial characters, like breakline: '\n' There is two backslashes cause of this especial condition of this char, but if you try print the specific string you will see that only one backslash remain: print alist[2] On 3/12/07, Fabio Gomes [EMAIL PROTECTED]

RE: backslashes in lists

2007-03-12 Thread Fabio Gomes
Yes, Luca. I noticed that printing the list item will show the string as expected. But I need to print the entire list in the script I'm writing and doing that, the list will will be repr()'ed. Is there any way to print the entire list without being parsed by repr()? Date: Mon, 12 Mar 2007

Re: backslashes in lists

2007-03-12 Thread Lucas Torri
I don't know how ugly this look like, but { print str(alist).replace('', '\\') } works... On 3/12/07, Fabio Gomes [EMAIL PROTECTED] wrote: Yes, Luca. I noticed that printing the list item will show the string as expected. But I need to print the entire list in the script I'm writing

RE: backslashes in lists

2007-03-12 Thread Carsten Haese
On Mon, 2007-03-12 at 18:08 +0300, Fabio Gomes wrote: Yes, Luca. I noticed that printing the list item will show the string as expected. But I need to print the entire list in the script I'm writing and doing that, the list will will be repr()'ed. Is there any way to print the entire list

Re: Need help with a string plz! (newbie)

2007-03-12 Thread Grant Edwards
On 2007-03-12, Hendrik van Rooyen [EMAIL PROTECTED] wrote: Grant Edwards [EMAIL PROTECTED] wrote: Oh, thanks for the advice then. And as for Grant..look forward to seeing more of your posts. YOW! - some recognition at last! :) I see somebody pays attention to sigs -- which, BTW,

Re: Python in a desktop environment

2007-03-12 Thread Grant Edwards
On 2007-03-11, David Cramer [EMAIL PROTECTED] wrote: On Mar 10, 10:52 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: David Cramer wrote: If you had an application that you were about to begin development on which you wanted to be cross platform (at least Mac and Windows), would you

RE: backslashes in lists

2007-03-12 Thread Fabio Gomes
Nice, Lucas. But help me again, please. What about echoing the list: str(alist).replace('','\\')['a', 'b', 'c:\\some\\path'] Because in my script I'm echoing the list to mount lists into lists, like: list1 = ['name', 'test'] list2 = ['path', 'c:\some\path'] list = [list1, list2] print

nonlinear interpolation

2007-03-12 Thread Michele Simionato
I want to interpolate a data distribution with a function depending on various parameters; the function can be a Gaussian, a Breit-Wigner, a custom function. Where should I look? I am getting lost between matplotlib, numeric, numpy, scientific python, scipy, etc. etc. Any pointer would be well

Re: Python in a desktop environment

2007-03-12 Thread Bruno Desthuilliers
Grant Edwards a écrit : (snip) Python is _far_ more robust than C++. I wouldn't say so - robustness is a quality of a program, not of a language !-) -- http://mail.python.org/mailman/listinfo/python-list

nonlinear interpolation

2007-03-12 Thread Michele Simionato
I want to interpolate a data distribution with a function depending on various parameters; the function can be a Gaussian, a Breit-Wigner, a custom function. Where should I look? I am getting lost between matplotlib, numeric, numpy, scientific python, scipy, etc. etc. Any pointer would be well

Re: Python in a desktop environment

2007-03-12 Thread Grant Edwards
On 2007-03-12, Bruno Desthuilliers [EMAIL PROTECTED] wrote: Grant Edwards a écrit : (snip) Python is _far_ more robust than C++. I wouldn't say so - robustness is a quality of a program, not of a language !-) IMO, robustness is also a quality of a language. In language like C and C++,

Newbie Question : grep

2007-03-12 Thread moogyd
Hello, I am attempting to write my first Python script to extract some information from a file, and place it into another file. (I am trying to find the physical postions of 4 cells within an FPGA) I have a working solution, and would appreciate any comments. for line in lines: if placed in

Re: a better solution for GUI in python

2007-03-12 Thread Chris Mellon
On 3/11/07, Jarek Zgoda [EMAIL PROTECTED] wrote: Bjoern Schliessmann napisał(a): I'd recommend pyGTK. It's easy to use, delivers astonishing results and is perfectly portable as far as I know. And how does it look on Windows? :) On styled Windows XP it looks like any other styled

Re: Python in a desktop environment

2007-03-12 Thread Diez B. Roggisch
Bruno Desthuilliers wrote: Grant Edwards a écrit : (snip) Python is _far_ more robust than C++. I wouldn't say so - robustness is a quality of a program, not of a language !-) Nope. Dealing with dangling references and double frees, complex copy-semantics that change only by a

nonlinear interpolation

2007-03-12 Thread Michele Simionato
I want to interpolate a data distribution with a function depending on various parameters; the function can be a Gaussian, a Breit-Wigner, a custom function. Where should I look? I am getting lost between matplotlib, numeric, numpy, scientific python, scipy, etc. etc. Any pointer would be well

Readline()

2007-03-12 Thread Taylor, Stuart
I have been working on running an external process using subprocess.popen for a few days. The process is ran over the network to another machine. One thing I have found is that if I perform readline() on the stdout it will hang if the process loses connection. I have tried a few things in a test

Re: Newbie Question : grep

2007-03-12 Thread Larry Bates
[EMAIL PROTECTED] wrote: Hello, I am attempting to write my first Python script to extract some information from a file, and place it into another file. (I am trying to find the physical postions of 4 cells within an FPGA) I have a working solution, and would appreciate any comments. for

Re: programmatically manipulation environment variables of the calling shell

2007-03-12 Thread Diez B. Roggisch
Dennis Lee Bieber wrote: On Mon, 12 Mar 2007 12:33:58 +0200, Maxim Veksler [EMAIL PROTECTED] declaimed the following in comp.lang.python: Hello list, I'm trying to write a python script that would allow me to manipulate shell variables of the calling shell. I'm trying to write some logic

Re: nonlinear interpolation

2007-03-12 Thread Paul Rubin
Michele Simionato [EMAIL PROTECTED] writes: Any pointer would be well received :) Dunno about those libs but it helps to understand the mathematical options. Numerical Recipes by Teukolsky et al has understandable, cookbook-like advice about this stuff. I'm told that true numerics gurus scoff

Re: nonlinear interpolation

2007-03-12 Thread Michele Simionato
On Mar 12, 5:28 pm, Paul Rubin http://[EMAIL PROTECTED] wrote: Michele Simionato [EMAIL PROTECTED] writes: Any pointer would be well received :) Dunno about those libs but it helps to understand the mathematical options. Numerical Recipes by Teukolsky et al has understandable,

Re: using python to visit web sites and print the web sites image to files

2007-03-12 Thread [EMAIL PROTECTED]
On Mar 12, 7:32 am, imx [EMAIL PROTECTED] wrote: I wonder whether python can be used to simulate a real user to do the following: 1) open a web site in a browser; 2) printscreen, so to copy the current active window image to clipboard; 3) save the image file to a real file Any pointer will

Re: backslashes in lists

2007-03-12 Thread Lucas Torri
just like the same way, but replace alist - list: str(list).replace('','\\') as the time you call str(object) you will have an object of type string, and you can do whatever you want/could do with it... what are you trying?! isn't more interesting use a hash table? On 3/12/07, Fabio

Re: New to Python

2007-03-12 Thread Lou Pecora
In article [EMAIL PROTECTED], Dustan [EMAIL PROTECTED] wrote: What is the best way to get documentation about the functions and classes of python? I tried to google, but usually I can just find the __doc__ of the objects, without examples or anything that can help me use it. Alberto

Re: Python in a desktop environment

2007-03-12 Thread Bruno Desthuilliers
Diez B. Roggisch a écrit : Bruno Desthuilliers wrote: Grant Edwards a écrit : (snip) Python is _far_ more robust than C++. I wouldn't say so - robustness is a quality of a program, not of a language !-) Nope. Dealing with dangling references and double frees, complex copy-semantics

Re: Newbie Question : grep

2007-03-12 Thread Erik Johnson
[EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] snip - If I increase number of elements I am searching for, then I have more elif...elif. Is there a cleaner solution? I'm not sure exactly what your lines look like, but this script implies that every line that matches 'i_a/i_b/ROM' is

RE: backslashes in lists

2007-03-12 Thread Fabio Gomes
It didn't work. I decided to submit the code in the list.It is a script running with Jython to modify some configurations in the Websphere Application Server that has a Java like command line that interprets jython or jacl. I decided to use Jython.All the properties in that server are stored

Re: Newbie Question : grep

2007-03-12 Thread Erik Johnson
Sorry, I forgot to paste the modified version of my code in the post:. I think this is the same behaviour: for line in lines: if placed in line: if i_a/i_b/ROM/ in line: pos = (line.split()[4]).split(_)[1] found = False for (tag, (start, end)) in

Re: New to Python

2007-03-12 Thread Alberto Monteiro
Diez B. Roggisch wrote: Also, basic things like how does + operate on object xxx are impossible to google search. For which language they are? None :-) And in python you've got the interpreter loop, either explicitly by invoking python on the commandline and entering some statements,

Re: using python to visit web sites and print the web sites image to files

2007-03-12 Thread Michael Bentley
I wonder whether python can be used to simulate a real user to do the following: 1) open a web site in a browser; 2) printscreen, so to copy the current active window image to clipboard; 3) save the image file to a real file Any pointer will be apprieciated! Which OS? --

Re: nonlinear interpolation

2007-03-12 Thread Robert Kern
Michele Simionato wrote: On Mar 12, 5:28 pm, Paul Rubin http://[EMAIL PROTECTED] wrote: Michele Simionato [EMAIL PROTECTED] writes: Any pointer would be well received :) Dunno about those libs but it helps to understand the mathematical options. Numerical Recipes by Teukolsky et al has

Re: backslashes in lists

2007-03-12 Thread Lucas Torri
hehe, só vendo o ['Arquivo de configuracao da arquitetura'] da pra ver que é brasileiro =) I didn't undestand, what didn't worked? I've tryied this, and all went ok: list1 = ['name', 'value'] list2 = ['path', 'c:\some\path'] list3 = [list1, list2] print str(list3).replace('','\\')

Re: Watching a file another app is writing

2007-03-12 Thread John Nagle
Nick Vatamaniuc wrote: On Mar 11, 3:36 pm, Gordon Airporte [EMAIL PROTECTED] wrote: I'm trying to find a way to take a file that another program has opened and writes to periodically, open it simultaneously in Python, and automatically update some of my objects in Python when the file is

Re: Newbie Question : grep

2007-03-12 Thread attn . steven . kuo
On Mar 12, 10:01 am, Erik Johnson [EMAIL PROTECTED] wrote: Sorry, I forgot to paste the modified version of my code in the post:. I think this is the same behaviour: for line in lines: if placed in line: if i_a/i_b/ROM/ in line: pos = (line.split()[4]).split(_)[1]

glob.glob output

2007-03-12 Thread Hitesh
import string import os f = open (c:\\servername.txt, 'r') linelist = f.read() lineLog = string.split(linelist, '\n') lineLog = lineLog [:-1] #print lineLog for l in lineLog: path1 = + l + \\server*\\*\\xtRec* glob.glob(path1) When I run above from command line python, It prints

File locking

2007-03-12 Thread Dr. Who
I'm always disappointed when I find something that Python doesn't handle in a platform independent way. It seems to me that file locking is in that boat. 1. I don't see a way to atomically open a file for writing if and only if it doesn't exist without resorting to os.open and specialized

Re: glob.glob output

2007-03-12 Thread Hitesh
On Mar 12, 1:58 pm, Hitesh [EMAIL PROTECTED] wrote: import string import os f = open (c:\\servername.txt, 'r') linelist = f.read() lineLog = string.split(linelist, '\n') lineLog = lineLog [:-1] #print lineLog for l in lineLog: path1 = + l + \\server*\\*\\xtRec*

Re: Watching a file another app is writing

2007-03-12 Thread Jeremy Sanders
Gordon Airporte wrote: I'm trying to find a way to take a file that another program has opened and writes to periodically, open it simultaneously in Python, and automatically update some of my objects in Python when the file is written to. I can open the file and manually readlines() from it

RE: Watching a file another app is writing

2007-03-12 Thread Vishal Bhargava
What kind of file is it? CSV? -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jeremy Sanders Sent: Monday, March 12, 2007 11:26 AM To: python-list@python.org Subject: Re: Watching a file another app is writing Gordon Airporte wrote: I'm trying to find

Re: Newbie Question : grep

2007-03-12 Thread moogyd
On 12 Mar, 18:55, [EMAIL PROTECTED] wrote: On Mar 12, 10:01 am, Erik Johnson [EMAIL PROTECTED] wrote: Sorry, I forgot to paste the modified version of my code in the post:. I think this is the same behaviour: for line in lines: if placed in line: if i_a/i_b/ROM/ in line:

Re: glob.glob output

2007-03-12 Thread Hitesh
On Mar 12, 2:12 pm, Hitesh [EMAIL PROTECTED] wrote: On Mar 12, 1:58 pm, Hitesh [EMAIL PROTECTED] wrote: import string import os f = open (c:\\servername.txt, 'r') linelist = f.read() lineLog = string.split(linelist, '\n') lineLog = lineLog [:-1] #print lineLog for l in

Re: File locking

2007-03-12 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], Dr. Who wrote: Please let me know if I'm missing something since they seem like normal file operations that I would hope Python would abstract away. I don't think of them as normal operations. They are extra stuff that is not only dependent on the operating system but

Re: Watching a file another app is writing

2007-03-12 Thread Jon Ribbens
In article [EMAIL PROTECTED], John Nagle wrote: On Unix a quick shortcut would be to simply read the output of 'tail - f file' command... tail -f just checks the file size once a second. It's not doing anything exciting. That's not actually always true these days. *BSD, at least, use

Pydev 1.3.0 Released

2007-03-12 Thread Fabio Zadrozny
Hi All, Pydev and Pydev Extensions 1.3.0 have been released Details on Pydev Extensions: http://www.fabioz.com/pydev Details on Pydev: http://pydev.sf.net Details on its development: http://pydev.blogspot.com Release Highlights in Pydev Extensions:

Re: Watching a file another app is writing

2007-03-12 Thread Gordon Airporte
Gabriel Genellina wrote: This article explains it in detail: http://tgolden.sc.sabren.com/python/win32_how_do_i/watch_directory_for_changes.html BTW, it's the top result on Google for python notify file change windows --Gabriel Genellina Ah, excelent. Thank you. I'd started with the

Re: Single string print statements on multiple lines.

2007-03-12 Thread Goldfish
http://www.catb.org/~esr/faqs/smart-questions.html Don't post homework questions. -- http://mail.python.org/mailman/listinfo/python-list

Re: New to Python

2007-03-12 Thread Goldfish
I read http://diveintopython.org/ online, and covered a lot of Python territory nicely with this. Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Watching a file another app is writing

2007-03-12 Thread Gordon Airporte
Vishal Bhargava wrote: What kind of file is it? CSV? It's a hand history file generated by an online poker client, thus it probably keeps it's data pretty much to itself otherwise, and in any case I'm not a Windows programmer so I probably don't have the stomach to get very deep into its

Re: using python to visit web sites and print the web sites image to files

2007-03-12 Thread Goldfish
You can definitely create a web bot with python. It doesn't require that you drive A real web browser. There are libraries to open web pages, scrape their contents, and do downloading. That would make your bot platform neutral. Driving a GUI browser has the risk of being a brittle script that

Re: How to test if a key in a dictionary exists?

2007-03-12 Thread [EMAIL PROTECTED]
On Mar 11, 11:49 pm, John Machin [EMAIL PROTECTED] wrote: On Mar 12, 3:19 pm, [EMAIL PROTECTED] (Alex Martelli) wrote: Paul McGuire [EMAIL PROTECTED] wrote: will be. For instance, when working with data from 0 to 100 and looking for frequencies by decade, you can initialize the

Re: using python to visit web sites and print the web sites image to files

2007-03-12 Thread Alberto Monteiro
Goldfish wrote: I run a mediawiki web site, and found a handy python-based library written to manage it called pywikipediabot at http://sourceforge.net/projects/pywikipediabot/. This sounds interesting. My daughter had a nightmare that a hacker invaded her Orkut and blanked all 1500+

Re: glob.glob output

2007-03-12 Thread Bruno Desthuilliers
Hitesh a écrit : import string import os f = open (c:\\servername.txt, 'r') linelist = f.read() lineLog = string.split(linelist, '\n') lineLog = lineLog [:-1] #print lineLog for l in lineLog: path1 = + l + \\server*\\*\\xtRec* glob.glob(path1) And ? What are you doing

Find the path of a running .py program

2007-03-12 Thread Laszlo Nagy
Hi All! There was a thread here, more than a month ago. It was about finding the path of a .py file. I suggested os.abspath(__file__). Others told that sys.argv[0] is better. I was not sure why I did not like that solution. Now I ran into the problem again, and I now I remember what is the

Re: threading and iterator crashing interpreter

2007-03-12 Thread Rhamphoryncus
On Mar 11, 8:35 am, Janto Dreijer [EMAIL PROTECTED] wrote: On Mar 11, 3:27 pm, Gabriel Genellina [EMAIL PROTECTED] wrote: At least, the problem of using the same generator from different threads still remains, if you don't use my modified code. In general, when using multiple threads you

  1   2   >