Posting the error message could help. Also you might check out this
example
http://thraxil.org/thread.txt
- Haz
--
http://mail.python.org/mailman/listinfo/python-list
#For the record, I'm not on premature optimisation anymore.
#The code is working. I just want to save hours of computing, without
relying to much on C extensions.
#Nevertheless, thansk for tips, clarifications and explanations.
> longone=longone + char # where len(char)== 1
> >
> > I known t
Alex VanderWoude a écrit :
Here's the situation. I'm using wxPython, and I want to make an enhancement
in the __init__ method of all the frame classes. The ideal place to do this
is in wxFrame.__init__, since any change there will automatically be
inherited by the other frame classes (for example,
Alex VanderWoude a écrit :
Here's the situation. I'm using wxPython, and I want to make an enhancement
in the __init__ method of all the frame classes. The ideal place to do this
is in wxFrame.__init__, since any change there will automatically be
inherited by the other frame classes (for example,
H!,
I have made a spider and now I want to use threading so it will be
faster faster and faster :)
But I don't understand threading.
So I try this but I get a error in windows 2000.
---
class connector(threading.Thread):
def __init__(self,url):
self.url = url
threading
In article <[EMAIL PROTECTED]>,
Steven Bethard <[EMAIL PROTECTED]> wrote:
> Ron Garret wrote:
> > Why doesn't this work?
> >
> from weakref import ref
> class C(str): pass
> > ...
> ref(C())
> > Traceback (most recent call last):
> > File "", line 1, in ?
> > TypeError: cannot cre
Sean Dodsworth wrote:
Can anyone tell me how to get a message's number from the message-id
using IMAP4.search?
I've tried this:
resp, items = server.search(None, 'HEADER', '"Message-id"', msgID)
but it gives me a 'bogus search criteria' error
Why do you need the 'HEADER'
Wouldn't this be enou
Antoon Pardon <[EMAIL PROTECTED]> writes:
> > There needs to be a way to send signals to threads, or raise
> > asynchronous exceptions in them. There's been some discussion in
> > sourceforge about that, but the issues involved are complex.
>
> Well I have raised this issue before and as far as I
Steve wrote:
> [an anecdote on distinguishing l1 and 11]
> What are some of other people's favourite tips for
> avoiding bugs in the first place, as opposed to finding
> them once you know they are there?
There's a good book on this topic - Writing Solid Code.
A
Hi !
Thanks.
But, for previous versions of Python, I downloaded a CHM version; and, at
http://docs.python.org/download.html, I don't found this format.
is this a lapse of memory?
Would it be possible to have a continuity in the availability of the
formats?
Thanks again.
Michel Claveau
Op 2005-03-29, Ville Vainio schreef <[EMAIL PROTECTED]>:
>> "Antoon" == Antoon Pardon <[EMAIL PROTECTED]> writes:
>
>Antoon> Op 2005-03-27, Joal Heagney schreef <[EMAIL PROTECTED]>:
> >> Antoon Pardon wrote:
> >>
> >>> So python choose a non-deterministic direction. To me (2,3)
Can anyone tell me how to get a message's number from the message-id
using IMAP4.search?
I've tried this:
resp, items = server.search(None, 'HEADER', '"Message-id"', msgID)
but it gives me a 'bogus search criteria' error
Any ideas?
--
http://mail.python.org/mailman/listinfo/python-list
> "Steven" == Steven Bethard <[EMAIL PROTECTED]> writes:
Steven> to be documented as a builtin type. I don't find the
Steven> argument "builtin type methods are hard to find"
Steven> convincing -- the solution here is to fix the
Steven> documentation, not refuse to add builtin
Hi !
Yes, P4RC2 is a error ; it is Python 2.4.1 release candidate 2
Yes, P2.4 is Python 2.4
The scripts use ONLY space-indentation.
But the important points are :
- if I install Python 2.4 on the rc2 (overwrite), then problem
disappears, with the SAME scripts.
- the problem is only wi
"Terry Reedy" <[EMAIL PROTECTED]> wrote:
>
>"Antoon Pardon" <[EMAIL PROTECTED]> wrote in message
>news:[EMAIL PROTECTED]
>> 1) The stuff doesn't has to be spread over multiple pages. One
>> can have 2 functions, each about three quarter of a page.
>> The second function will then cross a page
Terry Reedy wrote:
But if classmethods are intended to provide alternate constructors
But I do not remember that being given as a reason for classmethod(). But
I am not sure what was.
Well I haven't searched thoroughly, but I know one place that it's
referenced is in descrintro[1]:
"Factoid: __
You need 2 underscores to mangle.
On Tuesday 29 March 2005 09:58 pm, runsun pan wrote:
> >>> shy._Shy__mangled_method()
>
> Ive been mangled!
>
>
> Hi Brian,
>
> can you explain how this could possibly work? First of all it's not
> standard python usage,
> and secondly it's not working on my compu
Hi !
Good idea. I take this interpreter with jubilation.
Can I add your URL at http://mclaveau.com/esolang ?
Other question : do you know PATH ? (http://pathlang.sourceforge.net)
@-salutations
Michel Claveau
--
http://mail.python.org/mailman/listinfo/python-list
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Terry Reedy wrote:
>> "Steven Bethard" <[EMAIL PROTECTED]> wrote in message
>> news:[EMAIL PROTECTED]
>>
>>>True it's not a huge win. But I'd argue that for the same reasons that
>>>dict.fromkeys is a dict classmeth
I wrote:
> It can be quite useful for inserting something into a list (or
string),
> after finding the position where you wish to insert it.
Oops, I missed Dennis Lee Bieber's working example of exactly that.
My apologies.
Regars, Myles.
--
http://mail.python.org/mailman/listinfo/python-list
Javier Bezos wrote:
> "Jacob Lee" <[EMAIL PROTECTED]> escribió en el mensaje
> > satisfy some handy properties, the first of which being:
> > l[:n] + l[n:] = l
>
> I don't think l[:5] + l[5:] = l is a handy property
> and to me is clearly counterintuitive. Further,
It can be quite useful for ins
Mertz' "Text Processing in Python" book had a good discussion about
trapping 403 and 404's.
http://gnosis.cx/TPiP/
Larry Bates wrote:
> I noticed you hadn't gotten a reply. When I execute this it put's
the following
> in the retrieved file:
>
>
>
> 404 Not Found
>
> Not Found
> The requested
>>> shy._Shy__mangled_method()
Ive been mangled!
Hi Brian,
can you explain how this could possibly work? First of all it's not
standard python usage,
and secondly it's not working on my computer...
pan
--
http://mail.python.org/mailman/listinfo/python-list
Ron Garret wrote:
Why doesn't this work?
from weakref import ref
class C(str): pass
...
ref(C())
Traceback (most recent call last):
File "", line 1, in ?
TypeError: cannot create weak reference to 'C' object
Note that you don't need the class redirection:
py> ref('')
Traceback (most recent call
Hi
Does anyone have suggested code for a compact, efficient, elegant, most of
all pythonic routine to produce a list of all the proper divisors of an
integer (given a list of prime factors/powers)
--
http://mail.python.org/mailman/listinfo/python-list
Terry Reedy wrote:
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
True it's not a huge win. But I'd argue that for the same reasons that
dict.fromkeys is a dict classmethod, the itertools methods could be iter
classmethods (or staticmethods).
As near as I could te
onur2029 wrote:
>I need mod_python resources,documentation or ebook.But not manual
> from modpython.org.I'm waiting for your links.
http://www.catb.org/~esr/faqs/smart-questions.html
Tim Delaney
--
http://mail.python.org/mailman/listinfo/python-list
Hi everybody,
I need mod_python resources,documentation or ebook.But not manual
from modpython.org.I'm waiting for your links.
ONUR YILMAZ
--
http://mail.python.org/mailman/listinfo/python-list
This struck me also when I first saw this post. It reminded me of a
body of code I inherited at a former job, that I had to help untangle.
The code was filled with two key variables: t_1 and t_l. Printing out
the source in a Courier font made these two vars completely
indistinguishable, and it to
Well, despite my parenthetical disclaimer, my attempted point was that
the OP wanted to avoid replicating several functions that were mostly
the same. I think Python's idiom of using a function to create and
return callables is a comparable feature to using anonymous closures.
Unfortunately, I gue
James Stroud said unto the world upon 2005-03-29 20:37:
Sarir said:
Here are my questions:
3) Should private data be written as self._x instead of self.x?
This is a long standing debate. The usual answer is "we are all grownups
here", meaning that self.x is preferred. However, I personally like
Rakesh wrote:
> To quote a much smaller trimmed-down example, here is how it looks
> like:
> ## ---
> # Entry Point to the whole program
> ## ---
> def main():
> mylist = GenerateList()
> minnumber = min
Leif B. Kristensen wrote:
I've got a thirteen-year old daughter to whom I have recently taught the
HTML basics, but she doesn't readily take to actual programming. If
you've got any idea what I should push to her to get her fascinated
about _real_ programming, I'd be obliged.
If she's interested in
Duncan Booth wrote:
Joal Heagney wrote:
Nice. I still have to download a version of pygame to try this out, but
the fact that you can't hide the turtle in python.turtle was bugging me
out with my version. (A fair bit of copy/paste in gimp, I can tell you!)
What was wrong with hiding the turtle?
"Terry Reedy" <[EMAIL PROTECTED]> wrote:
>
> "Steven Bethard" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > True it's not a huge win. But I'd argue that for the same reasons that
> > dict.fromkeys is a dict classmethod, the itertools methods could be iter
> > classmethods (or s
All names have been removed to protect the guilty :-)
In an earlier post, I read a piece of code:
l1 = [1, 2, 3]
l2 = [1, 2, 3]
l1 == l2
True
I immediately gave a double-take: 11 equals 12? What
gives? Can you re-bind literals in Python???
>>> 11 = [1, 2, 3]
SyntaxError: can't assign to literal
A
Joal Heagney wrote:
Joal Heagney wrote:
Duncan Booth wrote:
Joal Heagney wrote:
Nice. I still have to download a version of pygame to try this out,
but the fact that you can't hide the turtle in python.turtle was
bugging me out with my version. (A fair bit of copy/paste in gimp, I
can tell you!
how should i modify this data reader:
(assumes that there is only one entry per line followed by '\n')
data_file = open(os.path.normpath(self.TextFile.GetValue()), 'r')
data = data_file.readlines()
self.irradianceStrings = map(str, data)
self.irradianceIntegers = map(int, data)
self.Irrad
Joal Heagney wrote:
Duncan Booth wrote:
Joal Heagney wrote:
Nice. I still have to download a version of pygame to try this out,
but the fact that you can't hide the turtle in python.turtle was
bugging me out with my version. (A fair bit of copy/paste in gimp, I
can tell you!)
What was wrong wi
Jot wrote:
If she's really gifted i hope she dumps that obsolete monolithic kernel
as soon as she realizes that such beautiful language as python shouldn't
be used on top of ugly, badly designed software.
Maybe she'll go on to write that oft-proposed pure Python
operating system, and give us a co
Steven Bethard wrote:
Michael Spencer wrote:
> While we're on the topic, what do you think of having unary,
> non-summary builtins automatically map themselves when called with an
> iterable that would otherwise be an illegal argument:
I personally don't much like the idea because I expect 'int'
Ron_Adam wrote:
On Mon, 28 Mar 2005 13:39:17 +0200, remi <[EMAIL PROTECTED]> wrote:
Hello,
I have got a list like : mylist = ['item 1', 'item 2','item n'] and
I would like to store the string 'item1' in a variable called s_1,
'item2' in s_2,...,'item i' in 's_i',... The lenght of mylist is fi
"Su Wei" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>i hvae seen some code like this before:
I really hope not...
>class BusinessBO :
dev __init__(slef):
#write you own code here
dev businessMethod :
#write you own code here
That is 'def', not 'dev'
>p
"could ildg" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> __new__() is intended mainly to allow subclasses of immutable types
> (like int, str, or tuple) to customize instance creation.
Exactly. It is an anwer to the conundrum: How do you give an immutable
object its unchangea
Am Mittwoch, 30. März 2005 04:36 schrieb Heiko Wundram:
> You could extend the above example quite easily to deal with deallocation
> (a reference to each created singleton is retained using the above class,
> always, as long as the program is running) and also to make it threadsafe
> or to disable
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I have several functions that are almost the same in one class I would
> like to use a closure to get rid of the extra code how would I do this?
A more specific example might get a more to the point solution ;-)
TJR
--
http://mail
"Tian" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>I want to create a object directory called Context in my program, which
> is based on a dict to save and retrieve values/objects by string-type
I suspect that you would accomplish your goal much more easily by calling
your modu
Am Mittwoch, 30. März 2005 03:27 schrieb could ildg:
> Thank you.
> I'm clear after I read the doc:
> If __new__() returns an instance of cls, then the new instance's
> __init__() method will be invoked like "__init__(self[, ...])", where
> self is the new instance and the remaining arguments are t
GujuBoy wrote:
i have the following code...which works fine in UNIX but then i move it
over to WINDOWS XP and check the sum on the same file that i tested on
unix and i get different results.
def checksum(fileobj):
filedata = array.array('B', fileobj.read())
Did you make sure you opened this "f
"HYUN-CHUL KIM" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I put more than 10,000 points in a box
> and then want to get one of many solutions that matches all
> angle restraints among any 3 points and all distance restraints
> between any 2 points.
It is not clear to me what
"Steven Bethard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> True it's not a huge win. But I'd argue that for the same reasons that
> dict.fromkeys is a dict classmethod, the itertools methods could be iter
> classmethods (or staticmethods).
As near as I could tell from the
Why doesn't this work?
>>> from weakref import ref
>>> class C(str): pass
...
>>> ref(C())
Traceback (most recent call last):
File "", line 1, in ?
TypeError: cannot create weak reference to 'C' object
>>>
Note that this does work:
>>> class D(int): pass
...
>>> ref(D())
>>>
Likewise for
[GujuBoy wrote]
> i have the following code...which works fine in UNIX but then i move it
> over to WINDOWS XP and check the sum on the same file that i tested on
> unix and i get different results.
>
> def checksum(fileobj):
> filedata = array.array('B', fileobj.read())
> totbytes = len(f
On Wed, 30 Mar 2005 09:38:28 +0800, Su Wei <[EMAIL PROTECTED]> wrote:
> hi,everybody,Sorry to bother you.
> why and when we should add the keyword "pass" ?
You can use the 'pass' keyword to indicate an empty block. For example,
if True:
pass
pass is usually used as a placeholder so that you
I am writing a setup.py for my package. I have a pre-compiled
myextmod.pyd file in my package and I want the distutils to
automatically copy it to
C:\Python23\Lib\site-packages\mypackage\myextmod.pyd.
I try to add the following parameter to setup():
data_file = [('mypackage', ['mypackage/myex
Patch / Bug Summary
___
Patches : 297 open (+11) / 2812 closed (+11) / 3109 total (+22)
Bugs: 871 open ( +1) / 4900 closed (+33) / 5771 total (+34)
RFE : 175 open ( +0) / 150 closed ( +0) / 325 total ( +0)
New / Reopened Patches
__
Decimal i
"Raymond Hettinger" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> [Julian Hernandez Gomez]
>> This is maybe a silly question, but...
>>
>> is there a "easy way" to make eval() convert all floating
>> numbers to Decimal objects and return a Decimal?
>
> from decimal import Decimal
i have the following code...which works fine in UNIX but then i move it
over to WINDOWS XP and check the sum on the same file that i tested on
unix and i get different results.
def checksum(fileobj):
filedata = array.array('B', fileobj.read())
totbytes = len(filedata)
result = 0
de
"Antoon Pardon" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> 1) The stuff doesn't has to be spread over multiple pages. One
> can have 2 functions, each about three quarter of a page.
> The second function will then cross a page boundary.
Once upon a time, one could put a li
Thanks for your help! I am already fix it!!
Many thanks!
--
http://mail.python.org/mailman/listinfo/python-list
On Tuesday 29 March 2005 05:37 pm, James Stroud wrote:
> > 1) What are the benefits of using a member variable without the 'self'
> > qualifier? (I think this is because you can use _x without an
> > instance of A().)
>
> No such thing as a benefit here. self.a inside a method is the same as
To quote a much smaller trimmed-down example, here is how it looks
like:
<-->
import sys
##
##
def GenerateList():
array = ' '
for i in xrange(10):
array = (array, i)
return array
## --
In my Python code fragment, I want to write a code fragment such that
the minimum element of a tuple is subtracted from all the elements of a
given
tuple.
When I execute the following python script I get the following
interpreter
error.
C:\>python test.py
200 ddf DNEWS Version 5.7b1,, S0, posti
hi,everybody,Sorry to bother you.
i hvae seen some code like this before:
class BusinessBO :
dev __init__(slef):
#write you own code here
dev businessMethod :
#write you own code here
pass
why and when we should add the keyword "pass" ?
and some time i have seen
class S
Sarir said:
> Here are my questions:
>
> 1) What are the benefits of using a member variable without the 'self'
>qualifier? (I think this is because you can use _x without an
>instance of A().)
No such thing as a benefit here. self.a inside a method is the same as a
outside (see code belo
I noticed you hadn't gotten a reply. When I execute this it put's the following
in the retrieved file:
404 Not Found
Not Found
The requested URL /pool/updates/main/p/perl/libparl5.6_5.6.1-8.9_i386.deb was no
t found on this server.
You will probably need to use something else to first determ
On 29 Mar 2005 13:23:55 -0800, "Tian" <[EMAIL PROTECTED]> wrote:
>In Windows, I have been simply using os.system() to run command line
>program in python. but there will be a black console window. How can I
>run the program without invoking that window? i guess there are some
>function with which
Thank you.
I'm clear after I read the doc:
If __new__() returns an instance of cls, then the new instance's
__init__() method will be invoked like "__init__(self[, ...])", where
self is the new instance and the remaining arguments are the same as
were passed to __new__().
If __new__() does not ret
In article <[EMAIL PROTECTED]>,
Trent Mick <[EMAIL PROTECTED]> wrote:
>> > I don't have my copy yet. Can you give any guidance on how the 2'nd
>> > edition compares to the 1'st edition?
>
>Here is an excerpt from the preface (typing errors are mine):
>
>If you already own the first edition, yo
In article <[EMAIL PROTECTED]>,
Ron_Adam <[EMAIL PROTECTED]> wrote:
>On Tue, 29 Mar 2005 09:09:37 -0500, Charles Hartman
><[EMAIL PROTECTED]> wrote:
>
>>I know the answer to this is going to be "It depends . . .", but I want
>>to get my mind right. In Fowler's *Refactoring* I read: "Older
>>lang
could ildg wrote:
As there is already __init__, why need a __new__?
What can __new__ give us while __init__ can't?
In what situations we should use __new__?
And in what situations we must use __new__?
Can __new__ take the place of __init__?
I believe the current documentation will be updated when 2
QOTW: "This is a Python newsgroup. Assume that we all have been
brainwashed." -- Peter Otten
"[M]y experience porting Java to Jython is that it mostly involves deleting
stuff :-)" -- Kent Johnson
"[K]eep in mind, however, that not all problems in life can be solved with
software." -- Roy Smith
In article <[EMAIL PROTECTED]>,
Dave Cook <[EMAIL PROTECTED]> wrote:
.
.
.
>wxPython seems to have the best cross-platform support among CPython
>toolkits, but it never seemed very Pythonic to me. There's a higher-level
>pack
In article <[EMAIL PROTECTED]>,
Paul McGuire <[EMAIL PROTECTED]> wrote:
>Well, I'm not sure "closure" is the Pythonic way. But in Python, you
>can use functions to dynamically create other functions. Here's an
>example of this feature (although there are far simpler ways to do
>this), tallying vo
In article <[EMAIL PROTECTED]>, D H <[EMAIL PROTECTED]> wrote:
.
.
.
>I would use the graphical language environment that comes with Lego
>Mindstorms. It was designed for kids.
>
>I haven't seen anyone show how to program mi
On Tue, 29 Mar 2005 11:29:33 -0700, Steven Bethard <[EMAIL PROTECTED]> wrote:
>infidel wrote:
>> You can use the new 'sorted' built-in function and custom "compare"
>> functions to return lists of players sorted according to any criteria:
>>
>>
>players = [
>>
>> ... {'name' : 'joe', 'defe
As there is already __init__, why need a __new__?
What can __new__ give us while __init__ can't?
In what situations we should use __new__?
And in what situations we must use __new__?
Can __new__ take the place of __init__?
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
I come from a C++ background and am learning some of the details of
Python's OO capability and now have some questions. Given:
#!/bin/env python
class A(object):
_x = 10
def __init__(self): self.x = 20
def square(self): return self.x * self.x
print 'A.x = %d' % A._x
a = A()
print 'a.x =
> I have a question re the use of Python to control a robot
> built with the LEGO Mindstorm system.
> This is to help my 11yr old with his increased interest in
> 'programming' and 'robotics'... If not feasible, he wants to
> use the graphical-tool that comes with it...
>
> Would you suggest:
>
On Tue, 29 Mar 2005 11:32:33 -0800, Michael Spencer <[EMAIL PROTECTED]> wrote:
[...]
>While we're on the topic, what do you think of having unary, non-summary
>builtins automatically map themselves when called with an iterable that would
>otherwise be an illegal argument:
That last "otherwise" is
noob warning:
what is so wonderful about the NEW class over the old ?
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Mar 29, 2005 at 12:38:42PM +0300, Ville Vainio wrote:
> > "Raymond" == Raymond Hettinger <[EMAIL PROTECTED]> writes:
>
> Raymond> If the experience works out, then all you're left with is
> Raymond> the trivial matter of convincing Guido that function
> Raymond> attributes
Steve Holden wrote:
> Where programming's concerned it's never too soon to start reading
other
> people's code, and fortunately there's a huge amount of Python about
and
> available as open source.
I found the Cookbook to be especially helpful for this initially:
digestable code chunks with plent
Or launch it with pythonw.exe ( on windows )
Sorcier glouton http://sorcier-glouton.ath.cx
"rbt" <[EMAIL PROTECTED]> a écrit dans le message de news:
[EMAIL PROTECTED]
> Tian wrote:
>> In Windows, I have been simply using os.system() to run command line
>> program in python. but there will be a
Michael Spencer wrote:
> While we're on the topic, what do you think of having unary,
> non-summary builtins automatically map themselves when called with an
> iterable that would otherwise be an illegal argument:
>
> e.g.,
> int(iterable) -> (int(i) for i in iterable)
> ord(iterable) -> (ord(i) fo
If you have three different implementations, and can read all three of
them well enough to understand the code, use all three.
If you are going to port software from one language to another, and
want to reimplement it properly in your target language, you won't be
porting word-for-word anyway. So
> What I or you prefer carries very little weight. I know layout-things
> stir up a lot of bad feeling, but I honostly think those people should
> grow up. When I cooperate in a project, I adapt my style to the one
> used in the project. I may use a tool to change between styles for
> things I work
Tian wrote:
In Windows, I have been simply using os.system() to run command line
program in python. but there will be a black console window. How can I
run the program without invoking that window? i guess there are some
function with which I can redirect the output?
name your scripts with .pyw ext
Venkat B wrote:
Hi all,
I have a question re the use of Python to control a robot built with the
LEGO Mindstorm system.
This is to help my 11yr old with his increased interest in 'programming' and
'robotics'... If not feasible, he wants to use the graphical-tool that comes
with it...
Would you sugg
In Windows, I have been simply using os.system() to run command line
program in python. but there will be a black console window. How can I
run the program without invoking that window? i guess there are some
function with which I can redirect the output?
--
http://mail.python.org/mailman/listinf
OPQ wrote:
> (2)- in a dict mapping a key to a list of int, remove every entrie
> where the list of int have of length < 2
>
>
> So far, my attempts are
> for (2):
> for k in hash.keys()[:]: # Note : Their may be a lot of keys here
>if len(hash[k])<2:
> del hash[k]
>
>
> Here again, I th
"Steven Bethard" <[EMAIL PROTECTED]> wrote:
>
> [snip]
>
> I guess the real questions are[1]:
> * How much does iter feel like a type?
> * How closely are the itertools functions associated with iter?
>
> STeVe
>
> [1] There's also the question of how much you believe in OO tenets like
> "functions
Hi all,
I have a question re the use of Python to control a robot built with the
LEGO Mindstorm system.
This is to help my 11yr old with his increased interest in 'programming' and
'robotics'... If not feasible, he wants to use the graphical-tool that comes
with it...
Would you suggest:
1. Using
Well, I'm not sure "closure" is the Pythonic way. But in Python, you
can use functions to dynamically create other functions. Here's an
example of this feature (although there are far simpler ways to do
this), tallying vowels and consonants in an input string by calling a
function looked up in a
On Tue, 29 Mar 2005 14:58:45 -0500, Bill Mill <[EMAIL PROTECTED]>
wrote:
>>
>> Or something else depending on how many references you made to the
>> value 8.
>
>Yes, this is true, assuming that he looks for keys with the value 8 in
>locals(). It's not necessarily true if there's a way to ask py
>I have a legacy system with data stored in binary files on a remote
>server.
>I need to access and modify the content of those files from a webserver
>running on a different host. (All Linux)
>
>I would like to install a server on the legacy host that would use my
>python
>code to translate bet
Instead of indexing self.lab by strings, you can index them by the
attributes themselves : self.lab[self.i], and change line 23 into
for var in (self.s, self,i)
For your example, I wouldn't have used the "text" option in the
definition of the labels, then "textvariable" in the callback meth
After some playing around, here is how my code looks like and it works:
from OpenGL.GL import *
from OpenGL.GLUT import *
import sys
def init():
glClearColor(0, 0, 0, 0)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glLightfv(GL_LIGHT0, GL_AMBIENT,
[0.0, 0.0, 0.0, 1.0])
glLightf
Hi,
I am starting to write this sample program in Python to use the GLUT
library.
<-->
from OpenGL.GL import *
from OpenGL.GLUT import *
def init():
glClearColor(0, 0, 0, 0)
glMatrixMode(GL_PROJECTION)
glLoadIdentity()
glLightfv(GL_LIGHT0, GL_AMBIENT,
[0.0, 0.0, 0.0, 1.0])
g
Fred,
Let me see if i understand, you want to 'serve' binary data as PYTHON
OBJECTS to a REMOTE client.
I am gonna show you how to fish ;)
Search strategy:
PYthon Remote Objects
Python remote
python objects
I tried them and found plenty of information and code.
hint:
PYthon Remote Objects
hth,
1 - 100 of 220 matches
Mail list logo