On Dec 24, 4:00 pm, chad wrote:
> Given the following...
>
> #!/usr/bin/python
>
> import pexpect
>
> p = pexpect.spawn('cat')
> p.sendline('1234')
> p.expect (['1234'])
> p.expect (['1234'])
>
> I no output when I run it...
>
> [cdal...@localhost oakland]$ ./ecat.py
> [cdal...@localhost oakland]$
Given the following...
#!/usr/bin/python
import pexpect
p = pexpect.spawn('cat')
p.sendline('1234')
p.expect (['1234'])
p.expect (['1234'])
I no output when I run it...
[cdal...@localhost oakland]$ ./ecat.py
[cdal...@localhost oakland]$
I don't get it. I was expecting to see the output from b
On Dec 24, 2010 4:40 PM, "Flávio Lisbôa" wrote:
>>
>> copy, here, is a dict method. It will create a dict.
>> If you really need it, you could try this:
>>
>> import copy
>> class neodict(dict):
>>def copy(self):
>>return copy.copy(self)
>>
>> d = neodict()
>> print type(d)
>> dd = d.
Carl Banks wrote:
On Dec 24, 1:24 am, Steven D'Aprano wrote:
On Thu, 23 Dec 2010 22:38:05 -0800, Carl Banks wrote:
OTOH, going the extra mile to hide useful information from a user is
asinine. As a user, I will decide for myself how I want to use
implementation-defined information, and I don't
>
> copy, here, is a dict method. It will create a dict.
> If you really need it, you could try this:
>
> import copy
> class neodict(dict):
>def copy(self):
>return copy.copy(self)
>
> d = neodict()
> print type(d)
> dd = d.copy()
> print type(dd)
One more gotcha to python... OO in
On Fri, Dec 24, 2010 at 1:52 PM, kj wrote:
> Watch this:
>
class neodict(dict): pass
> ...
d = neodict()
type(d)
>
type(d.copy())
>
>
>
> Bug? Feature? Genius beyond the grasp of schlubs like me?
copy, here, is a dict method. It will create a dict.
If you really need it, y
kj writes:
> But OrderedDict's functionality *requires* that its __init__ be
> run, and this __init__, in turn, does part of its initialization
> by calling the update method.
>
> Therefore, the update method of the new subclass needs to be able
> to identify the calling function in order to make
Watch this:
>>> class neodict(dict): pass
...
>>> d = neodict()
>>> type(d)
>>> type(d.copy())
Bug? Feature? Genius beyond the grasp of schlubs like me?
~kj
--
http://mail.python.org/mailman/listinfo/python-list
On 12/24/2010 3:24 AM, Carl Banks wrote:
On Dec 24, 1:24 am, Steven D'Aprano wrote:
All I'm
suggesting is that there should be a way of reducing the boilerplate
needed for this idiom:
def _validate_arg(x):
if x == 'bad input': return False
return True
def f(arg):
if not _vali
In Daniel Urban
writes:
>On Fri, Dec 24, 2010 at 17:24, kj wrote:
>> (BTW, I don't understand why inspect doesn't provide something as
>> basic as the *class* that the method belongs to, whenever applicable.
>> I imagine there's a good reason for this coyness, but I can't figure
>> it out.)
>
On 12/24/2010 8:51 AM, Chris Gonnerman wrote:
On 12/24/2010 10:24 AM, kj wrote:
I want to implement a frozen and ordered dict.
I thought I'd implement it as a subclass of collections.OrderedDict
that prohibits all modifications to the dictionary after it has
been initialized.
That's actua
On Fri, Dec 24, 2010 at 17:24, kj wrote:
> (BTW, I don't understand why inspect doesn't provide something as
> basic as the *class* that the method belongs to, whenever applicable.
> I imagine there's a good reason for this coyness, but I can't figure
> it out.)
One function object can "belong to
On Dec 24, 8:24 am, kj wrote:
> I want to implement a frozen and ordered dict.
>
> I thought I'd implement it as a subclass of collections.OrderedDict
> that prohibits all modifications to the dictionary after it has
> been initialized.
>
> In particular, calling this frozen subclass's update meth
On Fri, 2010-12-24 at 20:48 +0530, Nitin Pawar wrote:
> On Fri, Dec 24, 2010 at 8:40 PM, Jim wrote:
> Hello, I wonder if someone knows about lxml.etree and
> namespaces?
Yes, and don't.
> I want to build an ElementTree where some of the sub-elements have
> attributes that serial
*** The Jew World Order - A TUTORIAL Exposition in Banking and
Economics ***
Is the New World Order “Jewish”?
February 12, 2005
What do you trust? Government, Paper or Gold?
Let’s begin by defining the “New World Order.”
The mainspring of the New World Order is the desire on the part of the
wor
Alex Jones Exposes Google's Plan to Dominate the Internet
http://www.youtube.com/watch?v=LiqOL9ausOI
Alex Jones Exposes Google's Plan to Dominate the Internet
http://www.youtube.com/watch?v=LiqOL9ausOI
Alex Jones Exposes Google's Plan to Dominate the Internet
http://www.youtube.com/watch?v=LiqOL9
On 12/24/2010 10:24 AM, kj wrote:
I want to implement a frozen and ordered dict.
I thought I'd implement it as a subclass of collections.OrderedDict
that prohibits all modifications to the dictionary after it has
been initialized.
In particular, calling this frozen subclass's update method shou
I want to implement a frozen and ordered dict.
I thought I'd implement it as a subclass of collections.OrderedDict
that prohibits all modifications to the dictionary after it has
been initialized.
In particular, calling this frozen subclass's update method should,
in general, trigger an exce
On Fri, Dec 24, 2010 at 8:40 PM, Jim wrote:
> Hello, I wonder if someone knows about lxml.etree and namespaces?
>
> I want to build an ElementTree where some of the sub-elements have
> attributes that serialize this way.
>
> ..
>
> I've tried just comment_elet.set('xml:lang','de') and it didn't
Hello, I wonder if someone knows about lxml.etree and namespaces?
I want to build an ElementTree where some of the sub-elements have
attributes that serialize this way.
..
I've tried just comment_elet.set('xml:lang','de') and it didn't like
that at all (although it takes comment_elet.set('aut
On Dec 24, 4:42 pm, Stefan Sonnenberg-Carstens
wrote:
> You could as an alternative just use byte arrays. These are changeable.
thanks, that's exactly what I need. I have completely missed those
things since they're pretty new.
--
http://mail.python.org/mailman/listinfo/python-list
Am 24.12.2010 13:31, schrieb Oleg Leschov:
Hi,
I am writing an extension module in which I want to do some heavy
number crunching on large amount of data.
The input data is prepared using Python code and passed to this
extension module via strings containing binary data, and the result is
also
Randy,
Tkinter is a viable GUI platform with Python 3.1's (and Python
2.7's) support for ttk (Tile). The new ttk module supports theme
aware controls so that you can build beautiful GUI's that match
your underlying platform's standards. Ttk also includes theme
aware treeview and notebook controls.
Thanks all
In [11]: reps = 5
In [12]: t = Timer("url = 'http://docs.python.org/dev/library/
stdtypes.html? highlight=partition#str.partition' ;sp =
re.compile('(//?|[;?:@=.])'); filter(len, sp.split(url))", 'import
re')
In [13]: print sum(t.repeat(repeat=reps, number=1)) / reps
4.94003295898e-0
Starting from Python 2.7, yes:
http://docs.python.org/library/ftplib.html#ftplib.FTP_TLS
Regards,
--- Giampaolo
http://code.google.com/p/pyftpdlib/
http://code.google.com/p/psutil/
2010/12/23 Octavian Rasnita :
> Can this lib also work with ftps?
>
> Thanks.
>
> Octavian
>
> - Original Mes
Hi,
I am writing an extension module in which I want to do some heavy
number crunching on large amount of data.
The input data is prepared using Python code and passed to this
extension module via strings containing binary data, and the result is
also passed back as a list of pretty large strings
On Dec 24, 1:24 am, Steven D'Aprano wrote:
> On Thu, 23 Dec 2010 22:38:05 -0800, Carl Banks wrote:
> > OTOH, going the extra mile to hide useful information from a user is
> > asinine. As a user, I will decide for myself how I want to use
> > implementation-defined information, and I don't want th
On Thu, 23 Dec 2010 22:38:05 -0800, Carl Banks wrote:
>> Do you accept that, as a general principle, unhandled errors should be
>> reported as close as possible to where the error occurs? If your answer
>> to that is No, then where do you think unhandled errors should be
>> reported?
>
> "No", an
"Martin v. Loewis" writes:
>> Type "help", "copyright", "credits" or "license" for more information.
> 9.95
>> 9.9493
> "%.16g" % 9.95
>> '9.949'
> round(9.95, 1)
>> 10.0
>>
>> So it seems that Python is going out of its way to intuitively round
>> 9.95, while
29 matches
Mail list logo