ch of smaller examples.
I'm looking for a site with this sort of information to pass along to my son
who's entering his sophomore year of college, has one Java course under his
belt, and will take a second course in the fall. I'm hoping to reach him
before his brain turns to mush.
; http://pleac.sourceforge.net/
>> http://www.angelfire.com/tx4/cus/shapes/index.html
Thanks for the extensive list of sites!
Skip
--
http://mail.python.org/mailman/listinfo/python-list
bearophile> I'm sure lot of people like Cython, but I prefer a more
bearophile> transparent language, that doesn't hide me how it works
bearophile> inside.
Why not just write extension modules in C then?
--
Skip Montanaro - [email protected] - http://www.smontanaro
ings (like RoundUp). Somebody even built a SpamBayes for YouTube
browser extension:
http://userscripts.org/scripts/show/13839
Skip
--
http://mail.python.org/mailman/listinfo/python-list
me()
>>> os.path.join(dirname, "%s.%s.%s" % (h, tname, os.getpid()))
u'/tmp/\xef.MainThread.11004'
It works for Frank on his Windows box as well. Any ideas how to properly
Unicode-proof this code?
Thanks,
--
Skip Montanaro - [email protected] - http://www.smontanaro.net/
when i wake up with a heart rate below 40, i head right for the espresso
machine. -- chaos @ forums.usms.org
--
http://mail.python.org/mailman/listinfo/python-list
acquire
the GIL before executing any calls into the Python runtime or returning.
--
Skip Montanaro - [email protected] - http://www.smontanaro.net/
when i wake up with a heart rate below 40, i head right for the espresso
machine. -- chaos @ forums.usms.org
--
http://mail.python.org/mailman/listinfo/python-list
it's likely that rewriting critical parts in C or
using packages like numpy would improve there performance with or without
multi-threading. For people who aren't used to C there are tools like Pyrex
and Cython which provide a middle road.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
i-threading under the
covers
* use multiple processes
* rewrite your code to use more efficient algorithms
I don't write those out of ignorance for your plight. It's just that if you
want a faster Python program today you're going to have to look elsewhere
for your
use some assistance. We have been held up
because our existing Windows experts have been too busy to contribute much
for a couple years.
--
Skip Montanaro - [email protected] - http://www.smontanaro.net/
when i wake up with a heart rate below 40, i head right for the espresso
machine.
(fs)
...
for s, row in enumerate(reader):
dset.resize(s, axis=0)
--
Skip Montanaro - [email protected] - http://www.smontanaro.net/
when i wake up with a heart rate below 40, i head right for the espresso
machine. -- chaos @ forums.usms.org
--
http://mail.python.org/mailman/listinfo/python-list
module where I work, but I've never encountered this
problem (or a timeout parameter of any kind). At any rate, you'll probably
have more luck asking on the python-sybase mailing list:
[email protected]
--
Skip Montanaro - [email protected] - http://www.smontanaro.ne
Gil> There's no such group as python-sybase :-(
http://sourceforge.net/mailarchive/forum.php?forum_name=python-sybase-misc
S
--
http://mail.python.org/mailman/listinfo/python-list
version are you using?
We're still running 2.4.5 at work and have a slightly hacked very old
version of the python-sybase package (0.36).
--
Skip Montanaro - [email protected] - http://www.smontanaro.net/
when i wake up with a heart rate below 40, i head right for the espresso
http://www.smontanaro.net/python/Cache.py
Skip
--
http://mail.python.org/mailman/listinfo/python-list
>> My Cache module does #1 and #3. I'm not sure if you want #2 for
>> internal cache maintenance or for as part of the API.
>>
>> http://www.smontanaro.net/python/Cache.py
pdpi> I'm not sure whether #2 is doable at all, as written. You _need_ a
pdpi> complete history
file
into memory. Learn to operate a line (or a few lines) at a time. Try
something like:
a = open("/home/sservice/nfbc/GenoData/CompareCalls3.diff")
for line in a:
do your per-line work here
--
Skip Montanaro - [email protected] - http://www.smontanaro.net/
when i
Nicolas> Here is the ticket:
Nicolas> https://www.logilab.net/elo/ticket/9634
Is it possible to get read-only access to the tracker? It's prompting me
for a login which I don't have.
Thx,
--
Skip Montanaro - [email protected] - http://www.smontanaro.net/
when i wake
ake them away from me !
I don't think your tabs have been taken away, you just can't mix them with
spaces.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
uot;avec" means "with", but I don't
understand the difference between "avec malloc *int" and "avec []". Can you
explain please?
Thx,
--
Skip Montanaro - [email protected] - http://www.smontanaro.net/
That's more than a dress. That's an Audrey Hep
(I'm currently using a 5-second interval and 10 lines of output). I
would have expected that prstat would simply flush stdout after each block
of output.
Any ideas about how to get prstat to cooperate better?
Thanks,
--
Skip Montanaro - [email protected] - http://www.smontanaro.net/
That
Sorry for the low content email. Testing the mail-to-news gateway on
mail.python.org. Don't flame me for not using a test newsgroup. ;-)
--
Skip Montanaro - [email protected] - http://www.smontanaro.net/
Getting old sucks, but it beats dying young
--
http://mail.python.org/mailman/lis
people are aware
of to wrangle the wiki into better shape?
Thanks,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
other comments you like to your response.
Private replies please.
Thanks,
--
Skip Montanaro - [email protected] - http://www.smontanaro.net/
Getting old sucks, but it beats dying young
--
http://mail.python.org/mailman/listinfo/python-list
This one:
> "A list of FooEntry instances"
Besides the obvious spelling issues in the others, it's not
immediately clear if the list contains just FooEntry instances,
FooEntry classes (perhaps subclasses) or a mix of the two. #4 makes
it clear.
Skip
--
http://mail.python.or
to figure them out from the code
> layout. But this one is absolutely right:
I think "irrelevant" in this context means stuff like memory management.
My fave was #7: "It is easier to write an incorrect program than
understand a correct one," which explains in large part why
I haven't touched the SpamBayes setup for the usenet-to-mail gateway
in a long while. For whatever reason, this message was either held
and then approved by the current list moderator(s), or (more likely)
slipped through unscathed. No filter is perfect.
Skip
On Tue, May 14, 2013 at 1:
ne weren't set on the command line.
At that point, set them to the actual defaults. I think that's a
pretty common idiom.
Note: I am an old cranky dude and still use getopt. This idiom is
pretty easy there. YMMV with argparse or optparse.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
> However, maybe I could ...
... switch to getopt?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Perhaps you want len(reader) instead? Or a counter which increments for
every row read which has an item in column A?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
> len(reader) gives me an error.
Apologies. len(list(reader)) should work. Of course, you'll wind up
loading the entire CSV file into memory. You might want to just count
row-by-row:
n = 0
for row in reader:
n += 1
Skip
--
http://mail.python.org/mailman/listinfo/python-list
> So rather than
>>a
>>b
>>c
>>d
>>e
>>f
> I would get [a, b, c, d, e, f]
all_items = []
for row in reader:
all_items.append(row[0])
Skip
--
http://mail.python.org/mailman/listinfo/python-list
hrough this before asking the CherryPy folks for help:
http://www.catb.org/esr/faqs/smart-questions.html
Skip
--
http://mail.python.org/mailman/listinfo/python-list
nrelated can be.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
basically useless in Python -- you can just use a
> module function instead of a staticmethod.
That is, the "@staticmethod" decorator doesn't mean, "call this function
once."
Skip
--
http://mail.python.org/mailman/listinfo/python-list
's format method.
You might be able to get by with a change of your LOCALE setting
and/or a peek at the documentation for the locale module.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
apologize for
(inadvertently) spreading FUD.
It does seem like the documentation should be updated in a few places.
If the decision has been made to not remove the older system, it
might be worthwhile to mention that somewhere. Clearly the tutorial
and PEP 3101 should be updated.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
>>>> Please stop perpetuating this myth, see
>>>> http://mail.python.org/pipermail/python-dev/2012-February/116789.html
>>>> and http://bugs.python.org/issue14123
>>>>
>>> What myth?
>>
>> The myth that % string formatti
#x27;
>>> print s2.getvalue()
What is it about io.StringIO that it doesn't like strings and requires
Unicode? This is on an OpenSUSE 12.1 system. I have tried with LANG
set to the default ("en_US.UTF-8") and to "C". I also tried on a
Solaris system with an older micro revision of Python 2.7. Same
result.
Am I missing something about how io.StringIO works? I thought it was
a more-or-less drop-in replacement for StringIO.StringIO.
Thx,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
am, expecting Unicode
> objects for transcription. 'str' is, in that context, probably
> considered as 'bytes' in Python 3.
>
Thanks. This example was based on a function in Matplotlib. It appears the
author switched from StringIO.StringIO to io.StringIO between 1.1
> The terror that most people feel when hearing "m4" is because m4 was
associated with sendmail, not because m4 was inherently awful.
In fact, m4 made sendmail configs easier to maintain.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Check out the rrule module in the python-dateutil package:
http://labix.org/python-dateutil
https://pypi.python.org/pypi/python-dateutil
Skip
--
http://mail.python.org/mailman/listinfo/python-list
> Did you tried running that by a standalone Python interpreter? Did you
> notice something strange, something like that an empty line is missing
> between headers and body?
He will get an extra blank line, since he added a newline character at
the end of his Content-Type string.
Skip
spelling, and thus fail to find it. For example tcl 8.5 might be
installed as libtcl85.so, libtcl8.5.dylib, etc. I believe the modules
which failed for you are probably all named in a straightforward
fashion, so missing underlying libraries are probably the culprit.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
uild 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> print
>>> x = print
File "", line 1
x = print
^
SyntaxError: invalid syntax
Skip
--
http://mail.python.org/mailman/listinfo/python-list
>>> int="five"
>>> [int(i) for i in ["1","2","3"]]
TypeError: str is not callable
> Now how are you going to get the original int type back?
Magic. :-)
>>> int = "five"
>>> int("a")
Traceback (most recent call last):
File "", line 1, in
TypeError: 'str' object is not callable
>>> from __buil
It seems that if you find a line matching the first part of the
pattern, you could just as easily split the line yourself instead of
creating a group.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ght", "credits" or "license" for more information.
>>> import os
>>> os.putenv("PATH", "/tmp")
>>> os.system("/usr/bin/env")
...
PATH=/tmp
...
Skip
--
http://mail.python.org/mailman/listinfo/python-list
arse_requirements(requirements))
File "/opt/TWWfsw/distribute06/lib/python27/pkg_resources.py", line
584, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: logilab-astroid>=0.24.3
How do I work around this problem? I'd rather be hacking on pylint
than struggling with distutils.
Thx,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
When the bubbles URL fails, Chrome suggests simply databrewery.org,
which seems to work, though it has no mention of bubbles.
Skip
On Mon, Jun 24, 2013 at 3:54 AM, Dariusz Suchojad wrote:
> On 06/23/2013 07:58 PM, Stefan Urbanek wrote:
>
>> If you have any comments, suggestions
function's namespace and modify it, you should be able
to perform the same trick for most functions or methods written in C.
>>> sys._settrace = sys.settrace
>>> def settrace(*args, **kwds):
... return sys._settrace(*args, **kwds)
...
>>> sys.settrace = sys._settrace
Totally untested. No warranties expressed or implied. YMMV... etc, etc
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ps like the stuff that
Google Groups and Gmane create, this mailing list is my only exposure
to Usenet. I have no idea if periodic FAQ posting is common practice
anymore. It might be worthwhile to create one if it's kept fairly
brief and to the point.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
> Does anyone know why CPython 2.5 is a dependency for Jython 2.5.1+ on
> Debian squeeze?
Might Jython use some Python modules/packages unmodified? Does
sys.path in Jython refer to the CPython tree?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Last I knew, Fredrik was working for Google. According to his
LinkedIn profile he's a Google employee in Zurich, apparently doing
YouTube stuff (assuming his profile is up-to-date).
Skip
--
http://mail.python.org/mailman/listinfo/python-list
imestamps are represented as Python datetime objects, the
problem gets a bit easier, especially if you want to find the
beginning and ending timestamps of a bunch of dates. Sort, then throw
some itertools.groupby pixie dust at it. My ancient, reptilian brain
has never quite grokked all that iter
text editors probably present similar issues for
their users. They all involve:
* a lot of typing,
* use of modifier keys (ctrl, alt, command, etc)
* movement between the mouse and the keyboard
Skip
--
http://mail.python.org/mailman/listinfo/python-list
macros are, I find it very odd that
recent versions of GNU Emacs dispensed with the old key binding to C-x
c.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
the GNU switch to kmacro, and
reasserting my preference for the way I called ediff commands meant
that the new spelling of the kmacro stuff got dropped. I do use C-x (
and C-x ) to define macros.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
print 2, output
output = []
while len(output) < 10:
r = int(round(random.random() * 500))
if r % 2:
r *= 2
output.append(r)
print 3, output
getting-tired-of-homework-questions-in-my-old-age-ly, y'rs,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
> You assume that the professor (or more likely, TA) will take the time
> to ask them to explain the program and not just grade them down for
> the extra work they had to do.
Well, that would be fine too. :-)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
> It wonder if 5-bit chars was a
> common compression scheme.
http://en.wikipedia.org/wiki/List_of_binary_codes
Baudot was pretty common, as I recall, though ASCII and EBCDIC ruled
by the time I started punching cards.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
04. Any idea if the plunge base is available separately
and will fit my motor?
Skip
--
http://mail.python.org/mailman/listinfo/python-list
> But hey, the plunge router recommendations are great!
Yeah, based on Grant's research, I found a used PC 690-series base on
eBay for my wife for her birthday. I think she will be psyched. Lots
easier to make keyhole slots with a plunge base.
:-)
Skip
--
http://mail.python.org
> ... meant to be the word "posted", before his sentence got cut off by the
> Python Secret Underground.
Argh! That which shall not be named! Please, for the sake of all that
is right, please only use the initials, PS
--
http://mail.python.org/mailman/listinfo/python-list
> Either that or it's funny only to other Australians.
Or the Dutch.
S
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, Jul 10, 2013 at 7:39 AM, Joshua Landau wrote:
> On 10 July 2013 13:35, Skip Montanaro wrote:
>>> Either that or it's funny only to other Australians.
>>
>> Or the Dutch.
>
> Or us Brits.
Hells bells... It appears everyone found it funny except the tr
> I can't help you. I'm astonished. Trying to imagine the work environment
> where this technology would be necessary
http://www.iseriespython.com/app/ispMain.py/Start?job=Home
Skip
--
http://mail.python.org/mailman/listinfo/python-list
s BCC'd (implicit
destination). If you message was held by Mailman, moderator overload
is the most likely cause of the delay. It's also possible Mailman got
overwhelmed, but I've seen no postmaster messages suggesting there
were any systemic problems.
BTW, although SpamBayes serves as a last resort for mail arriving via
SMTP, it is the only line of defense for mail gatewayed from Usenet.
I'm sure I can dredge up the code I wrote for that if anyone wants it
for another application.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
g subscription information in Mailman to make
sure you haven't inadvertently done something. If the problem
persists, send a note to [email protected] describing the problem,
and include a message (with all its headers intact) that demonstrates
the problem, as Chris did with the timestamps.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
Serhiy> The string replace() method is fastest (at least in Python 3.3+). See
Serhiy> implementation of html.escape() etc.
I trust everybody knows by now that when you want to use regular
expressions you should shell out to Perl for the best performance. :-)
Skip
--
http://mail.pyth
; random.shuffle(words)
>>> words[0:4]
['live', 'skat', 'levy', 'cove']
>>> [makePigLatin(word) for word in words[0:4]]
['ivelay', 'atskay', 'evylay', 'ovecay']
:-)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
s just me.)
I use pylint all the time, and coverage from time-to-time, have used
nose in the past, but not for my current stuff. All are worth your
time.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
> Thank you! What tool do you use for coverage?
coverage. :-)
> And have you used pychecker?
Yes, in fact, I used to use a wrapper script I wrote that ran both
pylint and pychecker, then massaged the output into
suitable-for-emacs-next-error-command
> I heard it is as good as pylint. What do yo
> Could you please elaborate on the difference of the two? I heard pylint
> does not import your source code when it is analyzing, while pychecker does.
> Does that make some difference? Moreover, do you personally like pylint or
> pycheker and why?
I haven't followed pychecker development for awh
]
...
Traceback (most recent call last):
File "", line 1, in
RuntimeError: dictionary changed size during iteration
>>> for k in list(d):
... if k == 3:
... del d[k+1]
...
Traceback (most recent call last):
File "", line 3, in
KeyError: 4
>>> d.ke
ar of books meant to be read with page or column
widths of 100 or more characters. I suspect they would be few and far
between.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ecent compromise.
Skip
--
http://mail.python.org/mailman/listinfo/python-list
ee the attached graph
for the distribution of line lengths for the current project where I
spend most of my time these days (just Python code, blank lines
elided, comment lines included). Stretching the max out to 100
columns when most lines are less than 60 columns just wastes screen
real est
ut:
>>> repr(1e+30)
'1e+30'
>>> repr(1e+99)
'9.9997e+98'
This problem was fixed in 2.7 (and presumably in 3.something as well),
but it used to be a problem. :-)
Skip
--
http://mail.python.org/mailman/listinfo/python-list
We just upgraded the Mailman installation on mail.python.org. Part of that
installation includes spam filtering on messages gated from Usenet to the
python-
[email protected] mailing list. This message is a quick test of that function.
You can ignore it.
Skip Montanaro
--
http
x27;t turn up any promising web pages, and I didn't find anything in
the various documentation files in the repo related to building
Python.
Any suggestions about how to resolve this would be appreciated.
Thx,
Skip
--
http://mail.python.org/mailman/listinfo/python-list
What method(s) does a class have to support to properly emulate a container
which supports turning it into a list? For example:
class Foo:
pass
f = Foo()
print list(f)
Is it just __iter__() and next()? (I'm still using 2.4 and 2.7.)
Thx,
Skip
--
http://mail.python.org/ma
> If using __getitem__ it needs to work with integers from 0 to len(f)-1,
> and raise IndexError for len(f), len(f+1), etc.
Ah, thanks. I have a __getitem__ method, but it currently doesn't raise
IndexError. (I'm indexing into a ring buffer, and the usage of the class
pretty much precludes index
27/lib/python2.7/ctypes/util.py
libm.so.6
libc.so.6
libbz2.so.1
libcrypt.so.1
On my Mac:
% python ~/src/python/release27-maint/Lib/ctypes/util.py
/usr/lib/libm.dylib
/usr/lib/libc.dylib
/usr/lib/libbz2.dylib
On Solaris:
% python /opt/TWWfsw/python27/lib/python2.7/ctypes/util.
> After worming around distutils' inability to use
> environment variables to add command line flags to gcc, I'm stuck with
> an error trying to locate libc:
...
Should have poked around bugs.python.org first. This was reported,
with a patch that works for me: http://bugs.python.org/issue528
some questions
explore various dark corners of the language and its libraries, the
experience level runs the gamut, from people just learning the
language to core developers. So, fire away. It does help if you don't
ask us to do your homework for you. :-)
Skip
--
https://mail.python.org/mai
> * asyncio with its a-dialect
What is a/the "a-dialect"?
S
--
https://mail.python.org/mailman/listinfo/python-list
That link's not working for me, even after changing the double slash
to a single slash.
Skip
On Sun, Sep 10, 2017 at 1:45 PM, Stephen Michell
wrote:
> My apologies. I maintain that website.
>
> There should have been no broken links. I will fix that.
>
> The previous ver
These links work:
*
http://open-std.org/JTC1/SC22/WG23/docs/ISO-IECJTC1-SC22-WG23_N0702-tr24772-4-draft-python-before-mtg-48-2017-03-10.pdf
*
http://open-std.org/JTC1/SC22/WG23/docs/ISO-IECJTC1-SC22-WG23_N0702-tr24772-4-draft-python-before-mtg-48-2017-03-10.docx
Skip
On Sun, Sep 10, 2017 at
r photos.
I put the pages up on my Google Drive. If you think you might be able to
help (and are willing :-), let me know (offline) and I'll send you the
links.
Thanks,
Skip
--
https://mail.python.org/mailman/listinfo/python-list
missing some sort of nose-markdown plugin which would
magically make this work?
Thx,
Skip
--
https://mail.python.org/mailman/listinfo/python-list
ests from file ...
I believe I figured this out. It appears to be sufficient to add
doctest-extension=md
to my noserc file.
Camping happy, am I,
Skip
--
https://mail.python.org/mailman/listinfo/python-list
rst, I suppose, but
then I'd have to add a magic token to my files to tell Emacs they are
really in Markdown format.
Skip
--
https://mail.python.org/mailman/listinfo/python-list
Actually, I semi-lied. It seems to pick up the second of two examples,
and gets a bit confused about leading whitespace. I think I need to do
some more fiddling.
S
--
https://mail.python.org/mailman/listinfo/python-list
es in the document. They
are just concatenated into one big "test".
Skip
--
https://mail.python.org/mailman/listinfo/python-list
w here at work. Markdown seems to be the agreed upon way to write
plain text documentation.
Skip
--
https://mail.python.org/mailman/listinfo/python-list
s stuff best. In theory,
[email protected] might be the best place to contact them, though
I suspect that's not quite the right place for an extended discussion
of the topic.
Skip
--
https://mail.python.org/mailman/listinfo/python-list
[email protected] for one of the smart folks there
to investigate.
Skip
--
https://mail.python.org/mailman/listinfo/python-list
which guarantees that your initialize function is called precisely
once?
This all seems rather messy. I'm open to better ways to do this, but
as I've only had one cup of coffee this morning, no spark of insight
has zapped my frontal cortex as yet.
Thx,
Skip
--
https://mail.python.org/m
est. The declaration goes
> in a conftest.py file alongside your test files.
Thanks. I'm not a py.test user, but it turns out that nose (which I do
use) appears
to have something similar:
https://nose.readthedocs.io/en/latest/doc_tests/test_init_plugin/init_plugin.html
Thanks for the nudge
On Wed, Oct 4, 2017 at 9:53 AM, Steve D'Aprano
wrote:
> On Thu, 5 Oct 2017 12:07 am, Skip Montanaro wrote:
>
>> Suppose you want to test a package (in the general sense of the word,
>> not necessarily a Python package).
>
> I'm... not sure I understand. Given
901 - 1000 of 2051 matches
Mail list logo