On Thu, Jul 11, 2013 at 4:06 PM, Steven D'Aprano wrote:
> I think the right solution here is the trivial:
>
> def exhaust(it):
> """Doc string here."""
> deque(maxlen=0).extend(it)
>
>
> which will be fast enough for all but the tightest inner loops. But if
> you really care about optimizi
On Thu, 11 Jul 2013 17:06:39 +1000, Chris Angelico wrote:
> On Thu, Jul 11, 2013 at 4:06 PM, Steven D'Aprano
> wrote:
>> I think the right solution here is the trivial:
>>
>> def exhaust(it):
>> """Doc string here."""
>> deque(maxlen=0).extend(it)
>>
>>
>> which will be fast enough for al
On Thu, Jul 11, 2013 at 5:15 PM, Steven D'Aprano wrote:
> On Thu, 11 Jul 2013 17:06:39 +1000, Chris Angelico wrote:
>
>> On Thu, Jul 11, 2013 at 4:06 PM, Steven D'Aprano
>> wrote:
>>> I think the right solution here is the trivial:
>>>
>>> def exhaust(it):
>>> """Doc string here."""
>>> d
On Wednesday, July 10, 2013 11:01:26 AM UTC-4, Steven D'Aprano wrote:
> Mats, I fear you have misunderstood. If the Python Secret Underground
> existed, which it most certainly does not, it would absolutely not have
> the power to censor people's emails or cut them off in the middle of
>
*That'
Things are certainly heating up in the alternate Python compiler field.
Mypy is a new, experimental, implementation of Python 3 with optional
static typing and aiming for efficient compilation to machine code.
http://www.mypy-lang.org/index.html
--
Steven
--
http://mail.python.org/mailman/
On 11 Jul 2013 09:08, "Steven D'Aprano" wrote:
>
> Things are certainly heating up in the alternate Python compiler field.
> Mypy is a new, experimental, implementation of Python 3 with optional
> static typing and aiming for efficient compilation to machine code.
>
> http://www.mypy-lang.org/inde
Joshua Landau writes:
> On 11 July 2013 05:13, Joshua Landau wrote:
> >
>
> Ah, I get it. It is easy to misread my post as "I have this
> exhaust_iter" and it's obvious it doesn't work because why else would
> I post here what do I do HALP!
Right. Just because you think there's one obvious int
On Wed, 10 Jul 2013 22:57:09 -0600, Jason Friedman wrote:
> Other than using a database, what are my options for allowing two processes
> to edit the same file at the same time? When I say same time, I can accept
> delays.
What do you mean by "edit"? Overwriting bytes and appending bytes are
sim
Hi all,
I haven't been able to get up to speed with XML. I do examples from the
tutorials and experiment with variations. Time and time again I fail
with errors messages I can't make sense of. Here's the latest one. The
url is "http://finance.yahoo.com/q?s=XIDEQ&ql=0";. Ubuntu 12.04 LTS,
Pyth
On 11 Jul 2013 10:04, "F.R." wrote:
>
> Hi all,
>
> I haven't been able to get up to speed with XML. I do examples from the
tutorials and experiment with variations. Time and time again I fail with
errors messages I can't make sense of. Here's the latest one. The url is "
http://finance.yahoo.com/
Hello, first time poster here, and general newbie to Python.
I'm looking to write a program in Python, (and have in fact written most of it
by now,) and am trying to put together a GUI for it. Kivy looks very nice,
particularly with the fact that it's supposed to be compatible with most
platfor
Actually, I don't think etree has a HTML parser. And I would counter-recommend
lxml if speed is an issue: BeautifulSoup takes a long time to parse a large
document.
On Thursday, July 11, 2013 5:08:04 PM UTC+8, Fábio Santos wrote:
> On 11 Jul 2013 10:04, "F.R." wrote:
>
> >
>
> > Hi all,
>
On 07/10/2013 02:43 AM, Mats Peterson wrote:
> I fear you don’t even know what a regular expression is. Then this will
> of course not affect you.
Hmm, and your stack exchange posts had a similar tone, hmm?
I for one have never ready any of your posts on this forum before, so it
looks like you've
Replies to questions :
1. Does the printer accept connections again after some time?
Yes, bit seems to vary how long that takes
2. Does the printer accept connections if you close and re-open the
Python interpreter?
Not after a Connection reset error. The script exits after trapping the
"Con
On Thu, Jul 11, 2013 at 7:28 PM, loial wrote:
> Replies to questions :
>
> 1. Does the printer accept connections again after some time?
>
> Yes, bit seems to vary how long that takes
>
> 2. Does the printer accept connections if you close and re-open the
> Python interpreter?
>
> Not after a Conn
On 11 Jul 2013 10:24, wrote:
>
> Actually, I don't think etree has a HTML parser. And I would
counter-recommend lxml if speed is an issue: BeautifulSoup takes a long
time to parse a large document.
>
> On Thursday, July 11, 2013 5:08:04 PM UTC+8, Fábio Santos wrote:
> >
> > Use an HTML parser.
On 07/11/2013 10:59 AM, F.R. wrote:
Hi all,
I haven't been able to get up to speed with XML. I do examples from
the tutorials and experiment with variations. Time and time again I
fail with errors messages I can't make sense of. Here's the latest
one. The url is "http://finance.yahoo.com/q?s=
On 11/07/13 10:09, fronag...@gmail.com wrote:
Hello, first time poster here, and general newbie to Python.
I'm looking to write a program in Python, (and have in fact written most of it
by now,) and am trying to put together a GUI for it. Kivy looks very nice,
particularly with the fact that i
On Thursday, July 11, 2013 8:25:13 PM UTC+8, F.R. wrote:
> On 07/11/2013 10:59 AM, F.R. wrote:
>
> > Hi all,
>
> >
>
> > I haven't been able to get up to speed with XML. I do examples from
>
> > the tutorials and experiment with variations. Time and time again I
>
> > fail with errors messag
Am 11.07.2013 11:09, schrieb fronag...@gmail.com:
Hello, first time poster here, and general newbie to Python.
I'm looking to write a program in Python, (and have in fact written
most of it by now,) and am trying to put together a GUI for it. Kivy
looks very nice, particularly with the fact that
Welcome to Python!
Am 11.07.2013 11:09, schrieb fronag...@gmail.com:
I'm looking to write a program in Python, (and have in fact written
most of it by now,) and am trying to put together a GUI for it. Kivy
looks very nice, particularly with the fact that it's supposed to be
compatible with most
Hello!
I just stumbled over a case where Python (2.7 and 3.3 on MS Windows)
fail to detect that an object is a function, using the callable()
builtin function. Investigating, I found out that the object was indeed
not callable, but in a way that was very unexpected to me:
class X:
Le lundi 8 juillet 2013 19:52:17 UTC+2, Chris Angelico a écrit :
> On Tue, Jul 9, 2013 at 3:31 AM, wrote:
>
> > Unfortunately (as probably I told you before) I will never pass to
>
> > Python 3... Guido should not always listen only to gurus like him...
>
> > I don't like Python as before...s
On Thu, Jul 11, 2013 at 11:18 PM, wrote:
> Just to stick with this funny character ẞ, a ucs-2 char
> in the Flexible String Representation nomenclature.
>
> It seems to me that, when one needs more than ten bytes
> to encode it,
>
sys.getsizeof('a')
> 26
sys.getsizeof('ẞ')
> 40
>
> this
In article <2fdf282e-fd28-4ba3-8c83-ce120...@googlegroups.com>,
jus...@zeusedit.com wrote:
> On Wednesday, July 10, 2013 2:17:12 PM UTC+10, Xue Fuqiao wrote:
>
> > * It is especially handy for selecting and deleting text.
>
> When coding I never use a mouse to select text regions or to dele
Ulrich Eckhardt wrote:
> Hello!
>
> I just stumbled over a case where Python (2.7 and 3.3 on MS Windows)
> fail to detect that an object is a function, using the callable()
> builtin function. Investigating, I found out that the object was indeed
> not callable, but in a way that was very unexpec
On Thu, Jul 11, 2013 at 9:05 AM, Ulrich Eckhardt <
ulrich.eckha...@dominolaser.com> wrote:
> Hello!
>
> I just stumbled over a case where Python (2.7 and 3.3 on MS Windows) fail
> to detect that an object is a function, using the callable() builtin
> function. Investigating, I found out that the o
On Thursday, July 11, 2013 9:17:07 PM UTC+8, Paul Kölle wrote:
> Am 11.07.2013 11:09, schrieb fronag...@gmail.com:
>
> > Hello, first time poster here, and general newbie to Python.
>
> >
>
> > I'm looking to write a program in Python, (and have in fact written
>
> > most of it by now,) and am
Arpex Capital seleciona para uma de suas startups:
Estagiário (Wanna-be-developer)
Objetivo geral da Posição:
Se divertir programando, resolvendo problemas e aprendendo coisas novas.
Pré-requisitos:
Conhecimento de Ruby on Rails ou Python ou Node.js ou Angular.js, conhecimento
UNIX e vontade de a
...oh and here is the class I made for it.
class xslice(object):
'''
xslice(seq, start, stop, step) -> generator slice
'''
def __init__(self, seq, *stop):
if len(stop) > 3:
raise TypeError("xslice takes at most 4 arguments")
elif len(stop) < 0:
Just some dribble, nothing major.
I like using slices but I also noticed that a slice expression returns a new
sequence.
I sometimes find myself using them in a for loop like this:
seq = range(10)
for even in seq[::2]:
print even
(That's just for an example) But wouldn't it be a bit of a
> Congratulations on the 1.0.0 release!
Thanks a lot. =)
> Btw. any change you can put up a prebuilt installer for a 64-bit built
> with Python 3.3? You have one for Python 3.2
> (http://code.google.com/p/psutil/downloads/list), but the version for Python
> 3.3 is not there.
Unfortunately I'm
On 11 July 2013 15:54, Russel Walker wrote:
> ...oh and here is the class I made for it.
>
> class xslice(object):
> '''
> xslice(seq, start, stop, step) -> generator slice
> '''
>
> def __init__(self, seq, *stop):
Wouldn't it be better if it has the same signature(s) as itertools
Giampaolo Rodola'於 2013年7月11日星期四UTC+8下午11時02分01秒寫道:
> > Congratulations on the 1.0.0 release!
>
>
>
> Thanks a lot. =)
>
>
>
> > Btw. any change you can put up a prebuilt installer for a 64-bit built
>
> > with Python 3.3? You have one for Python 3.2
>
> > (http://code.google.com/p/psutil
How do I get the OS System Font Directory(Cross-Platform) in python?
Need a simple script for
Windows, Linux, Mac, etc..
Or using wxPython.
I can't seem to find anything that works, and I don't want to hard-code paths.
--
http://mail.python.org/mailman/listinfo/python-list
Roy Smith writes:
> This is why I never understood the attraction of something like
> xemacs, where you use the mouse to make text selections and run
> commands out of menus.
Menus are good for learning the functionality, and you have them just as
much in Gnu emacs as in xemacs. You can even us
On Thu, Jul 11, 2013 at 5:32 PM, Metallicow wrote:
> How do I get the OS System Font Directory(Cross-Platform) in python?
>
> Need a simple script for
> Windows, Linux, Mac, etc..
>
> Or using wxPython.
>
> I can't seem to find anything that works, and I don't want to hard-code paths.
> --
> http:
On Fri, Jul 12, 2013 at 1:42 AM, Paul Rudin wrote:
> Text selection with a mouse is a different thing. Sometimes it's
> more convenient, sometimes it's not.
As screens get larger and the amount of text on them increases, it's
likely to get more and more useful to use a mouse... but personally, I
For a portable font install tool.
Finding if a particular font exists,
useful when testing apps in virtual environent,
rendering text from a font,
Font file manipulations,
etc..
--
http://mail.python.org/mailman/listinfo/python-list
Dave Angel wrote:
> On 07/11/2013 12:57 AM, Jason Friedman wrote:
>> Other than using a database, what are my options for allowing two processes
>> to edit the same file at the same time? When I say same time, I can accept
>> delays. I considered lock files, but I cannot conceive of how I avoid
On Wed, 10 Jul 2013 23:42:14 -0700, fletcherbenjiaa wrote:
> A wedding is truly a labor of love for most engaged couples, and it's
> natural to feel a bit wary of the wedding planning process. However, it
> doesn't have to be so intimidating or cumbersome. Sure there are lots of
> details in even
On Thu, Jul 11, 2013 at 08:54:17AM -0700, Metallicow wrote:
> For a portable font install tool.
>
> Finding if a particular font exists,
> useful when testing apps in virtual environent,
> rendering text from a font,
> Font file manipulations,
> etc..
> --
> http://mail.python.org/mailman/listinf
Thanks, this looks really nice. I was duplicating some of this for my
CLI-based webserver control panel:
https://github.com/dotancohen/burton
As soon as I integrate psutil into Burton I'll add it to the README
and such. How would you like me to mention attribution exactly?
--
Dotan Cohen
http://
On Thu, Jul 11, 2013 at 8:52 AM, Russel Walker wrote:
> Just some dribble, nothing major.
>
> I like using slices but I also noticed that a slice expression returns a new
> sequence.
>
> I sometimes find myself using them in a for loop like this:
>
>
> seq = range(10)
> for even in seq[::2]:
>
> > def __init__(self, seq, *stop):
>
>
>
> Wouldn't it be better if it has the same signature(s) as itertools.islice?
That's actually what I was going for, except I was modeling it after range, but
that was the only way I knew to implement it.
> > if len(stop) > 3:
>
> >
On 11 July 2013 17:21, Russel Walker wrote:
> To confess, this is the second time I've made the mistake of trying to
> implement generator like functionality of a builtin when there already is on
> in itertools. Need to start studying that module abit more I think. I'm
> looking at the docs now
@ Chris “Kwpolska” Warrick
Thanks, that is a start anyway.
a Pure-Python way was what I was wanting, not win32api stuff.
"C:\Windows\Fonts"
The windows path proves valid. Works on XP, Vista, 7. Not sure about win8...?
Don't have a mac handy, but the link should be enough to help write some code
On Thu, 11 Jul 2013 08:32:34 -0700, Metallicow wrote:
> How do I get the OS System Font Directory(Cross-Platform) in python?
What makes you think the system *has* a system font directory?
In the traditional X11 model, the only program which needs fonts is the X
server, and that can be configured
Fábio Santos, 11.07.2013 10:16:
> Guido tweeted that yesterday. It seems interesting. Although I'm not
> comfortable using a subset of the language.
>
> They seem to want to kill the GIL. This could get much more popular when
> they do.
Then don't forget to also take a look at Cython.
Stefan
-
On Thu, Jul 11, 2013 at 10:34 AM, Oscar Benjamin
wrote:
> On 11 July 2013 17:21, Russel Walker wrote:
>> To confess, this is the second time I've made the mistake of trying to
>> implement generator like functionality of a builtin when there already is on
>> in itertools. Need to start studying
On Thursday, July 11, 2013 12:47:01 PM UTC-5, Nobody wrote:
>
> What makes you think the system *has* a system font directory?
Way back when I was kid, I remember a computer that had two colors and 1
built-in font and no mouse. Heck the keyboard was even attached in front a tube
screen box.
Wo
On Wednesday, July 10, 2013 7:57:11 PM UTC-4, Joshua Landau wrote:
> Yeah, but why keep shipping the Python interpreter? If you choose the
> installer route, you don't have to keep shipping it -- it's only
> downloaded if you need it. If not, then you don't download it again.
I admit that not ne
Le jeudi 11 juillet 2013 20:42:26 UTC+2, wxjm...@gmail.com a écrit :
> Le jeudi 11 juillet 2013 15:32:00 UTC+2, Chris Angelico a écrit :
>
> > On Thu, Jul 11, 2013 at 11:18 PM, wrote:
>
> >
>
> > > Just to stick with this funny character ẞ, a ucs-2 char
>
> >
>
> > > in the Flexible String
Le jeudi 11 juillet 2013 15:32:00 UTC+2, Chris Angelico a écrit :
> On Thu, Jul 11, 2013 at 11:18 PM, wrote:
>
> > Just to stick with this funny character ẞ, a ucs-2 char
>
> > in the Flexible String Representation nomenclature.
>
> >
>
> > It seems to me that, when one needs more than ten by
On 11 Jul 2013 17:38, "Oscar Benjamin" wrote:
>
> On 11 July 2013 17:21, Russel Walker wrote:
> > To confess, this is the second time I've made the mistake of trying to
implement generator like functionality of a builtin when there already is
on in itertools. Need to start studying that module ab
On Thu, Jul 11, 2013 at 1:58 PM, Fábio Santos wrote:
> Isn't all of itertools implemented in C? If we are not using a python-level
> and not-so-fast __getitem__ I would wager the C version is a lot faster.
>
> And if the input is indexable could I assume that it is not too large to
> have around i
On 11 July 2013 07:06, Steven D'Aprano wrote:
>
> But really, I'm having trouble understanding what sort of application
> would have "run an iterator to exhaustion without doing anything with the
> values" as the performance bottleneck :-)
Definitely not this one. Heck, there's even no real reaso
A user was wondering why they can't change a docstring in a module's class.
This made me think: why not have a casting operator ("reciprocal"?) to
transform a bonafide class into a mere carcass of a class which can
then modified and reanimated back into its own type with the type
function? Such t
On Tue, 09 Jul 2013 21:44:48 -0400, Dave Angel
wrote:
>On 07/09/2013 09:29 PM, David T. Ashley wrote:
>> We develop embedded software for 32-bit micros using Windows as the
>> development platform.
>>
>> We are seeking a general purpose scripting language to automate
>> certain tasks, like cleani
On Wed, 10 Jul 2013 14:38:51 -0500, Johann Hibschman
wrote:
>David T. Ashley writes:
>
>> We develop embedded software for 32-bit micros using Windows as the
>> development platform.
>...
>> I know that Tcl/Tk would do all of the above, but what about Python?
>> Any other alternatives?
>
>Given
Am 12.07.2013 02:23, schrieb Mark Janssen:
> A user was wondering why they can't change a docstring in a module's class.
For CPython builtin types (classes) and function have read-only doc
strings for multiple reasons. Internally the doc strings are stored as
constant C string literals. The __doc_
Am 11.07.2013 19:19, schrieb Metallicow:
> @ Chris “Kwpolska” Warrick
> Thanks, that is a start anyway.
> a Pure-Python way was what I was wanting, not win32api stuff.
>
> "C:\Windows\Fonts"
> The windows path proves valid. Works on XP, Vista, 7. Not sure about win8?
That's the wrong way to
On Thu, 11 Jul 2013 15:05:59 +0200, Ulrich Eckhardt wrote:
> Hello!
>
> I just stumbled over a case where Python (2.7 and 3.3 on MS Windows)
> fail to detect that an object is a function, using the callable()
> builtin function. Investigating, I found out that the object was indeed
> not callable
On Thu, 11 Jul 2013 09:45:33 -0400, Roy Smith wrote:
> In article <2fdf282e-fd28-4ba3-8c83-ce120...@googlegroups.com>,
> jus...@zeusedit.com wrote:
>
>> On Wednesday, July 10, 2013 2:17:12 PM UTC+10, Xue Fuqiao wrote:
>>
>> > * It is especially handy for selecting and deleting text.
>>
>>
On Fri, Jul 12, 2013 at 12:39 PM, Steven D'Aprano
wrote:
> Big deal. I am utterly unconvinced that raw typing speed is even close to
> a bottleneck when programming. Data entry and transcribing from (say)
> dictated text, yes. Coding, not unless you are a one-fingered hunt-and-
> peek typist. The
On Thu, 11 Jul 2013 11:42:26 -0700, wxjmfauth wrote:
> And what to say about this "ucs4" char/string '\U0001d11e' which is
> weighting 18 bytes more than an "a".
>
sys.getsizeof('\U0001d11e')
> 44
>
> A total absurdity.
You should stick to Python 3.1 and 3.2 then:
py> print(sys.version)
On 12/07/2013 9:11 AM, Joshua Landau wrote:
I also feel that:
def factory():
eatit = deque(maxlen=0).extend
def exhaust_iter(it):
"""Doc string goes here"""
eatit(it)
return exhaust_iter
exhaust_it = factory()
del factory
is a very unobvious way to change a doc
Hi Guys,
I have encountered an epoll issues. On the server side, I use epoll.poll() to
wait for events, when there is a socket which has EPOLLIN/EPOLLUP events, I
first try to read the socket (I did this coz it says EPOLLIN ready, I might
think it has some data in its recv queue). After reading
David T. Ashley, 12.07.2013 03:19:
> On Wed, 10 Jul 2013 14:38:51 -0500, Johann Hibschman wrote:
>
>> David T. Ashley writes:
>>
>>> We develop embedded software for 32-bit micros using Windows as the
>>> development platform.
>> ...
>>> I know that Tcl/Tk would do all of the above, but what about
On Fri, 12 Jul 2013 01:50:17 +1000, Chris Angelico wrote:
> On Fri, Jul 12, 2013 at 1:42 AM, Paul Rudin
> wrote:
>> Text selection with a mouse is a different thing. Sometimes it's more
>> convenient, sometimes it's not.
>
> As screens get larger and the amount of text on them increases, it's
>
On Thursday, July 11, 2013 8:27:04 PM UTC-5, Christian Heimes wrote:
> Am 11.07.2013 19:19, schrieb Metallicow:
>
> > @ Chris �Kwpolska� Warrick
>
> > Thanks, that is a start anyway.
>
> > a Pure-Python way was what I was wanting, not win32api stuff.
>
> >
>
> > "C:\Windows\Fonts"
>
> >
On Fri, Jul 12, 2013 at 2:24 PM, Steven D'Aprano
wrote:
> On Fri, 12 Jul 2013 01:50:17 +1000, Chris Angelico wrote:
>
>> On Fri, Jul 12, 2013 at 1:42 AM, Paul Rudin
>> wrote:
>>> Text selection with a mouse is a different thing. Sometimes it's more
>>> convenient, sometimes it's not.
>>
>> As scr
>
> https://bitbucket.org/cameron_simpson/css/src/374f650025f156554a986fb3fd472003d2a2519a/lib/python/cs/fileutils.py?at=default#cl-408
>
> That looks like it will do the trick for me, thank you Cameron.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, Jul 12, 2013 at 2:24 PM, Metallicow wrote:
> On Thursday, July 11, 2013 8:27:04 PM UTC-5, Christian Heimes wrote:
>> Am 11.07.2013 19:19, schrieb Metallicow:
>>
>> > @ Chris �Kwpolska� Warrick
>>
>> > Thanks, that is a start anyway.
>>
>> > a Pure-Python way was what I was wanting, not
On Thu, 11 Jul 2013 21:24:00 -0700, Metallicow wrote:
> Forgot to add >>> part. Is there any way to edit posts?
Not unless thousands of people give you access to their computer so you
can edit the emails in their inboxes.
When you send a post to a public mailing list, its out their on fifty
t
On Fri, 12 Jul 2013 00:24:26 -0400, Steven D'Aprano
wrote:
Frankly, nothing comes even close to a real mouse for feedback and ease
of use. Maybe a stylus. But that's it.
before tremors, I would agree with you. Stylus is amazingly good tool for
user interaction in a GUI. After tremors, not
Hi David,
Am 12.07.13 03:18, schrieb David T. Ashley:
On Wed, 10 Jul 2013 09:03:54 +0200, Christian Gollwitzer
wrote:
>
Robert's answer made me hesitate - what exactly is your platform? Are
you writing the scripts for the embedded platform, or for Windows, or
does the embedded controller run
77 matches
Mail list logo