ogle Group / mailing list:
http://groups.google.ca/group/pythoncalgary
Website:
http://www.pythoncalgary.com/
Thanks
Greg
--
http://mail.python.org/mailman/listinfo/python-list
SuPy 1.0
SuPy is a plugin for the Sketchup 3D modelling application
that lets you script it in Python.
http://www.cosc.canterbury.ac.nz/SuPy/
This is a first version and is highly experimental. Let me
know if it works for you and whether you have any problems.
--
Greg Ewing
greg.ew
om a function will have to be in the globals. This
includes other functions -- i.e. f() won't be able to
call g() in the example above.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
one possibility I just thought of -- Python may
be trying to write something to stdout or stderr, in which
case it will probably be using the wrong crt to do it.
Something to look into after I've got some sleep...
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
42)
produces
0
1
2
3
168
210
252
294
336
378
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
python is great.
No.
Python is VERY GREAT !!!
All right now, everyone...
Every Python's sacred, every Python's great,
If any Python's wasted, Guido gets irate!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
nyone thinking of
designing a 3D app would do well to study it closely, IMO.
Something with a Sketchup-like UI but designed for serious
CAD work would be an incredibly good thing to have.
In any case, your project sounds interesting, and I'll
be happy to discuss ideas if you want.
--
Gr
George Sakkis wrote:
Don't worry, it's not obvious to *anyone* new to Python (and many not-
so-new for that matter).
That's by no means certain, because we only hear from the
people who guessed the wrong way. We have no way of knowing
how many people guessed the right way.
added to Python!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
alex23 wrote:
import os
dirfd = os.open("directory-name", os.O_DIRECTORY)
os.fchdir(dirfd)
os.O_DIRECTORY must be fairly new -- it doesn't exist
in my 2.5 installation. But os.O_RDONLY seems to work
just as well for this purpose.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
Anyway, when I try to use O_RDONLY on Vista I get
"Permission denied":
According to the library ref, fchdir() is Unix-only, so there
probably isn't a use case for getting a file descriptor for
a directory on Windows in the first place.
--
Greg
--
http://
www.cosc.canterbury.ac.nz/greg.ewing/marathup/index.html
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
On Dec 3, 7:51 pm, Barry Warsaw <[EMAIL PROTECTED]> wrote:
> On behalf of the Python development team and the Python community, I
> am happy to announce the release of Python 3.0 final.
Way to go and congratulations!
--greg
--
http://mail.python.org/mailman/listinfo/python-list
ke to see this possibility left open.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Duncan Booth wrote:
If I'm logged in to one of my servers in a large datacentre then I don't what
that system to beep as that would be pretty useless.
It also might cause the datacentre operators some consternation
when one of their servers starts mysteriously beeping...
--
Gr
Johann Spies wrote:
% /usr/local/bin/python3.0 MindTree.pyw
Traceback (most recent call last):
File "MindTree.pyw", line 2, in
from future_builtins import *
ImportError: No module named future_builtins
Hmmm... does this mean that Python3 has no future? :-)
--
Gr
er managing all the critical data.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Kirk Strauser wrote:
At 2008-12-11T19:49:23Z, Steve Holden writes:
item = item[:-1]
It's easy - and broken. Bad things happen if you're using something other
than '\n' for EOL.
Or if the last line of your file doesn't end
with a newline.
--
Greg
--
http:
Gabriel Genellina wrote:
(Pipes don't work the same as sockets, although unix-like systems try
hard to hide the differences...)
BSD-based unixes implement pipes using socketpair(), so
pipes actually *are* sockets (or at least they used to be,
not sure whether it's still true)
That's not to say nobody should try, but I won't be holding
my breath.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ural meeting in January. Venue
TBA.
Thanks
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ALBOW - A Little Bit of Widgetry for PyGame
Version 2.0 is now available.
This version incorporates substantial additions and improvements.
New widgets include TabPanel, TableView, CheckBox, RadioButton and
an enhanced set of TextField-based controls.
http://www.cosc.canterbury.ac.nz/greg.ewi
other functions.
Although Guido has defended it on the grounds that it can
be inconvenient having a function that returns different
types under different circumstances. Also it discourages
making the mistake of treating the return value as a
boolean.
--
Greg
--
http://mail.python.org/mailman/lis
ed.
In my experience, either it's sufficient to just
resize one pane and keep the others a fixed size, or
you really want user control over the size of each
pane individually. Proportional resizing is a
compromise that just ends up annoying me.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
or an
event to get scheduled while in the midst of a sleep. It
also doesn't take any measures to protect its data structures
from concurrent access.
The documentation could make this clearer, especially since
it confusingly talks about "allowing other threads to run".
--
Greg
--
ht
ould have a go at rolling your own based
on a View.
Anyway, glad you're finding it useful. Feel free to ask if
you have any more questions.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
mmand line into arguments, it's
the program being run. So you need to avoid any kind of
exec or spawn operation, whether it goes through the shell
or not, unless you know the program being run isn't going
to interpret '/' as an option.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
n't
say it's useless. The main problem is that its nature
needs to be much more clearly spelled out in the
docs -- it's something of an attractive nuisance the
way it is.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
f you need to go fast,
but good for a lot of every day tasks.
The neat thing about Python is that you can strap
on a jet engine (C extension) when you really need
a burst of speed.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
James Mills wrote:
Directly importing a bash function into python is not
possible.
Well, you could write a bash interpreter in Python...
but that's probably more work than it's worth
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ard about what should and shouldn't be done in multi-
threaded apps
No, it's there because it's necessary for acceptable performance
when multiple threads are running in one interpreter. Independent
interpreters wouldn't mean the absence of a GIL; it would only
mean each int
hese extra
pointers around everywhere is bound to have some effect
on performance. The idea mightn't go down too well if it
slows things significantly in the case where you're only
using one interpreter.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ve to create its
own versions of all the builtin constants and type objects,
and import its own copy of all the modules it uses.
One wonders if it wouldn't be cheaper just to fork the
process. Shared memory can be used to transfer large lumps
of data if needed.
--
Greg
--
http://mail.python.o
e you to have a separate thread for
each interpreter, which you mightn't always want.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
en you can dump
the big lump of data to be transferred in there, and send
a short message through a pipe to the other process to
let it know it's there.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
e? It becomes visible to other
threads using the same type object. If it's not safe
for sharing, bad things happen.
Python's data model is not conducive to making a clear
distinction between "private" and "shared" objects,
except at the level of an entire interpreter.
ects, and any object reachable from them, are shared as well.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
inery tells that the attribute wasn't found. So when
your property raises an AttributeError, this is
indistinguishable from the case where the property wasn't
there at all.
To avoid this you would have to raise some exception
that doesn't derive from AttributeError.
--
Greg
--
http://mai
value, other.value)
Unfortunately, the __cmp__ method has been eliminated from
3.0 as well, so this won't work as-is. You would need to
override __lt__, __eq__, etc.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
becomes an alias for the actual parameter,
so that assigning to the formal parameter has the same
effect as assigning to the actual parameter.
Seems to me that (1) describes exactly how parameter passing
works in Python. So why insist that it's *not* call by value?
--
Greg
--
http://
Douglas Alan wrote:
greg <[EMAIL PROTECTED]> writes:
Seems to me that (1) describes exactly how parameter passing
works in Python. So why insist that it's *not* call by value?
Because there's an important distinction to be made,
The distinction isn't about parameter
Gabriel Genellina wrote:
En Tue, 28 Oct 2008 00:58:10 -0200, greg <[EMAIL PROTECTED]>
escribió:
>
(1) Call by value: The actual parameter is an expression. It is
evaluated and the result is assigned to the formal parameter.
Subsequent assignments to the formal paramet
ctual
parameter to the formal parameter.
If they understand how assignment works in Python, that
tells them all they need to know.
If they don't understand how assignment works, then they
have a more fundamental knowledge gap that needs to be
corrected first.
--
Greg
Then the questions
rn well better learn that anyway, otherwise he's
going to have massive problems programming in Python that
don't have anything to do with parameter passing!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
e" and
"call by reference" as atomic identifiers, defined in terms
of assignment semantics. Don't try to pick them apart and
understand them in terms of "values" and "references".
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
).
Since Python only has one parameter passing mechanism,
there's no need to give it a name at all. If you're
having to explain it, just explain it, and don't
bother naming it!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
rned*, not some other language
you happen to know previously.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
tory
than that.
If they understand how assignment works in Python, that tells them all
they need to know.
Nonsense.
Why? What else *do* you think they need to know?
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ke it.
There you go, getting distracted by that annoying word
"value". Forget about it, we don't need it!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Douglas Alan wrote:
greg <[EMAIL PROTECTED]> writes:
This holds for *all* languages that I know about, both
static and dynamic.
Then you don't know about all that many languages. There are
languages that use call-by-name, and those that use
call-by-value-return. Some use call-
s called a
"reference" in Python.
The historical choice of terms is somewhat unfortunate.
If they'd been called something like "call by assignment"
and "call by alias", none of this confusion would have
arisen.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
t just drop part of
their regular employment temporarily, so unless there's
quite a *lot* of money being offered (enough to offer someone
full-time employment, for example) it doesn't necessarily
make any more man-hours available.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ind out soon enough if it doesn't
support indexing or iterating or whatever you want to
do with it.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
risk of confusing them in some way. So instead, you just
tell them how it works, and leave them to decide for themselves
what name they want to give it.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
in Python.
The difference between call-by-value in Python and Pascal is
exactly the same difference as there is between assignment
in Python and Pascal. Why should we throw out one term but
not the other?
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
he value somehow.
The same thing happens when the value is passed to a
function.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
you think
that assignment is about copying the content of a variable. Assignment
in Python is simply giving a new name to an object.
Yes, and so is passing by value!
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ee).
Something has just occurred to me. If you take the
view that the value of an expression is an object,
then the terms "value" and "object" are synonymous.
So if you then insist that Python uses "call by object",
you're actually saying it uses call by value!
ll
languages, so a language-independent definition of
call-by-value needs to describe it in a more general
way.
Refusing to accept that a more general definition
exists just because it's not mentioned in your Pascal
book is a little absurd.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
along nicely and accept that "assignment"
is an acceptable term, among alternatives, for something that
has an analogy, if not an exact equivalent, in other languages,
why can't we do the same for "reference" and "call by value"?
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
rks, the result is that
p and q end up referring to the same object.
The difference is *entirely* due to the difference in the semantics
of assignment between the two languages. Once you've taken that
into account, there is no need to look for difference in the
parameter passing scheme.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
times already.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Larry Bates wrote:
You should post this on comp.python.windows as Mark and the other
Windows/COM gurus hang around there a lot.
I can't find any such newsgroup -- are you sure
that's what it's called?
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
er.
That hinges on what exactly is meant by "changes to
the arguments". In Python it can only mean assigning
directly to the bare name -- anything else isn't
changing the argument itself, but something else to
which the argument refers.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
x27;t exist just because you can't see it. There are
plenty of experiments which clearly indicate its existence.
Likewise, there are plenty of experiments that you can
perform with any Python interpreter that reveal the
existence of references, or something equivalent to them.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
made into
the inner scope. If it's changed in the inner scope, a new entry is
added there.
That sounds like a kind of copy-on-write. It's certainly not
call-by-value by any sane interpretation (contrary to your
assertion that "all calling is call-by-value").
--
Greg
--
http:/
string.
This would be the Python equivalent of the strategy used
in C to emulate call-by-reference -- and it's needed for
the same reason, i.e. the language itself only provides
call-by-value. So you pass a value that you can manually
dereference to get the same effect.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
that's not based on an actual PyFile object, since there
simply isn't one to be had.
There is an exception to that -- if the object is one that
has a file descriptor underlying it somewhere (such as a
pipe or socket) you could get that and wrap it using fdopen().
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
BJörn Lindqvist wrote:
"standard implementation completely based on WfMC specifications using
XPDL (without any proprietary extensions !)"
Ah, it's based on WtfMC. That explains everything. :-)
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
pace, name) pair, or a (sequence, index) pair
in the case of a sequence item, would be the equivalent
of a "reference" in the sense meant by "call by reference".
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
to use it in relation to Python.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
gning
that value to something?
If so, what is there to stop us from applying the Algol
definition to Python?
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ly well
think of the parameters as being in the same scope as the
rest of the procedure's locals.
What are the consequences of such assignment?
It doesn't matter what assignment means in Algol, because
we're talking about Python. We already agree on what assignment
means in Python -
lue -- i.e. as equivalent to assignment,
without any implication of copying beyond what
assignment itself implies.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
__. But an object with __slots__ doesn't necessarily
have a __dict__, and even if it does, it doesn't include
the contents of the slots. So you need to tell pickle how to
deal with it by defining __getstate__ and __setstate__ methods.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
m the traceback where to look for the problem.
It's as annoying as hell when something like this does
happen, but averaged over the lifetime of the project,
I find it doesn't cost all that much time.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ny case.
It might be more difficult to *fix* the problem without
the assertions, but you will still catch it.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
greg wrote:
Do you agree that it makes sense to talk about assigning
that value to something?
No. Why do you think that we are (mostly) careful to talk about binding
names and values instead?
That's an odd position to take, considering that the
Python docs use the
about Python,
and I respect them for that. However, that doesn't
necessarily make them authorities on programming
language terminology.
If you're going to indulge in argument by authority,
you need to pick authorities that can be considered,
er, authoritative in the field concerned...
stmt]
and what it says about binding makes it clear that assignment
is a form of binding operation.
So it doesn't matter *what* you call the result of an expression
-- a value, an object, an object reference, or whatever -- the
differences all cancel out when you define assignment in a
correspond
r from common practice in Python programming.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
thing like this, in that there will
be a way to declare that a class conforms to the Duck
interface even if it doesn't inherit from it. Then
you can just test isinstance(x, Duck).
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Mark wrote:
Thanks guys. This is for serializing to disk. I was hoping to not
have to use too many intermediate steps
You should be able to use a gzip.GzipFile
or bz2.BZ2File and pickle straight into it.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
is defined in terms of assignment regardless
of what the semantics of the assignment is then IMO call by
value is rather useless term
Not at all. It very concisely conveys how parameters
are passed, once you know how assignment works -- and
you need to understand that in any case.
--
Greg
--
ht
Nick Craig-Wood wrote:
(Note that basic pickle protocol is likely to be more compressible
than the binary version!)
Although the binary version may be more compact to
start with. It would be interesting to compare the
two and see which one wins.
--
Greg
--
http://mail.python.org/mailman
Arnaud Delobelle wrote:
Neutral element is correct. But maybe its use is limited to
mathematicians in the english-speaking word.
I've only ever seen "identity element" in English mathematics.
"Neutral element" sounds like something my car's gearbox
n useful or interesting to you? I'd also
> welcome sources of textbook type problems, because the ones provided in
> tutorials tend to be repetitive.
>
> Thanks,
> Ben
You night look at "Useless Python" (you'll have to Google for the
site). It has tons of problems from trivial to complex.
--greg
--
http://mail.python.org/mailman/listinfo/python-list
he call are evaluated first. Before execution
of the procedure begins ... new values are assigned to these
variables as follows: ... (2) the formal arguments are
assigned their values.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
o way that kind of assignment can ever create a new
object.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ot; depends on what you mean by "same".
If you define "same" in such a way that they're not, then that
definition of "same" is irrelevant to the matter at hand.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
#x27;s Object Pascal (and probably
other OO Pascal dialects) have object types that are implicitly
referred to by pointers, like Python objects -- and when you
pass one by value, only the pointer is copied, not the whole
object.
--
Greg
--
http://mail.python.org/mailman/listinfo/python-list
Aaron Brady wrote:
Call-by-value has other characteristics that Python does not
meet.
The designers of most other dynamic languages don't
seem to share that opinion, since they use the term
call-by-value just as though it *does* mean call-
by-assignment and nothing more.
--
Greg
--
issing
something really obvious.
Thanking you all in advance!
Greg
--
http://mail.python.org/mailman/listinfo/python-list
ource. As an added
> bonus you can later interact with the page by programatically, filling
> form fields, selecting options from lists and clicking buttons.
>
> HTH, Carl
Selenium. It's not pretty for what I want to do but it works ... then
again, what I need to do is not pretty either.
Ciao,
Greg
--
http://mail.python.org/mailman/listinfo/python-list
as or options are welcome.
Thanks,
Greg
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
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
201 - 300 of 1198 matches
Mail list logo