On 26 Dic, 19:24, Ciccio wrote:
> Try this:
> 1) define a function 'foo' in a script
> 2) runfile the script from a shell
> 3) do 'inspect.getsource(foo)'
> 4) change the source of 'foo'
> 5) runfile the script from the same shell
> 6) do 3 aga
Try this:
1) define a function 'foo' in a script
2) runfile the script from a shell
3) do 'inspect.getsource(foo)'
4) change the source of 'foo'
5) runfile the script from the same shell
6) do 3 again
On my 2.6.6 getsource returns twice the same code. I couldn't find
very much about this, is there
I extracted an isolated problem from a slightly more complex
situation, that's why I'm using REs.
Thank you all for your help, my problem is now solved.
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
suppose I have:
s='a=b, c=d'
and I want to extract sub-strings a,b,c and d from s (and in general
from any longer list of such comma separated pairs).
Some failed attempts:
In [12]: re.findall(r'(.+)=(.+)', s)
Out[12]: [('a=b, c', 'd')]
In [13]: re.findall(r'(.+?)=(.+)', s)
Out[13]:
Thank you all, this was timely and helpful.
francesco
--
http://mail.python.org/mailman/listinfo/python-list
Il 09/11/2010 16:47, Terry Reedy ha scritto:
On 11/9/2010 9:14 AM, Ciccio wrote:
Hi all,
hope you can help me understanding why the following happens:
In [213]: g = {'a': ['a1','a2'], 'b':['b1','b2']}
In [214]: rg = dic
Hi all,
hope you can help me understanding why the following happens:
In [213]: g = {'a': ['a1','a2'], 'b':['b1','b2']}
In [214]: rg = dict.fromkeys(g.keys(),[])
In [215]: rg
Out[215]: {'a': [], 'b': []}
In [216]: rg['a'].append('x')
In [217]: rg
Out[217]: {'a': ['x'], 'b': ['x']}
What I meant
Dear all,
could you give me an help ?
I would to upload a file from web using Python. Is there a simple way to do
this? I'm using the cgi module and python 2.3. The file to be uploaded is a text
file.
Thank you for all your suggestions,
Ernesto
---
On 7/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
On 7/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Dear all,
I'm executing a program by os.spawnv() function. However the program print out
several things. I would to capture this output, but I don't know how.
Could you give me
On 7/19/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
Dear all,
I'm executing a program by os.spawnv() function. However the program print out
several things. I would to capture this output, but I don't know how.
Could you give me a suggestion?
Thank you
Ernesto
Hi Ernesto
could you us
Dear all,
I'm executing a program by os.spawnv() function. However the program print out
several things. I would to capture this output, but I don't know how.
Could you give me a suggestion?
Thank you
Ernesto
-
This mail sent through IMP: http:/
Dear all,
I'm using python to manage a web-site. In particular, a user insert specific
parameters in a form and, then, I recover all parameters and run an executable
file according to the user parameters. The output is finally showed in a new
web-page.
The problem is when I need to run the execu
Dear python users,
I have an account on a Linux Cluster. I installed python version 2.3.5 on my
account. I need to install the module MySQL-python to interact with a MySQL
server already installed on the cluster.
However, I read the README file but running
python setup.py build
the system f
13 matches
Mail list logo