:
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
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
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
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
Pyrex 0.9.7.1 is now available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
This version fixes a bug in the new integer indexing
optimisation which causes indexing of a non-sequence type
with a C int to fail with a TypeError.
What is Pyrex?
--
Pyrex is a language fo
Pyrex 0.9.7.2 is now available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
Seems I didn't quite eradicate all of the integer
indexing bugs. Here's a fix for the other half.
What is Pyrex?
--
Pyrex is a language for writing Python extension modules.
It lets you free
Pyrex 0.9.8 is now available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
This version has a number of new features:
* In-place operators (+= etc.) are now supported.
* The Pyrex compiler now has built-in facilities for
automatically tracking down and compiling all the
modu
Pyrex 0.9.8.1 is now available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
Base classes no longer need to be specified in a forward
declaration of an extension type, or in the implementation
part of an extension type defined in a .pxd file.
Also, I've come up with an even bette
still spent
far more time and effort developing the compiler than
writing the tests.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
On May 25, 9:50 pm, [EMAIL PROTECTED] wrote:
> On May 24, 9:41 am, Sh4wn <[EMAIL PROTECTED]> wrote:
>
> > Python advertises himself as a full OOP language, but why does it miss
> > one of the basic principles of OOP? Will it ever be added to python?
>
> Others have already answered this directly, b
Pyrex 0.9.8.3 is now available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
Compiling multiple .pyx files in one go works properly now, and
can be substantially faster if you have a lot of modules that
cimport from each other. I had to rearrange various things to
make this work,
Pyrex 0.9.8.4 is now available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
This version fixes a bug introduced by the last change
to unsigned integer indexing.
What is Pyrex?
--
Pyrex is a language for writing Python extension modules.
It lets you freely mix opera
I am able to use the PIL module to capture a screen or specific
window. My problem is when capturing a window (on windows XP) I can
only capture the "visible" portion of the window. Is there any way to
capture the entire window? specifically the scrolled portion of a
window that is not visible o
uot;look but don't touch" rule.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch wrote:
Paul Rubin wrote:
>
> use contextlib.nexted().
You mean contextlib.nested I guess.
Although "nexted" is an intriguing-sounding word. I wonder
what it could mean?
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
. use Python to run a setup.py file. This
ensures that the package will be installed into whichever
Python is being used to run the setup.py.
Apart from the initial installation of Python itself, I
never use an installer to install a Python package if I
can avoid it. I wouldn't trust it to install into the right
Python version.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
on
it)
I've very rarely had any problem with maintaining my
own Python installation, but as I said, I always install
packages using "python setup.py".
Python itself copes very well with having multiple
versions installed, on all platforms, but you have to
do things the Python w
rmation.
Another possibility might be to crawl the site and
build your own index based on the information you're
interested in.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
data in its
buffer waiting to be read.
When using select(), you really need to deal with the
socket directly, with no buffering in the way.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Pyrex 0.9.7 is now available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
Highlights of this version:
* I have streamlined the integer for-loop syntax. Instead
of the loop variable redundantly appearing in two places,
it's now just
for x < i < y:
...
* If you dec
Pyrex 0.9.8.5 is now available:
http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
Various minor bug fixes and improvements.
What is Pyrex?
--
Pyrex is a language for writing Python extension modules.
It lets you freely mix operations on Python and C data, with
all Python
Arnaud Delobelle wrote:
Or:
import ModuleName as this_module
Or:
this_module = __import__(__name__)
then you don't have to change anything.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ty_path, "w").write(my_naughty_data)
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
h time you want to start iterating
again.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
how copyrights work either. As far as
I know, whether something is deemed a derivative work is
judged on the basis of how similar it is to another work,
not whether its author had knowledge of the other work.
As long as you express an idea in an original way, it
shouldn't matter whe
ource and replace it with the following".
Then you're effectively distributing the modified source in
its entirety, just with a funny header at the top of each
source file that serves no useful purpose.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
would be
rather hackish, and wouldn't do anything for any
other incomparable types that might come along.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
elements
involved are transitive, and leave the semantics in other
cases undefined.
Then in the Decimal module it could be warned that the
equality relations between int-float and int-Decimal are
not transitive, perhaps noting that this can cause
problems with sets and dicts.
--
Greg
--
http
= len
:-)
(BTW, try doing that with the x.len() notation!)
--
Greg
But it's too late to change things.
--
http://mail.python.org/mailman/listinfo/python-list
Aaron "Castironpi" Brady wrote:
How do you have a yellow dog,
It's not a yellow dog, it's a dog yellow. Attention pay! :-)
--
Ewing Gregory
--
http://mail.python.org/mailman/listinfo/python-list
has namespaces, they don't have any defined
relationship to source files, so they don't help you
find which file something is defined in.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ctional
languages is that there are *no* side effects.
The confusing thing is that in everyday English the term
implies something bad or unwanted (e.g. side effects of
a drug). That's not necessarily true of the technical
meaning -- often the side effect is exactly what we want,
as in the c
aks out of the scope
of the loop is regarded as a feature, so anything
which changes that seems to be a non-starter.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
the shiny baubles you want and hiding them away in
your own nest).
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Marc 'BlackJack' Rintsch wrote:
On Fri, 03 Oct 2008 19:10:27 +1200, greg wrote:
(BTW, try doing that with the x.len() notation!)
def size(obj):
return obj.len()
or
size = operator.methodcaller('len')
No, what I meant was that if the normal way of getting
the l
nerate the .pyc after I've changed
something.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
prescribes that because it's useful
behaviour, not because it has anything to do with
recursion.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
PyGUI 1.6.1 is now available:
http://www.cosc.canterbury.ac.nz/~greg/python_gui/
Bug fixes:
- Mouse down event in a GLView caused a crash.
- Canvas methods fill_poly() and stroke_poly() didn't work. Added
a test for these.
What is
PyGUI 1.7 is now available:
http://www.cosc.canterbury.ac.nz/~greg/python_gui/
New features:
* GL.DisplayList class for managing OpenGL display
lists in a similar way to the GL.Texture class
introduced in 1.6.
* Facilites for displaying a chosen cursor when the
mouse is
Pyrex 0.9.4 is now available:
http://www.cosc.canterbury.ac.nz/~greg/python/Pyrex/
Highlights of this version:
No more lvalue casts
I have redesigned the code generator to eliminate the need
for lvalue casting. This means that Pyrex-generated code
should now be gcc4
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
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
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:
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
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
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
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
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
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
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
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
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
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
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
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
(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
d in the first place.
--
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
discourage providing defaults!
--
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
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
TerryP wrote:
If it's such a big hairy deal, just recompile a copy of the C Pre
Processor to use something other then #, and hook it up to your python
scripts in a pipe line from a shell wrapper.
Or use a different preprocessor, such as m4, that
doesn't clash with the # character
n write
it back out as code.
You might be able to get some ideas from 2to3,
which does similar kinds of source-to-source
translations.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
s run.
These restrictions mean that it isn't really quite
Python, though.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Christian Heimes wrote:
Most magic methods are implemented as descriptors. Descriptors only
looked up on the type to increase the performance of the interpreter and
to simply the C API.
There's also a semantic problem. Since new-style
classes are also instances (of class 'type') and you
can cr
r wrote:
I really like this!
But after looking over your pyGUI it does "seem" that Tkinter has a
richer widget set.
PyGUI is a work in progress. I plan to add more widgets,
but it will take a while to catch up with what's available
in Tkinter and other GUI toolkits.
I tend to add widgets as
t, once, to write it and make it fast -- and
now an endless variety of programs can be written very easily
in Python to make use of it.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
time, then optimising elsewhere
can't possibly improve the overall time by more than 1% at
the very most.
Once there are no hotspots left, then there may be further
spread-out savings to be made.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
that wasn't engineered to
cope with them.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
n with the POP_TOP opcode
This will happen if the result of the yield expression is
not used for anything in the Python code.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
rison
than to break the pattern and use =.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
advantage in being
able to use a non-standard character set on their custom-built
machines.
We should be able to do a lot better now using Unicode.
We could even heal the <> vs != rift by using a real
not-equal symbol!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ments like that.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
o imply that to get all of the operators, only
__lt__() and __eq__() need to be defined (just __lt__() should suffice
though I thought).
So, which is it supposed to be? Or am I reading the documentation
wrong?
Thanks!
-Greg-
--
http://mail.python.org/mailman/listinfo/python-list
I'd like to query my local MySQL db and send the results to a locally
served web page. I've poked around and found complex examples using
web2py and pylons What's best for beginners? Can somebody lay out
the basic steps for me?
thanks,
Greg
--
http://mail.python.org/m
ython users (and potential python users)
who could potentially apply new skills to several in-house projects.
The difficulty for the teacher would be covering breadth of experience
we have currently.
Any thoughts or advice would be greatly appreciated. Thanks very
much,
Greg
--
http://mail.pytho
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
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
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
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
. 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
s are local to it.
--
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
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
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
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
way of using
the existing data structures to achieve the same
goal.
--
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
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
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
b,
one noun, one non-cliched adjective and one
Monty Python reference."
--
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
ith the key space of the items put into
them.
--
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
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
suspect something similar applies to
the difficulty of writing programs.
--
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
depending on
how much you C-ify things.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
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
301 - 400 of 1198 matches
Mail list logo