operations turn out to be faster.
That also goes for any of the other things being
discussed here. Especially if you're used to C, one's
intuitions about speed can go badly astray where
Python is concerned. The only way to be sure is to
measure!
--
Greg
--
http://mail.python.org/mailman/listi
ex or Cython or otherwise.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
s in our
64 bit pointers in another 48 years. So 128-bit machines
ought to be making an appearance around about 2057, and
then we'll be all set until 2153 -- if we're still using
anything as quaintly old-fashioned as binary memory
addresses by then...
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
discourage providing defaults!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
increasing and decreasing the indentation level.
It keeps track of the current indentation level and
automatically prepends the appropriate amount of
whitespace to each line written out.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
d in the first place.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
(invariant2 and exitcond2) or ...
If that gets you where you want to be, then you're
home and dry.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
conference ("Tutorial Days").
An example proposal (and a blank template) can be found at
http://us.pycon.org/2010/tutorials/proposals/ .
Thanks!
Greg Lindstrom
--
http://mail.python.org/mailman/listinfo/python-list
ing module names to files. But there is no such index --
the directory structure *is* the index.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
and you got an interrupt.
The 68K family also used the term in a similar way.
I think the distinction between a bus error and a seg fault is
that bus errors are to do with physical addresses, and seg
faults are to do with virtual addresses.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
MRAB wrote:
And when someone says "January 30", do they really mean the day before
the last day of the month?
No, no, that's January -2, a *completely* different thing!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
fferent issue. There are perfectly
legitimate uses for them, and they're fine as long as you
understand the potential pitfalls and take steps to avoid
them. Although it's probably best to avoid them until you
do understand all the issues.)
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
imited -- anything which isn't a
for has to be a while of some shape, so it's harder to
avoid while True without introducing extra complexities
into the code.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
or the flag can help,
but you can't teach someone that just by giving them
an overly simplified rules such as "never use
while True:". They'll probably just replace it with
'while not done:' and think they've improved things,
without ever really understanding the iss
s.
(BTW, "the system hasn't crashed yet" can't be the loop invariant,
because if the loop ever exits then it means the system must have
crashed, so the loop invariant is no longer true!)
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
nvironment, and everything had to be cross-compiled.
Debugging consisted of counting the number of times
SysBeep got called before the bomb icon appeared...)
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ow it to be a package with submodules.
Whether that's a serious disadvantage depends on how big and
complicated you expect the submissions to be.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Brian D wrote:
This isn't merely a question of knowing when to use the right
tool. It's a question about how to become a better developer using
regular expressions.
It could be said that if you want to learn how to use a
hammer, it's better to practise on nails rather than
s
Humerus 2.1 is now available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Albow/Humerus-2.1.0.zip
Online documentation:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Albow/Humerus-2.1.0/doc/
In this version, the code for handling levels has been separated out
into a new pair
On Sep 30, 6:58 am, "lallous" wrote:
> Hello
>
> Can anyone suggest a good book Python book for advancing from beginner
> level?
>
> (I started with Learning Python 3rd ed)
>
> Regards,
> Elias
Elias,
Try "Core Python Programming", 2nd Editi
Peng Yu wrote:
What python/OS are you using?
python 2.6.2 and CentOS
Just tried 2.6 on Darwin, and it does happen. So looks
like 2.6 has been changed to inherit the permission
bits from the .py. Makes sense, except that the x bits
should really be turned off.
--
Greg
--
http
Also, what kind of file system are the files on?
Unixes often report the x bit as always being on
when the file system doesn't have x bits (e.g.
for FAT-based file systems).
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Peng Yu wrote:
-rw--- 1 pengy lilab 29 2009-09-26 10:10:45 main.py
-rwx-- 1 pengy lilab 106 2009-09-26 10:19:17 test.py
-rwx-- 1 pengy lilab 339 2009-09-26 10:20:39 test.pyc
Doesn't happen for me with 2.5 on Darwin.
What python/OS are you using?
--
Greg
--
http://mail.pytho
space.
E.g. on the original BBC, you could either have a
decently large program, *or* decently hi-res graphics,
but not both at the same time. :-(
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ALBOW - A Little Bit of Widgetry for PyGame
Version 2.1 is now available.
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Albow/
Highlights of this version:
* OpenGL faciliites
* Music facilities
* Drop-down menus and menu bars
What is Albow?
Albow is a library for creating GUIs u
one who doesn't understand the
field (i.e. anything which doesn't use a DFA).
Plex uses a DFA.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
t of exploring new ideas may
be less influenced by the constraints of language
than the general population.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
xpressed the precise
concept I had in mind. Yet I was clearly capable of thinking
about it, otherwise I wouldn't have noticed that I was missing
a word!
So in my humble opinion, the strong form of the Sapir-Whorf
hypothesis is bunk. :-)
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Source
project. Any topic relating to Python is eligible.
Tutorial teachers are paid $1,000.00 per class for their efforts.
Interested (we hope so!)? More information is available at
http://us.pycon.org/2010/tutorials/proposals/ or write us at
pycon-tutori...@python.org.
We look forward to hea
I thought that before I launch onto building my own
system to accomplish this I'd ask if it's been done before and, if so, how?
What are the isues I need to worry about?
Thanks,
--greg
--
http://mail.python.org/mailman/listinfo/python-list
More information, including a sample proposal and blank template, are at
http://us.pycon.org/2010/tutorials/proposals/.
Questions? Email us at pycon-tutori...@python.org.
Greg Lindstrom
--
http://mail.python.org/mailman/listinfo/python-list
ss, in the
module where the class is defined.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
stions? You can contact us at the PyCon Email
Listand we will get back with you.
We look forward to hearing from you!
Greg Lindstrom
Tutorial Coordinator
PyCon 2010 (Atlanta)
--
http://mail.python.org/mailman/listinfo/python-list
e how there could be any great difficulty with implementing
that -- it only affects the scanner.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
e has already started tinkering with a Fedex
+SOAP module before I potentially re-invent the wheel. If there's
nothing in the works yet, would anyone be interested in working with
me on such a module?
Thanks,
Greg
--
http://mail.python.org/mailman/listinfo/python-list
x27; statement
always calls it with the current globals() and locals().
If you pass an empty dict for 'globals', I think the
effect will be to cause the module name to always be
interpreted as a top-level module (i.e. no relative
import). But I'm not sure.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
J. Cliff Dyer wrote:
What happens if you use a literal like 0x10f 304?
To me the obvious thing to do is concatenate them
textually and then treat the whole thing as a single
numeric literal. Anything else wouldn't be sane, IMO.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
James Harris wrote:
I don't know yet whether it will be
easier to modify the tree or to create a new one for each phase.
You can create a new tree using this style as
well. Just have each method create and return a
new node instead of modifying the existing one.
--
Greg
--
import A_Part1
from A_Part2 import A_Part2
class A(A_Part1, A_Part2):
...
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ue of attack would be
to use your python to compile a known piece of code
that exercises all the opcodes, and compare the result
with that from a standard python.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
stdio object is being locked
while one of the threads is using it, which would also
account for the observed half-duplex behaviour.
Another good reason to steer clear of file objects!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
d and fw to the
writing thread.
You could also try avoiding file objects altogether
and use the raw system calls in the os module. Since
you're not using any buffering, there's little reason
to use the stdio layer. If you do that, you should be
able to use the same file descriptor for
, though I have no personal
> experience with either. But perhaps that will also give you some
> terms or starting points for searching for other options.
This is also very helpful. In particular Spread, looks very
attractive.
Thanks for the tip,
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ot to know which
manual to look in.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
s, etc.
If you don't want that, then write the format string as
'This is a hex number: 0x{:08x}'
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
On Aug 11, 3:00 pm, Kushal Kumaran
wrote:
> You could use the socket module to broadcast. Using INADDR_BROADCAST
> as the destination should do it. I fail to recollect whether that
> will need root privileges...
Awesome, I think this is exactly what I'm looking for. Much
appr
table custom compressor.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
there was an ambiguity between multiple args and
a single arg that happened to be a tuple.
This was before keyword arguments existed -- they would
have been hard to incorporate into the old scheme.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ned out to
participate.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
t killed things like the Lisp machine. Their
developers couldn't keep up with the huge resources that
people like Intel and Motorola had to throw at CPU
development, so eventually a general-purpose CPU could
run Lisp faster than a Lisp machine.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
can
obfuscate things just as much if you really want!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
, TO_PROCEED_TO = moo)
d.quack()
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Bearophile wrote:
Was this link, shown by William, not enough?
http://hg.flibuste.net/libre/games/cheval/file/46797c3a5136/chevalx.pyx#l1
Yes, sorry, I posted too soon.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
trace mechanism.
There really ought to be a 'yield' event to distinguish
yields from returns.
You could put in a feature request on python-dev
concerning this.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
c, but if I did, I would tend
to think he meant to say that none of a, b,
c are equal to any other. That's not what it
means in Python, though.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Robert Kern wrote:
a[:0] = array('i', [0])
Not when 'a' is a numpy array rather than an array.array.
That's true, but I got the impression that the OP was
talking about array.array, not numpy.array.
It's very confusing having two widely-used types
both called
which is not my
intention), what are my options if I want to create xml? Ceratinly writing
my own routine is an option, but I bet there are better ones :-)
How about if I need/want to parse or process an XML file?
Thanks!
--greg
--
http://mail.python.org/mailman/listinfo/python-list
bdb112 wrote:
I saw this interest syntax on this site
x[:0]=0
I guess that is cute, but could be confusing(and doesn't work)
It does if you use an array of the appropriate
type on the right hand side:
a[:0] = array('i', [0])
--
Greg
--
http://mail.python.org/mailman/
n the types of the operands is okay in a
statically typed language. But it's asking for trouble in
a dynamically-typed language, especially where it's common
practice to use ints as a substitute for floats that
happen to have integer values.
EIBTI in this case.
--
Greg
--
http://mail
depending on
how much you C-ify things.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
modules.
That's because the existing string type stores the characters
in the string object itself. A mutable variant would have to
contain a pointer to a resizable memory block, and therefore
couldn't be used as a drop-in replacement by existing C
code that expects a string.
--
Gr
suspect something similar applies to
the difficulty of writing programs.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
to find ways of writing less bugs is a
worthy goal, but I think of it more in terms of
adopting patterns of thought and programming that
make it more likely you will write code that does
what you had in mind, rather than a separate
"proof" process that you go through afterwards.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Deep_Feelings wrote:
So you have chosen programming language "x" so shall you tell us why
you did so , and what negatives or positives it has ?
This summarises my reasons for choosing Python
fairly well:
http://www1.american.edu/cas/econ/faculty/isaac/choose_python.pdf
--
Gr
ith the key space of the items put into
them.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
e specified the design so rigorously
that not the slightest spark of creativity is needed
to implement it, you *have* coded it.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
b,
one noun, one non-cliched adjective and one
Monty Python reference."
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Dave Angel wrote:
By the time I graduated, I had five six-level languages
^^^
Are they languages that you have to edit using vi? :-)
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
t must be at a much finer
granularity than anything we've so far observed, and
the discrete things that we have observed probably
aren't direct reflections of it.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
t running afoul of the various theorems concerning the
non-existince of hidden variable theories...
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
way of using
the existing data structures to achieve the same
goal.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Script) Python's debug
system is largely confusing to me, but of course I'll keep at it. I
would love to see a step-by-step debugging tutorial designed for
someone like me who usually wants to single-step through an entire
script.
Thanks for any help,
Greg Reyna
--
http://mail.python.org/mailman/listinfo/python-list
tainly appears un-intuitive
It is, but it's hard to see what could be done to
improve the situation without introducing worse
problems.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
unless one is reading from a server
that interprets X-no-archive to mean "delete before reading".
Can't be too careful with security. Destroy it,
memorize it and then read it!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ike a
good one.
My only misgiving is that the user might expect to
get a KeyboardInterrupt in response to Ctrl-C, so
it might be better to just let it propagate instead
of turning it into a different exception.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
yboardInterrupt
flag from being set, but the signal will still be occurring
at the Unix level, so the system call will get interrupted.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
s are local to it.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
. This was implemented by making the
list comprehension into a nested function.
Unfortunately this leads to the same unintuitive
behaviour as a genexp when used in a class scope.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Yes. The generator expression is a function, with its
own local namespace. Since the class scope is not visible
from inside functions declared within it, the behaviour
you're seeing results.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
blems? The only way
you should be able to get reference count errors
in Pyrex code is if you're casting between Python
and non-Python types.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ssary.
Recent Python versions have a built-in type
called defaultdict that makes this kind of
thing easy.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Robert Dailey wrote:
This URL isn't even valid, can't believe I didn't get an exception!
My guess is that if you look at the data it
downloaded, you'll find it's a 404 response
page or something similar.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Albert van der Horst wrote:
Memories of Atari 260/520/1040 that had a keyboard with a key actually
marked ... HELP.
Modern day Mac keyboards have one of those, too.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
27;t rely on it.
If you want to execute the contents of an arbitrary
file, rather than a module existing somewhere in the
Python module namespace, use execfile().
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
the whole array, and then converting the rest
of the elements to that type.
If you want the standard Python copying behaviour,
use copy.copy instead (or use a[:], which might
be slightly more efficient).
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
PyWeek entry as well if you want.)
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
:
pass
Then you could easily fail to notice that
you had written 'warming' instead of 'warning'.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
m
I don't know what I need to do in order to get a
Vista look...
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
necessary libraries installed.
The API is designed to be very straightforward and Pythonic,
and it's fully documented in its own terms, so you don't
have to consult the documentation for some other library
in some other language and translate into Python.
--
Greg
--
http://mail.python.o
m, and there's no such thing as a WM_MOUSEENTER
event at all.
It's not impossible, just more bother than I want
to go to right now.
I'll reconsider the whole issue in the future if
use cases for these events come up. Right now I
don't have any.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
PyGUI 2.0.5 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
More bug fixes for various platforms.
Still no idea what's causing the "object has been destroyed"
error on Windows XP, though. Does this happen for everyone?
Is there anyone who *has* got 12-scroll.py working f
".
I'm new at this so I wanted to check with someone who knows what
they're doing. I always heard we're not supposed to mess with the
System/Library, but I guess this is an exception.
Thanks for any help,
Greg Reyna
--
http://mail.python.org/mailman/listinfo/python-list
PyGUI 2.0.4 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
Fixes a few more bugs and hopefully improves things
on Windows, although I can't be sure it will fix all
the Windows problems people are having, because I
haven't been able to reproduce some of them.
What is Py
Steven D'Aprano wrote:
To
paraphrase Charles Fiterman, the human should always win, because the
human can use the machine, but the machine can't use the human.
Unless the machine is Omnius.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ndows -- I couldn't find
any way of implementing these.
Test 37-image-cursor.py:
1. Mouse pointer hotspot is in the middle of the image.
That's okay too, it's meant to be there.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
PyGUI 2.0.2 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
Fixes problem on Windows causing "This file should not
be imported" error.
What is PyGUI?
--
PyGUI is a cross-platform GUI toolkit designed to be lightweight
and have a highly Pythonic API.
--
Gre
Terry Reedy wrote:
Does it work with 3.0?
As it stands, almost certainly not. But you're welcome
to try running it through 2to3 and see what happens.
Relevant libraries would have to be available for
3.0 as well -- not sure what the state of play is
there.
--
Greg
--
http://mail.pytho
PyGUI 2.0.1 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
Fixes some problems in setup.py affecting installation
on Linux and Windows.
What is PyGUI?
--
PyGUI is a cross-platform GUI toolkit designed to be lightweight
and have a highly Pythonic API.
--
G
PyGUI 2.0 is available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/
Highlights of this release:
* Native Windows implementation, based on pywin32 and ctypes.
* Full set of Postscript-style path construction operators
available on all platforms.
* Mouse and keyboard events can
Hello,
I'm trying to implement something very simple without using a Python
WebFramework and I need some advice. I want to send a comma delimited string
from the client to a server-side Python script. My initial plan was to use a
JavaScript function (see below) called "makerequest" that creates a
401 - 500 of 1192 matches
Mail list logo