for l in file('file.txt','r')
if ' DIHED ' in l ]
mean = sum(vals) / len(vals)
print vals
print mean
Glauco
--
http://mail.python.org/mailman/listinfo/python-list
Neal Becker ha scritto:
Is there any canned iterator adaptor that will
transform:
in = [1,2,3]
into:
out = [(1,2,3,4), (5,6,7,8),...]
That is, each time next() is called, a tuple of the next N items is
returned.
http://stackoverflow.com/questions/312443/how-do-you-split-a-list-into-
Steven D'Aprano ha scritto:
On Tue, 30 Dec 2008 11:53:17 +0100, Glauco wrote:
thanks brother
i mean how do i particularly assign (u = this)
(y = is)
in the strings up there. i have been able to split strings with any
character sign.
If i'm
#x27;is'),
('t', 'a'),
('fi', 'coding'),
('fo', 'python'),
('first', 'this')]
In [8]: dict(m.groupdict().items())
Out[8]:
{'fi': 'coding',
'first': 'this',
'fo': 'python',
'second': 'is',
'si': 'group',
't': 'a'}
Glauco
--
http://mail.python.org/mailman/listinfo/python-list
david ha scritto:
> On Fri, 07 Dec 2007 16:46:56 +0100, Glauco wrote:
>
>> [EMAIL PROTECTED] ha scritto:
>>> Hello everyone,
>>>
>>> I have written this small utility function for transforming legacy file
>>> to Python dict:
>>>
>
okup( domain ):
if not cache:
cache = dict( [map( lambda x: x.strip(), x.split(':')) for x in
open('/etc/virtual/domainowners','r').readlines()])
return cache.get(domain)
Glauco
--
http://mail.python.org/mailman/listinfo/python-list
: (8, 'EOF occurred in violation of protocol')
I'm in trouble because i've tryed some workaround on httplib.py and
socket.py but they don't work never.
Some soggestion or workaround for bypass this problem?
Thank you anyway.
Glauco
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano wrote:
> On Mon, 18 Jul 2005 12:17:37 +0200, Glauco wrote:
>
>
>>I want to insert a concept of alias in a dict_based class.
>>
>>The idea is to have a facoltative name in the same dict that correspond
>>at the same value. With
;a', 'b')
print mydict
{'a':1, 'b':1}
mydict['b'] = 2
print mydict
{'a':2, 'b':2}
The only idea i have is to implement two dictionary one for convert
name, alias in two keys with the same value (eg.numeric) in the firs
Gerhard Haering wrote:
> On Fri, Jul 08, 2005 at 04:23:50PM +0200, Glauco wrote:
>
>>[...]
>>My problem is to do a middle layer over pycopg for eliminate type
>>casting problem in postgres in all direction.
>>
>>i've resolved this doing a C extension in p
(myint, mytext, maydate)
values
(%s,%s,%s);""" % (myvalue1, myvalue2, myvalue3)
without all time check for none, empty string and so on...
I've seen API of psycopg and s
You can try this :
>>> l = [(2001, 5, 2),(2111,3,3),(1984, 3, 1), (2001, 1, 1)]
>>> l.sort(lambda x = l[0],y = l[1] : cmp((x[1],x[2]),(y[1],y[2])))
- Original Message -
From: "Volker Grabsch" <[EMAIL PROTECTED]>
To:
Sent: Saturday, May 14, 2005 7:09 AM
Subject: Multiple "cmp"s chained on
)
self.myButton.pack()
...
self.myButton.invoke('C1')
-
- Original Message -
From: "Delaney, Timothy C (Timothy)" <[EMAIL PROTECTED]>
To: "Glauco Silva" <[EMAIL PROTECTED]>;
Sent: Wednes
#x27; :
MyClass()
when i call in the console like this:
C:\python MyClass.py
if i using in the __init__ this :
Pmw.RadioSelect(command = self.Function)
so the string "Enter in the Function" is print
Thank you
Glauco
- Original Message -
From: "Scott
27;Function' is call. And i don´t want this.
What´s wrong ?
Thank you
Glauco
- Original Message -
From: "Delaney, Timothy C (Timothy)" <[EMAIL PROTECTED]>
To: "Glauco Silva" <[EMAIL PROTECTED]>;
Sent: Monday, May 02, 2005 8:50 PM
Subject: RE: problem in th
when i creat a RadioButton and put a command =
self.Function , this function is called in the creation of
RadioButton.
It´s right this or it´s wrong ?
Thank you
Glauco
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.11.1 - Release
'],
)
My PYTHONPATH =
C:\Python23;C:\promed2.0\vtk-windows;C:\promed2.0\python
My dir:
##
promed2.0/
setup.cfg
setup.py icons/
docs/
python/
MyMainModule.py
vtk-window/
.0\python
My dir:
##
promed2.0/
setup.cfg
setup.py icons/
docs/
python/
MyMainModule.py
vtk-window/
vtkpython.py
vtkpythontk.py
vtk.pth
vtkCommon.dll
vtkCommonPython.dll
vtkCommonTCL.dll
...
vtk/
###
OS: win 2K
Python ver: 2.3.5py2exe ver:
0.5.4
How can i solve this problem?
Thanks
Glauco
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.16 - Release Date: 18/4/2005
--
http://mail.python.org/mailman/listinfo/python-list
0\python
My dir:
##
promed2.0/
setup.cfg
setup.py icons/
docs/
python/
MyMainModule.py
vtk-window/
vtkpython.py
vtkpythontk.py
vtk.pth
vtkCommon.dll
vtkCommonPython.dll
vtkCommonTCL.dll
...
vtk/
###
OS: win 2K
Python ver: 2.3.5py2exe ver:
0.5.4
How can i solve this problem?
Thanks
Glauco
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.9.11 - Release Date: 14/4/2005
--
http://mail.python.org/mailman/listinfo/python-list
hundred twenty nine", 50: "fifty"}
But i need dict sort :
{ 50: "fifty", 129: "a hundred twenty nine"}
How can i do this ?
Thanks,
Glauco Buzini da Costa Silva
--
http://mail.python.org/mailman/listinfo/python-list
20 matches
Mail list logo