I refer you to your subject line:
"How do you refer to an iterator in docs?"
In documentation, I refer to an iterator as an iterator, just as I would
refer to a list as a list, a dict as a dict, or a string as a string.
You may also find these useful:
sequence
something that obeys the sequ
Hi all
I need the ability to execute a function by parsing a string containing the
full path to the function. The string is multi-dotted. The last element is
the function name, the second-last is the name of the module containing the
function, and the balance is the path to the module.
I have
Gerd Niemetz wrote:
> Take a look at http://www.web2py.com, a powerful and easy to learn python
> framework, and the community at
> https://groups.google.com/forum/?fromgroups#!forum/web2py is also very helpful
>
Web2py rocks. It does by default better than many, probably most,
professional web
On Apr 19, 11:02 pm, "Steve" wrote:
> > "Yigit Turgut" wrote in message
> >news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com...
> > When I use os.system() function, script waits for termination of the
>
> windows that is opened by os.system() to continue thus throwing errors
>
On Fri, Apr 20, 2012 at 8:51 PM, Yigit Turgut wrote:
> On Apr 19, 11:02 pm, "Steve" wrote:
>> > "Yigit Turgut" wrote in message
>> >news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com...
>> > When I use os.system() function, script waits for termination of the
>>
>> windows tha
Read about it here:
http://mtomassoli.wordpress.com/2012/04/20/code-blocks-in-python/
or just download the module from here:
https://bitbucket.org/mtomassoli/codeblocks/
The module codeblocks (codeblocks.py) includes a detailed docstring.
Kiuhnm
--
http://mail.python.org/mailman/listinfo/pyt
Hi -
I am using the pexpect version 2.4 with Python-3.2.3. I have written a
small script to verify the pexpect support with Python 3.2.3. This
script times out during the system call select execution. Can anyone
please help us with the issue here. The same script is working fine
with Python 2.7.3
Jon Clements wrote:
On Thursday, 19 April 2012 13:21:20 UTC+1, Roy Smith wrote:
Let's say I have a function which takes a list of words. I might write
the docstring for it something like:
def foo(words):
"Foo-ify words (which must be a list)"
What if I want words to be the more genera
Dear Python Tutors,
I am having problems trying to send an email (using the smtplib module ) to
send an email to myself over my browser using a python script, which is
being called by an html form that I have created. My python cgi script is
located in my cgi-bin directory, which I had made sure t
Dear Experts,
Does anybody know how to use the Stanford Parser for Python Interface? I have
tried many times, and don't know how to install and use. In fact, I have failed
at that many times. Here is the interface:
http://projects.csail.mit.edu/spatial/Stanford_Parser
Thank you!
Sincerely,
What is the correct way to set the version of my package with distutils
when i build it using
python setup.py bdist_rpm
I have __version__="x.x.x" in my main programm but if i add
from import __version__
into setup.py if fails when my prog tries to import gi.repository.
I suspect my approac
Hi Python Programmers or Newbies,
I have just started a small group of python programmers (newbies and people
with intermediate python programming experience) to
develop and work weekly on a series of python exercises and come up with
solutions to these exercises I develop.
The aim is to improve o
In article <4f910c3d$0$29965$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> I refer you to your subject line:
>
> "How do you refer to an iterator in docs?"
>
> In documentation, I refer to an iterator as an iterator, just as I would
> refer to a list as a list, a dict as a dic
That's pretty unfair. If you know the Windows API, then the documentation is
sufficient. If you need to learn the API, then it's unreasonable to expect
Mark Hammond, et. al. to bundle the amount of material needed along with the
software.
The book is an excellent introduction to the Windows A
ac27037, 20.04.2012 15:19:
> Does anybody know how to use the Stanford Parser for Python Interface? I have
> tried many times, and don't know how to install and use. In fact, I have
> failed at that many times. Here is the interface:
>
> http://projects.csail.mit.edu/spatial/Stanford_Parser
It
On Thursday, April 19, 2012 11:09:52 PM UTC-7, Ben Finney wrote:
> alex23 writes:
>
> > On Apr 20, 5:54 am, Jacob MacDonald wrote:
> >
> > > On Thursday, April 19, 2012 12:28:50 PM UTC-7, dmitrey wrote:
> > > > can I somehow overload operators like "=>", "->" or something like
> > > > that?
> >
On Friday, April 20, 2012 6:41:25 AM UTC-7, Roy Smith wrote:
> In article <4f910c3d$0$29965$c3e8da3$54964...@news.astraweb.com>,
> Steven D'Aprano wrote:
>
> > I refer you to your subject line:
> >
> > "How do you refer to an iterator in docs?"
> >
> > In documentation, I refer to an iterator
On Thu, 19 Apr 2012 12:28:50 -0700, dmitrey wrote:
> can I somehow overload operators like "=>", "->" or something like that?
> (I'm searching for appropriate overload for logical implication "if a then
> b")
You cannot create new operators, but you can control how existing
operators work on type
Hi all, here's a problem I don't know how to solve. I'm using Python 2.7.2.
I'm doing some stuff in Python which means I have cause to call
functions that take a while to return. Since I often want to call such a
function more than once with the same arguments, I've written a
decorator to elim
On Friday, 20 April 2012 16:57:06 UTC+1, Rotwang wrote:
> Hi all, here's a problem I don't know how to solve. I'm using Python 2.7.2.
>
> I'm doing some stuff in Python which means I have cause to call
> functions that take a while to return. Since I often want to call such a
> function more th
On 4/20/2012 17:50, Nobody wrote:
On Thu, 19 Apr 2012 12:28:50 -0700, dmitrey wrote:
can I somehow overload operators like "=>", "->" or something like that?
(I'm searching for appropriate overload for logical implication "if a then
b")
You cannot create new operators, but you can control how
Rotwang wrote:
> I've written a
> decorator to eliminate repeated calls by storing a dictionary whose
> items are arguments and their results:
> The problem is that the dictionary key
> stored depends on how the function was called, even if two calls should
> be equivalent; hence the original fun
On 04/20/12 11:45, Kiuhnm wrote:
IOW, you can't define "->" or "=>", but you could define">=" or ">>".
You can also "overload" '<-' ;)
Oooh, that's evil. Slick, but evil! :-D
-tkc
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, Apr 19, 2012 at 5:14 PM, Chris Angelico wrote:
> The question then is whether to choose or auto-detect. Attempting to
> auto-detect could be quite inefficient; imagine if you have to call on
> ssh every couple of seconds, and something in $PATH is on a slow
> network share (or on a floppy
Kiuhnm writes:
> On 4/20/2012 17:50, Nobody wrote:
> > On Thu, 19 Apr 2012 12:28:50 -0700, dmitrey wrote:
> >
> >> can I somehow overload operators like "=>", "->" or something
> >> like that? (I'm searching for appropriate overload for logical
> >> implication "if a then b")
> >
> > You cannot cr
Kiuhnm wrote:
> You can also "overload" '<-' ;)
In the same spirit:
http://code.activestate.com/recipes/384122-infix-operators/
--
http://mail.python.org/mailman/listinfo/python-list
On 4/20/2012 19:49, Jussi Piitulainen wrote:
Kiuhnm writes:
On 4/20/2012 17:50, Nobody wrote:
On Thu, 19 Apr 2012 12:28:50 -0700, dmitrey wrote:
can I somehow overload operators like "=>", "->" or something
like that? (I'm searching for appropriate overload for logical
implication "if a then
On Sat, Apr 21, 2012 at 3:44 AM, Dan Stromberg wrote:
>
> On Thu, Apr 19, 2012 at 5:14 PM, Chris Angelico wrote:
>>
>> The question then is whether to choose or auto-detect. Attempting to
>> auto-detect could be quite inefficient; imagine if you have to call on
>> ssh every couple of seconds, and
On Sat, Apr 21, 2012 at 4:21 AM, Kiuhnm
wrote:
> Another option is to rely on ugly pseudo-operators:
> a .imp. b
> a .imp (b .imp. c)
Or functions:
implies(a,b)
implies(a,implies(b,c))
That's the simplest option :) No hacks required, syntax is clear even
if the reader doesn't know what you're
On Apr 20, 6:51 am, Yigit Turgut wrote:
> On Apr 19, 11:02 pm, "Steve" wrote:
>
> > > "Yigit Turgut" wrote in message
> > >news:b9a8bb28-3003-4a36-86fb-339ef697b...@i2g2000vbd.googlegroups.com...
> > > When I use os.system() function, script waits for termination of the
>
> > windows that is ope
I have spent some time searching for a bug in my code, it was due to
different work of "is" with () and []:
>>> () is ()
True
>>> [] is []
False
(Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
[GCC 4.6.1] )
Is this what it should be or maybe yielding unified result is better?
D.
--
http://mail.p
On Sat, Apr 21, 2012 at 5:10 AM, dmitrey wrote:
> I have spent some time searching for a bug in my code, it was due to
> different work of "is" with () and []:
() is ()
> True
[] is []
> False
Okay, let's take a step back. What do you expect "is" to be doing? It
doesn't check for equali
On 4/20/12 8:10 PM, dmitrey wrote:
I have spent some time searching for a bug in my code, it was due to
different work of "is" with () and []:
() is ()
True
The empty tuple is unique, immutable, and common so the Python runtime optimizes
this by reusing the same object, much like small integ
On 20/04/2012 20:10, dmitrey wrote:
I have spent some time searching for a bug in my code, it was due to
different work of "is" with () and []:
() is ()
True
[] is []
False
(Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
[GCC 4.6.1] )
Is this what it should be or maybe yielding unified resu
dmitrey writes:
> I have spent some time searching for a bug in my code, it was due to
> different work of "is" with () and []:
() is ()
> True
[] is []
> False
>
> (Python 2.7.2+ (default, Oct 4 2011, 20:03:08)
> [GCC 4.6.1] )
>
> Is this what it should be or maybe yielding unified re
Can you explain why there is a difference between the following two
statements?
>>> a = []
>>> a.append(1)
>>> print a
[1]
>>> print [].append(1)
None
Best regards,
Jan Sipke
--
http://mail.python.org/mailman/listinfo/python-list
On Sat, Apr 21, 2012 at 6:03 AM, Jan Sipke wrote:
> Can you explain why there is a difference between the following two
> statements?
>
a = []
a.append(1)
print a
> [1]
This looks at the list after appending.
print [].append(1)
> None
This looks at the return value of the ap
On 20/04/2012 21:03, Jan Sipke wrote:
Can you explain why there is a difference between the following two
statements?
a = []
a.append(1)
print a
[1]
print [].append(1)
None
append is a method of the list object []. Methods, in general, both do
something to the objects of which they are a
On 4/20/2012 22:03, Jan Sipke wrote:
Can you explain why there is a difference between the following two
statements?
a = []
a.append(1)
print a
[1]
print [].append(1)
None
Try this one:
a = []
print a.append(1)
Does that answer your question?
Kiuhnm
--
http://mail.python.org/mai
On Sat, Apr 21, 2012 at 6:17 AM, Rotwang wrote:
> In general there's no reason why
>
a.method(arguments)
print a
>
> will print the same thing as
>
print a.method(arguments)
>
> since a method doesn't assign the value it returns to the instance on which
> it is called; what it does
On 20/04/2012 17:10, Jon Clements wrote:
On Friday, 20 April 2012 16:57:06 UTC+1, Rotwang wrote:
Hi all, here's a problem I don't know how to solve. I'm using Python 2.7.2.
I'm doing some stuff in Python which means I have cause to call
functions that take a while to return. Since I often want
On 4/19/2012 3:28 PM, dmitrey wrote:
hi all,
can I somehow overload operators like "=>", "->" or something like
that? (I'm searching for appropriate overload for logical implication
"if a then b")
Thank you in advance, D.
This tickled a memory from decades back when I worked in PL/I. They have
On Sat, Apr 21, 2012 at 7:34 AM, Steven W. Orr wrote:
> Then define a class called Bool that redefines things like __rlshift__ and
> __rrshift__. That would get >>= and <<= for Implications and nodus tolens.
> It's not a total solution. I can't see how you're going to get IFF, NAND and
> NOR.
IFF
Hi.
Anybody knows the data is sent in a different way for Python 2.5, 2.6
and 2.7 using this code:
>>> import urllib2
>>> url = 'http://server.com/post_image?tid=zoV6LJ'
>>> f = open('test.jpg')
>>> data = f.read()
>>> res = urllib2.urlopen(url, data)
It works the same way for python2.5 and pytho
On 4/20/2012 6:47 PM, Diego Manenti Martins wrote:
Anybody knows the data is sent in a different way for Python 2.5, 2.6
and 2.7 using this code:
You could check the What's New for 2.7 and see if there is any mention
of a change to urllib2. Or diff the 2.6 and 2.7 versions of urllib2.py.
i
On 4/20/2012 9:41 AM, Roy Smith wrote:
Except that "list of foos" and "sequence of foos" make sense from a
grammar standpoint, but "iterator of foos" does not. Or maybe it does?
I consider it grammatical, but idiomatically, it *is* an innovation.
Language evolves as needs evolve.
--
Terry
In article <877gxajit0@dpt-info.u-strasbg.fr>,
Alain Ketterlin wrote:
> Tuples are immutable, while lists are not.
If you really want to have fun, consider this classic paradox:
>>> [] is []
False
>>> id([]) == id([])
True
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Apr 20, 2012 at 9:57 AM, Rotwang wrote:
> As far as I know, the decorated function will always return the same value
> as the original function. The problem is that the dictionary key stored
> depends on how the function was called, even if two calls should be
> equivalent; hence the origi
On Fri, Apr 20, 2012 at 6:07 PM, Ian Kelly wrote:
> (args, varargs, varkw, defaults) = inspect.getargspec(func)
> if varargs:
> args.append(varargs)
> if varkw:
> args.append("tuple(sorted(%s.items()))" % varkw)
Note that in Python 3, this would need to become something lik
On 04/20/2012 06:47 PM, Diego Manenti Martins wrote:
> Hi.
> Anybody knows the data is sent in a different way for Python 2.5, 2.6
> and 2.7 using this code:
>
import urllib2
url = 'http://server.com/post_image?tid=zoV6LJ'
f = open('test.jpg')
data = f.read()
res = urllib2.
On Fri, Apr 20, 2012 at 10:08 PM, Dave Angel wrote:
> On 04/20/2012 06:47 PM, Diego Manenti Martins wrote:
>> Hi.
>> Anybody knows the data is sent in a different way for Python 2.5, 2.6
>> and 2.7 using this code:
>>
> import urllib2
> url = 'http://server.com/post_image?tid=zoV6LJ'
>
I can't seem to concatenate.
I got binary files here:
yvaine:disk rilindo$ ls -lah
total 61440
drwxr-xr-x 4 rilindo staff 136B Apr 20 19:47 .
drwxr-xr-x 10 rilindo staff 340B Apr 20 19:45 ..
-rw-r--r-- 1 rilindo staff20M Apr 20 20:00 disk1
-rw-r--r-- 1 rilindo staff10M Apr
You forgot to include the list in your response. I don't normally
respond to private messages, but I'll make an exception.
On Fri, Apr 20, 2012 at 10:08 PM, Dave Angel wrote:
> On 04/20/2012 06:47 PM, Diego Manenti Martins wrote:
>> Hi.
>> Anybody knows the data is sent in a different way for P
On Sat, Apr 21, 2012 at 11:03 AM, Foster Rilindo wrote:
> Is this right way to concatenate a file or is there a better way?
I'd be inclined to ignore shutil and simply open one file for reading,
the other for appending, and manually transfer data from one to the
other.
open(disk1,"ab").write(ope
On Sat, Apr 21, 2012 at 9:40 AM, Terry Reedy wrote:
> On 4/20/2012 9:41 AM, Roy Smith wrote:
>
>> Except that "list of foos" and "sequence of foos" make sense from a
>> grammar standpoint, but "iterator of foos" does not. Or maybe it does?
>
> I consider it grammatical, but idiomatically, it *is*
On 04/20/2012 09:03 PM, Foster Rilindo wrote:
> I can't seem to concatenate.
>
> I got binary files here:
>
> yvaine:disk rilindo$ ls -lah
> total 61440
> drwxr-xr-x 4 rilindo staff 136B Apr 20 19:47 .
> drwxr-xr-x 10 rilindo staff 340B Apr 20 19:45 ..
> -rw-r--r-- 1 rilindo staff20
On 21/04/2012 02:03, Foster Rilindo wrote:
I can't seem to concatenate.
I got binary files here:
yvaine:disk rilindo$ ls -lah
total 61440
drwxr-xr-x 4 rilindo staff 136B Apr 20 19:47 .
drwxr-xr-x 10 rilindo staff 340B Apr 20 19:45 ..
-rw-r--r-- 1 rilindo staff20M Apr 20 20:00 di
In article <4f921a2d$0$29965$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> On Fri, 20 Apr 2012 09:41:25 -0400, Roy Smith wrote:
>
> > In article <4f910c3d$0$29965$c3e8da3$54964...@news.astraweb.com>,
> > Steven D'Aprano wrote:
> >
> >> I refer you to your subject line:
> >>
On Fri, Apr 20, 2012 at 11:09 PM, Dave Angel wrote:
> You forgot to include the list in your response. I don't normally
> respond to private messages, but I'll make an exception.
Sorry about that and thanks.
>> On 04/20/2012 06:47 PM, Diego Manenti Martins wrote:
>>> Hi.
>>> Anybody knows the d
Nevermind. Dumb mistake.
I should have used:
destination = open(disk1,'ab')
Doh.
On Apr 20, 2012, at 8:03 PM, Foster Rilindo wrote:
> I can't seem to concatenate.
>
> I got binary files here:
>
> yvaine:disk rilindo$ ls -lah
> total 61440
> drwxr-xr-x 4 rilindo staff 136B Apr 20 19:47
On 04/20/2012 11:06 PM, Diego Manenti Martins wrote:
> On Fri, Apr 20, 2012 at 11:09 PM, Dave Angel wrote:
>> You forgot to include the list in your response. I don't normally
>> respond to private messages, but I'll make an exception.
> Sorry about that and thanks.
>
>>> On 04/20/2012 06:47 PM,
On Apr 20, 8:01 pm, Roy Smith wrote:
> In article <4f921a2d$0$29965$c3e8da3$54964...@news.astraweb.com>,
> Steven D'Aprano wrote:
>
>
>
>
>
>
>
>
>
> > On Fri, 20 Apr 2012 09:41:25 -0400, Roy Smith wrote:
>
> > > In article <4f910c3d$0$29965$c3e8da3$54964...@news.astraweb.com>,
> > > Steven D'A
On Sat, Apr 21, 2012 at 1:01 PM, Roy Smith wrote:
> Because an iterator isn't a container. I don't know, maybe it does make
> sense, but my first impression is that it sounds wrong.
>
> A basket of apples is a basket which contains apples, in the same way a
> list contains foos. But an iterator
On Fri, Apr 20, 2012 at 1:30 AM, Frank Millman wrote:
> Hi all
>
> I need the ability to execute a function by parsing a string containing the
> full path to the function. The string is multi-dotted. The last element is
> the function name, the second-last is the name of the module containing the
On Sat, 21 Apr 2012 04:25:36 +0100
Rotwang wrote:
> On 21/04/2012 01:01, Roy Smith wrote:
> > In article<877gxajit0@dpt-info.u-strasbg.fr>,
> > Alain Ketterlin wrote:
> >
> >> Tuples are immutable, while lists are not.
> >
> > If you really want to have fun, consider this classic paradox:
On Fri, 20 Apr 2012 23:01:08 -0400, Roy Smith wrote:
> In article <4f921a2d$0$29965$c3e8da3$54964...@news.astraweb.com>,
> Steven D'Aprano wrote:
>
>> On Fri, 20 Apr 2012 09:41:25 -0400, Roy Smith wrote:
>>
>> > In article <4f910c3d$0$29965$c3e8da3$54964...@news.astraweb.com>,
>> > Steven D'A
On 4/20/2012 22:01, Roy Smith wrote:
> A basket of apples is a basket which contains apples, in the same way a
> list contains foos. But an iterator doesn't contain anything. You
> wouldn't say, "a spigot of water", because the spigot isn't a container
> holding the water. It is simply a mech
On 04/20/2012 11:25 PM, Rotwang wrote:
> On 21/04/2012 01:01, Roy Smith wrote:
>> In article<877gxajit0@dpt-info.u-strasbg.fr>,
>> Alain Ketterlin wrote:
>>
>>> Tuples are immutable, while lists are not.
>>
>> If you really want to have fun, consider this classic paradox:
>>
> [] is []
>
On Friday, April 20, 2012 12:34:46 PM UTC-7, Rotwang wrote:
> I believe it says somewhere in the Python docs that it's undefined and
> implementation-dependent whether two identical expressions have the same
> identity when the result of each is immutable
I was curious where that might be on my
Chris Angelico wrote:
> On Sat, Apr 21, 2012 at 11:03 AM, Foster Rilindo wrote:
>> Is this right way to concatenate a file or is there a better way?
>
> I'd be inclined to ignore shutil and simply open one file for reading,
> the other for appending, and manually transfer data from one to the
>
70 matches
Mail list logo