I found this site that has the code for readkey for Windows, Unix, and
in an updated version, Mac:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/134892 . The
Mac object returns a character whether or not a key was pressed. I
modified the Windows object to do the same when I downloaded i
I found this site that has code for readkey for Windows, Unix, and
in an updated version, Mac:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/134892 . The
Mac object returns a character whether or not a key was pressed. I
modified the Windows object to do the same when I downloaded it, b
I've posted this before, but not gotten an answer:
I found this site that has code that does readkey for Windows, Unix,
and in an updated version, Mac:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/134892
The Mac readkey class returns a character whether or not a key was
pressed. I modi
How can I get a number into scientific notation? I have a preference
for the format '1 E 50' (as an example), but if it's well known, it
works.
--
http://mail.python.org/mailman/listinfo/python-list
No, I mean given a big number, such as
1000, convert it into
scientific notation.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks for your help, Alex, Roy and Jorge. I'm new to Python, and
programming in general, which might explain my lack of knowledge,
Fredrick.
--
http://mail.python.org/mailman/listinfo/python-list
How do I make a fixed font width in Tkinter? Here's my code (there's
more, of course, but this is the focus of the question):
import tkFont
Font=tkFont.Font(root=master, family="Courier", size=14)
I'm sure it's possible, because it's done in IDLE.
--
http://mail.python.org/mailman/listinfo/pyth
Never mind, I got it to work.
--
http://mail.python.org/mailman/listinfo/python-list
I'm a newbie here, especially with Tkinter. I'm writing a program that
has 3 phases, if you will, in which I would have to clear the window
and insert new widgets. Is this possible, and if so, how? I'm writing
my application class based on Frame, if that helps at all.
--
http://mail.python.org/
I don't want to destroy the root, I just want to remove the widgets
(the exact opposite of what Martin was saying). I started working on
James' idea, but it'll be a while before I have it fully implemented to
test.
--
http://mail.python.org/mailman/listinfo/python-list
I'm trying to get a scrollbar bound with a Frame, and I keep on getting
a scrollbar, but it doesn't actually scroll. Some help, please?
--
http://mail.python.org/mailman/listinfo/python-list
BTW, experience tells me it is necessary for me to explicitly state
that I'm a newbie (otherwise I get rude people saying I should already
know such-and-such).
--
http://mail.python.org/mailman/listinfo/python-list
Parent.critique() is calling self.critique(), which has been overriden
by Child.critique() instead of Parent.critique. It makes perfect sense
to me.
--
http://mail.python.org/mailman/listinfo/python-list
Oh, I see what you mean. From my experience, the methods are passed
down, not referred to from the parent. That is, Parent does have its
own critique method, not a reference to Grand_parent.critique(). So
when Child calls self.advise, it is calling its inherrited copy. Then,
since the inherited Chi
> it calls it's own overriden critique method
(overriden meaning the one that did the overriding)
--
http://mail.python.org/mailman/listinfo/python-list
Martin Franklin wrote:
> Dustan wrote:
> > I'm trying to get a scrollbar bound with a Frame, and I keep on getting
> > a scrollbar, but it doesn't actually scroll. Some help, please?
> >
>
> It can be tricky getting an empty frame to scroll, can you post yo
Label Widget, sorry
--
http://mail.python.org/mailman/listinfo/python-list
Yes, I know PMW has scrolled Text, but the module has to be installed
seperately; this is something I'm releasing to a number of people.
I'll try doing it with a canvas.
--
http://mail.python.org/mailman/listinfo/python-list
How do I make a help dialogue, like the one seen in IDLE when you go to
Help-IDLE Help?
--
http://mail.python.org/mailman/listinfo/python-list
How do I limit what the user can enter in an Entry Widget? I know I can
set it to display '*' to hide a password, but what I want to do is
limit the contents to numeric characters. What is the easiest way of
doing this?
--
http://mail.python.org/mailman/listinfo/python-list
Boris Borcic wrote:
> does
>
> x.sort(cmp = lambda x,y : cmp(random.random(),0.5))
>
> pick a random shuffle of x with uniform distribution ?
>
> Intuitively, assuming list.sort() does a minimal number of comparisons to
> achieve the sort, I'd say the answer is yes. But I don't feel quite
> confo
Does anybody know anything about Grail? I've been unable to get at
it, and I've tried on both Windows and Macintosh machines.
http://grail.sourceforge.net/
--
http://mail.python.org/mailman/listinfo/python-list
SuperHik wrote:
> Dustan wrote:
> > Does anybody know anything about Grail? I've been unable to get at
> > it, and I've tried on both Windows and Macintosh machines.
> >
> > http://grail.sourceforge.net/
> >
>
> http://prdownloads.sourceforge.n
Martin v. Löwis wrote:
> Dustan wrote:
> > Does anybody know anything about Grail? I've been unable to get at
> > it, and I've tried on both Windows and Macintosh machines.
> >
> > http://grail.sourceforge.net/
>
> The files just don't exist
Dennis Lee Bieber wrote:
> > for i in range(0,len(param)):
> > print a[i],
>
> for it in param:
> print it,
That's one way. However, if you need the position (this is for future
reference; you don't need the position number here):
for i in range(len(param)+1):
prin
> Thanks for the replies:
>
> I'm sorry, the colon is there in the original, I accidentally blew it
> off when I added the comment. The only information I get from IDLE is a
> dialog box that says:
>
> Syntax Error
> There's an error in your program:
> expected an indented block
>
> Keith
To see t
I don't know if this is because of Tkinter (ie Tk) itself or the
Windows default way of handling things, but when I create a very long
menu (my test is shown below), the way it displays is rather sucky; the
menu stretches from the top of the moniter's window to the bottom (no
matter the size of the
Eric Brunel wrote:
> On Thu, 05 Oct 2006 02:33:54 +0200, Dustan <[EMAIL PROTECTED]> wrote:
>
> > I don't know if this is because of Tkinter (ie Tk) itself or the
> > Windows default way of handling things, but when I create a very long
> > menu (my test is s
Steve Holden wrote:
> Dustan wrote:
> > I'm hiding some of the details here, because I don't want to say what
> > I'm actually doing.
> > [...]
>
> I have the answer to your problem but I don't actually want to tell you
> what it is.
That's
Neil Cerutti wrote:
> On 2006-10-05, Dustan <[EMAIL PROTECTED]> wrote:
> >
> > Steve Holden wrote:
> >> Dustan wrote:
> >> > I'm hiding some of the details here, because I don't want to
> >> > say what I'm actually doing.
Is there any builtin function or module with a function similar to my
made-up, not-written deformat function as follows? I can't imagine it
would be too easy to write, but possible...
>>> template = 'I am %s, and he %s last %s.'
>>> values = ('coding', "coded', 'week')
>>> formatted = template % v
Peter Otten wrote:
> Dustan wrote:
>
> > Is there any builtin function or module with a function similar to my
> > made-up, not-written deformat function as follows? I can't imagine it
> > would be too easy to write, but possible...
> >
> >&
Tim Chase wrote:
> > My template outside of the '%s' characters contains only commas and
> > spaces, and within, neither commas nor spaces. Given that information,
> > is there any reason it might not work properly?
>
> Given this new (key) information along with the assumption that
> you're doing
Dustan wrote:
> Tim Chase wrote:
> > > My template outside of the '%s' characters contains only commas and
> > > spaces, and within, neither commas nor spaces. Given that information,
> > > is there any reason it might not work properly?
> >
>
Dustan wrote:
> Dustan wrote:
> > Tim Chase wrote:
> > > > My template outside of the '%s' characters contains only commas and
> > > > spaces, and within, neither commas nor spaces. Given that information,
> > > > is there any reason it m
> Only you know what anomalies will be found in your data-sets. If
> you know/assert that
>
> -the only stuff in the formatting string is one set of characters
>
> -that stuff in the replacement-values can never include any of
> your format-string characters
>
> -that you're not using funky chara
Looking at this interactive session:
>>> class A(object):
def __init__(self, a):
self.a = a
def get_a(self): return self.__a
def set_a(self, new_a): self.__a = new_a
a = property(get_a, set_a)
>>> class B(A):
b = property(get_a, set_a)
Tr
Dustan wrote:
> Looking at this interactive session:
>
> >>> class A(object):
> def __init__(self, a):
> self.a = a
> def get_a(self): return self.__a
> def set_a(self, new_a): self.__a = new_a
> a = property(get_a, set_a
Robert Kern wrote:
> Dustan wrote:
> > Looking at this interactive session:
> >
> >>>> class A(object):
> > def __init__(self, a):
> > self.a = a
> > def get_a(self): return self.__a
> > def set_a(self, new_
Can I make enumerate(myObject) act differently?
class A(object):
def __getitem__(self, item):
if item > 0:
return self.sequence[item-1]
elif item < 0:
return self.sequence[item]
elif item == 0:
Paul Rubin wrote:
> "Dustan" <[EMAIL PROTECTED]> writes:
> > Can I make enumerate(myObject) act differently?
>
> No.
>
> > Why the funny behavior, you ask? For my class A, it doesn't make sense
> > to number everything the standard programming
Simon Forman wrote:
> Dustan wrote:
> > Can I make enumerate(myObject) act differently?
> >
> > class A(object):
> > def __getitem__(self, item):
> > if item > 0:
> > return self.sequence[item-1]
> >
Fredrik Lundh wrote:
> "Dustan" wrote:
>
> > Except that my program is supposed to be treated as a module with tools
> > to do certain things. I certainly can't control whether a 3rd party
> > programmer uses "import myModule" or "from myM
Back in this post, I attempted to make a label look like a button:
http://groups.google.com/group/comp.lang.python/browse_thread/thread/a83195d3970a6851/2053cbaec1bc1f19?auth=DQAAAHkMDAWnhNnzpuKlwOKZUwAGUTtT2Ay-EAB7rCY6SnwfnDzZ98M37bZDW2Is0LrBVrr8XEgPfcuOkiUE-CrSsKbBSX-67voDUXfbATBd0eYNMClezby4
Dustan wrote:
> Back in this post, I attempted to make a label look like a button:
> http://groups.google.com/group/comp.lang.python/browse_thread/thread/a83195d3970a6851/2053cbaec1bc1f19?auth=DQAAAHkMDAWnhNnzpuKlwOKZUwAGUTtT2Ay-EAB7rCY6SnwfnDzZ98M37bZDW2Is0LrBVrr8XEgPfcuOkiUE-CrS
According to the following page on Wikipedia:
http://en.wikipedia.org/wiki/Python_%28programming_language%29#Future_development
reduce is going to be removed in python 3.0. It talks of an
accumulation loop; I have no idea what that's supposed to mean. So,
===
>>> x =\
[
Fredrik Lundh wrote:
> Dustan wrote:
>
> > What's an accumulation loop, and how would I convert this code so it's
> > compatible with the future 3.0
>
> the release of Python 3.0 is far away, and nobody knows how it's going
> to look. trying to be futur
Fredrik Lundh wrote:
> Dustan wrote:
>
> > It's always nice to know there are such good-natured people ready to
> > help on this group.
>
> any special reason why you keep pretending that some random wikipedia
> editor knows more about a future Python release
Fredrik Lundh wrote:
> Dustan wrote:
>
> > Because I'm embedding this expression in a list comprehension
>
> because?
>
>
Because I thought I would be able to get an answer without revealing
the exact details of what I am doing. I didn't realize that wasn&
Fredrik Lundh wrote:
> Dustan wrote:
>
> >> > Because I'm embedding this expression in a list comprehension
> >>
> >> because?
> >
> > Because I thought I would be able to get an answer without revealing
> > the exact details of what
Robert Kern wrote:
> Dustan wrote:
> > Fredrik Lundh wrote:
>
> >> if you care about writing robust code, why not just use a for-loop,
> >> and the list extend method?
> >
> > Because I'm embedding this expression in a list comprehension (as I
&
Fredrik Lundh wrote:
> Dustan wrote:
>
> >>>> foo =\
> > [[[1,2,3],[4,5,6],[7,8,9]],
> > [[3,2,1],[6,5,4],[9,8,7]]]
> >
> > Here, foo appears to be a 3-dimensional list - except it's supposed to
> > be 2-dimensional. The inner-list-of-list
Alright, I can see I'm a bit outvoted here. I tried your suggestions
and it worked fine.
I'll also try to consider in the future that part of the problem might
be lack of information conveyed on my part.
--
http://mail.python.org/mailman/listinfo/python-list
George Sakkis wrote:
> Dustan wrote:
>
> > Alright, I can see I'm a bit outvoted here. I tried your suggestions
> > and it worked fine.
> >
> > I'll also try to consider in the future that part of the problem might
> > be lack of information convey
The title pretty much says it all. What is the easiest way in Tkinter
to display an image from the internet given the URL?
--
http://mail.python.org/mailman/listinfo/python-list
Nobody answered last time. I guess they wanted me to give it a shot.
Well, here is how I download the image (it's a class method):
def download_image(self):
web_download=self.opener.open(self.url)
save=open("image.jpg","w")
save.writelines(web_download.readlines())
I wrote:
> Nobody answered last time. I guess they wanted me to give it a shot.
> Well, here is how I download the image (it's a class method):
>
> def download_image(self):
> web_download=self.opener.open(self.url)
> save=open("image.jpg","w")
> save.writelines(web_down
Justin Ezequiel wrote:
> cannot help you with Tkinter but...
>
> save=open("image.jpg","wb")
> save.write(web_download.read())
> save.close()
>
> perhaps this would let you open the file in Paint
Ok, that worked (was it plain w or the writelines/readlines that messed
it up?
Fredrik Lundh wrote:
> Dustan wrote:
>
> > Ok, that worked (was it plain w or the writelines/readlines that messed
> > it up?).
>
> the plain "w"; very few image files are text files.
>
> > But Tkinter still can't find the image. I'm get
abcd wrote:
> If I have code which imports a module over and over again...say each
> time a function is called, does that cause Python to actually re-import
> it...or will it skip it once the module has been imported??
>
> for example:
>
> def foo():
> import bar
> bar.printStuff()
>
> foo
I have a Button object that gets replaced by a Label when clicked.
Button(buttonsframe,text=' ',command=c,font=buttonsFont)
Note that the text is a single space. buttonsFont uses 'Courier New' as
a family.
When clicked, the Button is destroyed and replaced with a Label object:
Label(buttonsframe,
Cameron Laird wrote:
> In article <[EMAIL PROTECTED]>,
> Grayson, John <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> >Buttons can look like labels without the need to create another object -
> >just remove the
> >Command binding, set state to DISABLED and disabledforeground='same
> >color as NORMAL'...
Jay wrote:
> Thanks for the tip, but that breaks things later for what I'm doing.
>
> [EMAIL PROTECTED] wrote:
> > In that case you don't need a lambda:
> >
> > import Tkinter as tk
> >
> > class Test:
> > def __init__(self, parent):
> > buttons = [tk.Button(parent, text=str(x+1),
> >
James Stroud wrote:
> Dustan wrote:
> > Jay wrote:
> >
> >>Thanks for the tip, but that breaks things later for what I'm doing.
> >>
> >>[EMAIL PROTECTED] wrote:
> >>
> >>>In that case you don't need a lambda:
> >
Matthew Wilson wrote:
> I understand that idea of an object's __repr__ method is to return a
> string representation that can then be eval()'d back to life, but it
> seems to me that it doesn't always work.
>
> For example it doesn't work for instances of the object class:
>
> In [478]: eval(repr(
At http://docs.python.org/whatsnew/modules.html on the webbrowser
module, it says "A number of additional browsers were added to the
supported list such as Firefox, Opera, Konqueror, and elinks."
I just installed python 2.5, looking forward to being able to control
firefox without having to make i
MonkeeSage wrote:
> Dustan wrote:
> > I did do a search here, but came up empty-handed. Can anyone tell me
> > how to get the webbrowser module to recognize firefox's existence,
> > given this information?
>
> Looks like it is checking %PATH% for fir
MonkeeSage wrote:
> Dustan wrote:
> > >>> cont=webbrowser._browsers['firefox'][1]
>
> Why not use the api? cont=webbrowser.get('firefox')
That didn't work either.
> > ValueError: close_fds is not supported on Windows platforms
>
MonkeeSage wrote:
> Dustan wrote:
> > That didn't work either.
>
> Well, I'm out of ideas. It's also odd that it was being read as
> webbrowser.BackgroundBrowser...whatever that is! It should have been
> webbrowser.Mozilla.
Thanks anyway; you have helpe
>
> This is a bug, and has now been fixed in SVN. As a workaround, you can
> edit the webbrowser.py file and remove the close_fds and preexec_fn arguments
> to Popen.
>
> Georg
Finally! It's working. Thank you so much!
--
http://mail.python.org/mailman/listinfo/python-list
walterbyrd wrote:
> >
> > Well I do. So do the other dozen or so developers at my company. We're
> > looking
> > to hire a few more, in fact.
> >
>
> I'm surprised. It seems I never see listings for python developers.
>
> I didn't mean any disrespect. I think python is a great language. It
> just
I'm hiding some of the details here, because I don't want to say what
I'm actually doing.
I have a special-purpose class with a __cmp__ method all set up and
ready to go for sorting. Then I have a special class that is based on
the builtin type list (though I didn't actually inherit list; I
probab
Diez B. Roggisch wrote:
> Dustan schrieb:
> > I'm hiding some of the details here, because I don't want to say what
> > I'm actually doing.
>
> > I have a special-purpose class with a __cmp__ method all set up and
> > ready to go for sorting. Then I
Ola K wrote:
> Hi,
> I am pretty new to Python and I want to make a script that will search
> for the following options:
> 1) words made of uppercase characters -only- (like "YES")
> 2) words made of lowercase character -only- (like "yes")
> 3) and words with only the first letter capitalized (lik
Dustan wrote:
> Ola K wrote:
> > Hi,
> > I am pretty new to Python and I want to make a script that will search
> > for the following options:
> > 1) words made of uppercase characters -only- (like "YES")
> > 2) words made of lowercase character -only-
Steven D'Aprano wrote:
> On Sat, 25 Nov 2006 13:39:55 -0800, Ola K wrote:
>
> > Hi,
> > I am pretty new to Python and I want to make a script that will search
> > for the following options:
> > 1) words made of uppercase characters -only- (like "YES")
> > 2) words made of lowercase character -only
Eduardo "EdCrypt" O. Padoan wrote:
> >
> > One might prefer to check for string-ness, as strings can
> > duck-type somewhat like lists:
> >
> > my_list = ['my', 'brain', 'hurts']
> > my_string = 'Are you the brain specialist?'
> >
> > for test in [my_list, my_string]:
> > try:
> > fo
Marco Aschwanden wrote:
> > do you find the x[i] syntax for calling the getitem/setitem methods a
> > bit awkward too? what about HTTP's use of "GET" and "POST" for most
> > about everything ? ;-)
>
> No. I like the x[i] syntax. I use it in every second row of my code and
> getting an item like:
[EMAIL PROTECTED] wrote:
> I'm using python.exe to execute my modules. I have a music.py module
> which contains my classes and a main.py module which uses these
> classes. In python.exe, I call "import main" to execute my program. The
> problem is that I have to close python and reopen it everytim
Dustan wrote:
> [EMAIL PROTECTED] wrote:
> > I'm using python.exe to execute my modules. I have a music.py module
> > which contains my classes and a main.py module which uses these
> > classes. In python.exe, I call "import main" to execute my program. The
WaterWalk wrote:
> Hello, I was recently learning python decorator and descriptor and
> emulated a @classmethod decorator:
> class EmuClassMethod(object):
> def __init__(self, f=None):
> self.f = f
> def __get__(self, obj, klass=None):
> if klass is None:
>klass
meridian wrote:
> If, like me, you're always forgetting which way around your list/seq
> slices need to go then worry no more. Just put my handy "slice
> lookupper" (TM) ) on a (large!) PostIt beside your screen and, Hey
> Presto! no more tediously typing a 1-9 seq into your interpreter and
> then
johnny wrote:
> Thank you Dennis,
> So when line 2, gets executed, its exception goes to do_some1_error.
> And when line 3, gets executed, its exception goes to do_some2_error
> and so on.
>
> line 1: try
> line 2:do_some1
> line 3:do_some2
> line 4:do_some3
> line 5: except do_some1_
Dustan wrote:
> johnny wrote:
> > Documentation is not written for newbs, it's written by guys with 6yrs
> > of experience FOR guys with 6yrs of experience.
>
> You might want to get a book on python, rather than depend on the
> documentation, which is, as you say,
Dennis Lee Bieber wrote:
> On 13 Dec 2006 03:52:49 -0800, "Dustan" <[EMAIL PROTECTED]>
> declaimed the following in gmane.comp.python.general:
>
> >
> > I didn't complete my thought. If you run into a situation like this,
> > then you might want to
vertigo wrote:
> Hello
>
> I receive such error:
> File "p4.py", line 24, in PrintWordCountFloat
> print "%s %f" % (word,words[word])
> TypeError: list indices must be integers
>
> i call PrintWordCountFloat with hash table, keys are words(string) and
> values float.
> This part of the code:
Kleine Aap wrote:
> Asper Faner wrote:
>
> > I seem to always have hard time understaing how this regular expression
> > works, especially how on earth do people bring it up as part of
> > computer programming language. Natural language processing seems not
> > enough to explain by the way. Why no
[EMAIL PROTECTED] wrote:
> Rad [Visual C# MVP] wrote:
> > On Sun, 24 Dec 2006 16:36:31 +0100, Stef Mientki wrote:
> >
> > > Dustan wrote:
> > >> Kleine Aap wrote:
> > >>> Asper Faner wrote:
> > >>>
> > >>>> I
WaterWalk wrote:
> Ben Sizer wrote:
> > I've installed several different versions of Python across several
> > different versions of MS Windows, and not a single time was the Python
> > directory or the Scripts subdirectory added to the PATH environment
> > variable. Every time, I've had to go thr
Mark Elston wrote:
> * Gabriel Genellina wrote (on 1/5/2007 12:49 PM):
> > At Friday 5/1/2007 17:39, [EMAIL PROTECTED] wrote:
> >
> >> wordfreq = [wordlist.count(p) for p in wordlist]
> >>
> >> I would expect
> >>
> >> for p in wordlist:
> >> wordfreq.append(wordlist.count(p))
> >>
> >>
> >> I
Earlier I asked about limitting what a user can enter in an Entry. I
got a few greatly appreciated replies, but I was hoping it would be
possible to take a more direct approach, that is, is there a method I
can override, when creating a class that inherits the Entry methods,
that is called whenever
Is it possible to get the system date on a Windows XP machine? Most
Convenient would to retrieve , MM, and DD as seperate variables.
When I say system date, I'm thinking of the small clock in the
lower-right hand corner, which has date as well as time, but if there's
another clock that Python
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 1, 9:33 pm, [EMAIL PROTECTED] wrote:
> 1. Do you like Python?
yes
> 2. Do you think Python is good?
yes
> 3. Do you think Python is real good?
yes
> 4. What is your favorite version of Python?
The most recent one.
> 5. Because of Python, do you think it will be easier to take over th
On Jun 6, 6:40 am, "Jorgen Bodde" <[EMAIL PROTECTED]> wrote:
> Hi Diez,
>
> Thanks, I thought it worked similar to C++ where a higher compound
> could access a lower section.
It can 'access a lower section'; what it can't do is *change* that
'lower section'; in your example case with an int, this
On Jun 6, 6:47 am, Tommy Nordgren <[EMAIL PROTECTED]> wrote:
> On 6 jun 2007, at 13.10, James Stroud wrote:
>
>
>
> > Hello All,
>
> > I'm using numpy to calculate determinants of matrices that look like
> > this (13x13):
>
> > [[ 0. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1. 1.]
> > [ 1.
On Jun 7, 6:06 am, simon kagwe <[EMAIL PROTECTED]> wrote:
> > exec("distances = [[1,1,1,1],[2,2,2,2]]")
To be clear, exec is *not* a function; it's a statement. That means it
can't be used in lambda functions, for example.
> Wow! So simple!
but dodgy, as it'll execute any python code.
> Thanks
On Jun 7, 10:56 am, David Bear <[EMAIL PROTECTED]> wrote:
> I would like to write some code that would randomly select a function from a
> list of functions and call it. I was looking in the globals names space and
> randomly selecting items that were of type function..
Careful!!! You don't want t
On Jun 7, 1:30 pm, Neil Cerutti <[EMAIL PROTECTED]> wrote:
> On 2007-06-07, Stebanoid <[EMAIL PROTECTED]> wrote:
>
> > if you have a list of functions you can try this:
>
> > import random
> > import math
> > m[int(math.floor(len(m)*random.random()))]() # seems like Lisp
>
> Or rather m[random.ran
On Jun 13, 5:37 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> In <[EMAIL PROTECTED]>, Diez B. Roggisch wrote:
>
> > No need to create the intermediate list, a generator expression works just
> > fine:
>
> > a = tuple(i for i in range(10))
>
> But `range()` creates the intermediate list
1 - 100 of 243 matches
Mail list logo