= 60
discounted_price = (1-discount) * price_per_book
shipping = 3.0 + (60 - 1) * .75
total_price = 60 * discounted_price + shipping
print total_price, 'Total price'
Scott
On Jan 31, 2014, at 8:02 PM, Denis McMahon wrote:
> On Thu, 30 Jan 2014 21:12:19 -0800, scottwd80 wrote:
>
>>
Yeah you’re right I didn’t even notice that. For some reason I just added the
60 instead of using quantity which had been defined.
On Feb 1, 2014, at 8:50 AM, Dennis Lee Bieber wrote:
> On Fri, 31 Jan 2014 22:18:34 -0700, Scott W Dunning
> declaimed the following:
>
>>
: 11
how can I get it to print with no spaces?
3:11
I’m VERY new to python and coding in general and this is a question for a class
I’m in for a test review. So, the most basic answer would be appreciated.
Thanks for any help!!
Scott
--
https://mail.python.org/mailman/listinfo/python
at 12:22 PM, Scott W Dunning wrote:
>> Assume variables exist for minutes and seconds. Each variable is an integer.
>> How would you create a string in the format,
>>
>> 3:11
>>
>> with no spaces. where 3 is minutes and 11 is seconds.
>>
>>
what exactly is the “%d:%02d”% saying?
On Feb 6, 2014, at 6:25 PM, Roy Smith wrote:
> In article ,
> Scott W Dunning wrote:
>
>> I am having trouble figuring out how to remove spacesŠ.
>>
>> Assume variables exist for minutes and seconds. Each variable is an
. Also, not really clear on the reasoning
behind changing the int to a string?
On Feb 6, 2014, at 9:45 PM, Chris Angelico wrote:
> On Fri, Feb 7, 2014 at 3:09 PM, Scott W Dunning wrote:
>> Is this what you’re talking about?
>>
>> minutes = “3”
>> seconds = “1
>
> A few things that will make your communications more fruitful:
>
> * Please don't top-post. Trim the quoted material to the parts relevant
> for your response, and respond inline like a normal discussion.
Oh, ok sorry about that. Like this?
>
> * Ensure that your message composer does
I have a question that was a part of my homework and I got it correct but the
teacher urged me to do it using the % sign rather than subtracting everything,
for some reason I’m having issues getting it to calculate correctly. I’ll put
the question below, and what I originally had and below that
On Feb 7, 2014, at 10:10 PM, Chris Angelico wrote:
> It might be easiest to think in terms of a single "divide into
> quotient and remainder" operation. Let's leave aside
> weeks/days/hours/minutes/seconds and split a number up into its
> digits. (This is actually not as useless as you might thi
On Feb 7, 2014, at 10:10 PM, Chris Angelico wrote:
>
> You should be able to get this to the point of writing out five
> separate values, which are the original five digits. Each one is worth
> 10 of the previous value. At every step, do both halves of the
> division.
What do you mean by at ea
>
> On Feb 7, 2014, at 10:10 PM, Chris Angelico wrote:
>>
>> number = int(raw_input("Enter a five-digit number: "))
>>
>> Now we begin to split it up:
>>
>> foo = number % 10
>> bar = number / 10
>>
Ok, so it this what you’re talking about?
number = int(raw_input(“Enter a five digit number:
s has never yet
> happened. But for this, we're working in a system that has seconds
> going from 00 to 59
I honestly do not know what leap seconds are but I’ll take your word for it.
lol
Thanks again!!!
Scott
--
https://mail.python.org/mailman/listinfo/python-list
#x27;,
seconds, 'seconds'
Not sure if that’s the correct way to do it but it works! If there is any
other advice I’ll take it.
On Feb 7, 2014, at 11:29 PM, Chris Angelico wrote:
> On Sat, Feb 8, 2014 at 5:27 PM, Scott W Dunning wrote:
>> Ok, so it this what you’re
On Feb 7, 2014, at 11:29 PM, Chris Angelico wrote
> Close! But if you print out foo and bar, you'll see that you're naming
> them backwards in the second one. The last digit is the remainder
> (modulo), the rest is the quotient.
So, this is more like what you’re talking about?
>>> first = numbe
On Feb 8, 2014, at 6:46 PM, Chris Angelico wrote:
> No, I'm not a teacher by profession, but I was homeschooled, and since
> I'm the second of seven children [1], I got used to teaching things to
> my siblings. Also, every week I run a Dungeons and Dragons campaign
> online, which requires simila
On Feb 8, 2014, at 6:46 PM, Chris Angelico wrote:
> That's certainly effective. It's going to give you the right result. I
> would be inclined to start from the small end and strip off the
> seconds first, then the minutes, etc, because then you're working with
> smaller divisors (60, 60, 24, 7 i
On Feb 8, 2014, at 11:30 PM, Chris Angelico wrote:
I have one more question on this if you don’t mind. I’m a bit confused on how
it works this way without it being in seconds? I’ll answer below each step of
how it seems to work to me.
> How to do it from the small end up:
>
> time = int(ra
e /= 7
> weeks = time
I guess I answered my own question and it looks like it wouldn’t matter if you
did it opposite from weeks to seconds.
Thanks again for all your help everyone!
Scott
--
https://mail.python.org/mailman/listinfo/python-list
I just have a simple question. I don’t understand why 1%10 = 1?
--
https://mail.python.org/mailman/listinfo/python-list
On Feb 11, 2014, at 6:51 PM, Christopher Welborn wrote:
> I think because 1 is evenly divisible by 10 exactly 0 times with a 1
> remainder. I mean int(1 / 10) == 0, with a 1 remainder.
> The same is true for all numbers leading up to 10.
>
Actually I think I get it now. I think I was not really
On Feb 11, 2014, at 6:36 PM, Chris Angelico wrote:
>
> The real question is: What do you expect that symbol to mean?
>
> Its actual meaning is quite simple. In long division, dividing one
> number by another looks like this:
Yeah I understand what the % means. It just confused me that 1%10 was
On Feb 20, 2014, at 9:41 PM, Scott W Dunning wrote:
> Hello,
>
> I am trying to make a function that allows me to color in a star that was
> drawn in Turtle. I just keep having trouble no matter what I do. I’ll post
> the code I have for the star (just in case). The ulti
this piece by piece in class.
So, I need to create a function that will color in the star that I can call
multiple times for each star. Any help is greatly appreciated!
Scott
from turtle import *
from math import sin, sqrt, radians
showturtle()
def star(width):
R = (width)/2*sin(radians(72
to fill it in with red. So I’m
obviously messing up somewhere.
def fillcolor(red):
pencolor()
begin_fill()
star(500)
end_fill()
red = pencolor
fillcolor(red)
Scott
--
https://mail.python.org/mailman/listinfo/python-list
On Feb 21, 2014, at 7:13 PM, Dave Angel wrote:
> Scott W Dunning Wrote in message:
>>
>> On Feb 20, 2014, at 11:30 PM, Dave Angel wrote:
>>
>>> Look at turtle.begin_fill and turtle.end_fill
>>>
>>> That's after making sure your star is a
On Feb 21, 2014, at 9:30 PM, Dave Angel wrote:
You’re awesome David! Thanks for taking the time to not only help answer my
question but helping me to understand it as well!!
Scott
--
https://mail.python.org/mailman/listinfo/python-list
Hello,
I had a question regarding functions. Is there a way to call a function
multiple times without recalling it over and over. Meaning is there a way I
can call a function and then add *5 or something like that?
Thanks for any help!
Scott
--
https://mail.python.org/mailman/listinfo
On Feb 23, 2014, at 1:44 AM, Steven D'Aprano
wrote:
>
> Sorry, I don't really understand your question. Could you show an example
> of what you are doing?
>
> Do you mean "add 5" or "*5"? "Add *5 doesn't really mean anything to me.
Sorry I forgot to add the code that I had to give an example
On Feb 23, 2014, at 12:59 AM, Ben Finney wrote:
>
> You should ask question like this on the “python-tutor” forum.
Thanks Ben, I wasn’t aware of PythonTutor.
--
https://mail.python.org/mailman/listinfo/python-list
I understood what you meant because I looked up loops in the python
documentation since we haven’t got there yet in school.
On Feb 23, 2014, at 6:39 PM, alex23 wrote:
> On 24/02/2014 11:09 AM, Mark Lawrence wrote:
>> On 24/02/2014 00:55, alex23 wrote:
>>>
>>> for _ in range(5):
>>> f
Hello, i am working on a project for learning python and I’m stuck. The
directions are confusing me. Please keep in mind I’m very ne to this. The
directions are long so I’ll just add the paragraphs I’m confused about and my
code if someone could help me out I’d greatly appreciate it! Also, w
On Mar 1, 2014, at 11:03 AM, Susan Aldridge wrote:
> Try this
>
> def guess1(upLimit = 100):
>import random
>num = random.randint(1,upLimit)
>count = 0
>gotIt = False
>while (not gotIt):
>print('Guess a number between 1 and', upLimit, ':')
>guess= int(input())
On Mar 1, 2014, at 9:35 AM, Dennis Lee Bieber wrote:
> Without loops, one part of your assignment is going to be tedious,
> unless the intent is to only allow for one guess per run.
No, 10 guesses per game. Yes very tedious and repetative.
>
>> from random import randrange
>> randrange(1,
I get past this first par I’ll be good to go. Hopefully!
Scott
--
https://mail.python.org/mailman/listinfo/python-list
ion. So it's correspondingly more useful to
> learn Py3.)
>
> ChrisA
I completely agree. However, the instructor is wanting to use Python 2.7.6
because the book he is using for the course goes over 2.7.6. Hopefully, once I
learn more it will not be a huge jump to python 3.
Scott
--
https://mail.python.org/mailman/listinfo/python-list
On Mar 2, 2014, at 6:40 PM, Scott W Dunning wrote:
This is what Im having trouble with now. Here are the directions I’m stuck on
and what I have so far, I’ll bold the part that’s dealing with the instructions
if anyone could help me figure out where I’m going wrong.
Thanks!
from random
On Mar 2, 2014, at 8:52 PM, Ben Finney wrote:
>
> Once again, Scott, this discussion should be happening at the Tutor
> forum. Please don't continue the fragmentation of this discussion; keep
> the discusson over at the Tutor forum.
Sorry, I was just replying to replies to my
//code.google.com/p/pynguin/wiki/StartProgramming
>
Awesome! Looks fun, I’ll definitely check it out and let you know!!
Scott
--
https://mail.python.org/mailman/listinfo/python-list
n help you. I suspect that "position" is more
like a Unicode data point than the position within the string you
are feeding.
Show us the code doing the translation and the data it is being fed,
and we can help.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> send your profile to [EMAIL PROTECTED]
Please don't post job offers here (comp.lang.python) (even for
Python jobs), there are more appropriate places for Python jobs,
but there is no excuse for asking for Java programmers here.
--Scott David Daniels
[EMAIL P
replacestr = 'x'
> macaddr = ''.join([macaddr, hex(intval).replace(replacestr, '')])
Replace the above by:
return '%02X' * 6 % struct.unpack('BB', buffer)
(doesn't help with win98, though)
--
-Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
cessor; this comes from allowing flexibility to individual
programs. The Windows model is big programs that do everything; the *ix
model is small independent processes that connect in interesting ways.
I like the latter, but there is something to be said for the former.
--Scott David Daniels
[EMAI
/marketdata/da'
even on windows.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
with Komodo. Getting the updates w/o extra charge was
a bonus. I was happy with the deal on the original version, so
these further improvements just make my deal feel better.
I don't regularly use Komodo, but when I do want it, it is invaluable.
My only affiliation with ActiveState is as a c
revious, True
file = open ('C:\some.csv','r')
reader = csv.reader(file)
for row, final in lagged(reader):
print row
if final:
print 'final:', row
else:
print 'leads:', row
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
You might want to take a look at the "Blocks and Views" code I did,
take a look at it and see if you can either use it directly or use
it with any changes you feel like making.
http://members.dsl-only.net/~daniels/Block.html
--
-Scott David Daniels
[EMAIL PROTECTED
Scott David Daniels wrote:
>
> def lagged(source):
> '''produce element,islast for elements in source'''
> generator = iter(source)
> previous = generator.next()
> for element in generator:
> y
I've just put together a Double-Ended Heap package.
Of course I'd love comments.
http://members.dsl-only.net/~daniels/deheap.html
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
pare as equal, so the DeHeap2 operations that
> find items by value will be at least under-defined, and maybe
> even broken.
Actually, the issue already exists for elements which define
their own __lt__ function. The rule I will use is that you have
told the DeHeap to delete some member equal
Bryan Olson wrote:
> Scott David Daniels wrote:
>> I've just put together a Double-Ended Heap package.
>> Of course I'd love comments.
>>
>>http://members.dsl-only.net/~daniels/deheap.html
>
> I think there's a typo in:
>
>
a you've obtained.
If you don't get transaction guarantees, your applications will have
to deal with all kinds of inconsistent data (either by ignoring the
problem or guessing the best answer).
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Alex Martelli wrote:
> Scott David Daniels <[EMAIL PROTECTED]> wrote:
>> If the data you store and update is sufficiently valuable to your
>> enterprise, picking a database may be vital. Transactions guarantee
>> every update either happens or not, and infrastructure i
f line.endswith('Person: Sarah\n'):
dest = person_sarah
else:
continue
while line != '---\n':
dest.write(line)
line = source.next()
f.close()
person_jimmy.close()
person_sarah.close()
--
ing. You state that the code is
> (for example) triple-licensed under the GPL, LGPL and BSD licenses.
One lawyer I talked to (who could not understand why I wanted to
open-source any code), claimed that the MIT license is better
written (legally) to protect the author from acquiring legal
l
loding heads
here). The big trick is that you can specialize the interpreter for
running _its_ input (a Python program), thus giving you a new
interpreter that only runs your Python program -- a very specialized
interpreter indeed.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org
y a WinXX example, but the "-n" parameter to idle is
the important part. Since a single-process Idle is running the Tkinter
GUI loop, you can try operations a step at a time (letting you see what
happens).
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
the
> syntactic colorizer can't cope any more.
>
> I definitively need a new algorythm.
>
And I am sadly stuck at 169. Not even spitting distance from 149 (which
sounds like a non-cheat version).
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
append each to its own list, and then
either finally if you can or periodically if you must:
for food, store, price in zip(foods, stores, prices):
--
-Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
KraftDiner wrote:
> I have a list and want to make a copy of it and add an element
> to the end of the new list, but keep the original intact
Nobody has mentioned the obvious yet:
tmp = myList + [something]
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/m
o do vector
> addition, cross products, dot products etc. and probably in the future
> I'll need matrix math as well.
>
Take a quick look at VPython. Should be great for breadboarding your
display and calculations.
--
-Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ltin__ module is magical -- the source of predefined names.
_Do_not_muck_about_with_it_in_delivered_code_ (I know it is tempting).
The reason to avoid playing with it is that you are slightly breaking
the Python environment all code runs in.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ng those
> characters out?
drop_controls = [None] * 0x20
for c in '\t\r\n':
drop_controls[c] = unichr(c)
...
some_unicode_string = some_unicode_string.translate(drop_controls)
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
if you still need to speed it up:
def bincoeff2(n, r, cache={}):
if r < n - r:
r = n - r
try:
return cache[n, r]
except KeyError:
pass
x = 1
for i in range(n, r, -1):
x *= i
for i in range(n - r, 1, -1):
x /= i
cache[n, r] = x
return x
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
s under-estimate of needed repetitions
while t0.timeit(repetitions) < .25: # .25 = minimum Secs per round
repetitions *= 10
print 'Going for %s repetitions' % repetitions
print 'hypergeometric:', t0.repeat(3, repetitions)
print 'hypergeomet
;original.zip', 'rb')
copy = open('copy.zip', 'wb')
copy.write(original.read())
original.close()
copy.close()
3) Now see if copy.zip can be opened by clicking.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
namically bound systems like Smalltalk, Ruby, and Python, the
more unusual case is wanting to go up the hierarchy (where you use super
to get the behavior you are apparently expecting). Think of Python's
method dispatch as always being "virtual".
--Scott David Daniels
[E
Tom Anderson wrote:
> Java has a java.io.File.getCanonicalPath method that does this, but i
> can't find an equivalent in python - is there one?
What's wrong with: os.path.normcase(path) ?
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
s) - names))
'_random binascii collections dis errno imp inspect opcode
pydoc random tempfile thread token tokenize'
That is, those are the modules loaded in the course of doing the "help".
I'd try loading them one-by one.
Alternatively, start the interpreter as:
python -v
And watch the imports as you do (1) "import time", and (2) "help(time)".
You may see the import causing the problem.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
KraftDiner wrote:
> Have I misunderstood something?
yes.
There is a reason people talk about names and bindings.
--
-Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
rvers are done.
else:
# We got a result.
print '%s: %s' % (time.time() - base, result)
if __name__ == "__main__":
main(3)
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Frank Niessink wrote:
> Scott David Daniels wrote:
>> Frank Niessink wrote:
>>> - What is the easiest/most pythonic (preferably build-in) way of
>>> checking a unicode string for control characters and weeding those
>>> characters out?
>> drop_contr
t this ability.
Pretty swift, ehhh? I have no relationship to ActiveState
except as a happy customer.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
f __init__(self):
> # super(self.__class__, self).__init__()
super(Square, self).__init__()# XXX fixed
> self.type = Square
> print 'Square'
>
> r = Rectangle()
> s = Square()
>
--
-Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
s like "bkg_clr" too.
Yeah, it's a real pain to constantly type "breakage_clear" every time.
:-)
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
he above algorithm), you could specify 254
different values with a mouse and paddle-board.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
to imagine answering what you
just asked with the evidence you provided. I don't know
if you are writing in Jython, IronPython, CPython, ...
on a dingleblat 4000, running python 2.1.35? ...
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
has wrote:
> MVC is all about separation of concerns
This is a wonderful explanation of MVC. I'm going to keep a link to the
Google-Groups version just so I can cite it to those asking about MVC.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ot;)
def test_three(self): ...
@broken_test_XXX("Using list as dictionary", TypeError)
def test_four(self): ...
It would also point out when the test started succeeding.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
riptions of the MVC pattern and why it works.
The link I have is huge, but:
http://groups.google.com/group/comp.lang.python/browse_thread/
thread/eb0be1531e010273/
9b80e79d4706200d?tvc=2&q=MVC+daniels#9b80e79d4706200d
I've inserted returns at two points in the url directl
last_class = class_name
print ' %s\t %s' % (test_name, reason)
Thanks for the thoughtful feedback.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
that forum or this one):
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/466288
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
that often left me
with too few test cases.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
e where you
had more ink. So for such things, the "state" of an object is more
than simply the rich detail of a data structure.
Much more common are objects which communicate with other systems
(either over network connections or locally on the machine). The
point where a "value"
ve,
-(22 + ignoreable), -20)
coredata = cStringIO.StringIO(data[: 22 + position])
return zipfile.ZipFile(coredata)
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
t; % ( working_dir, ssh_cmd,
> some_count, some_param1, some_param2)
...
Or another for readability:
4. some_string = ' '.join(["cd", working_dir, ";",
ssh_cmd, str(some_count), some_param1, some_param2])
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ike even more than python itself) that
> allows you to continue the work right where the exception was thrown.
As I have explained before in this newsgroup, Xerox Parc had that
ability (the ability to finish an exception by returning to its source)
in their system implementation language, and f
[EMAIL PROTECTED] wrote:
> Are there any visualization tool which would depict the random graph
> generated by the libraries.
Google for DOT (.DOT format w/ renders to a variety of output formats).
--
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/
use re unless it is a good solution.
sometimes you know which columns things are in, sometimes you know a
separator, sometimes there is a mix, and sometimes you do need a regular
expression. Save re for when you need to do pattern matching.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
27;t be so high as
to make each of the programmer's customers pay as if they are using
the full library.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
m for nm in dir(__builtin__)
if nm.startswith('is') or nm.startswith('has'))
['hasattr', 'hash', 'isinstance', 'issubclass']
>>> [hasattr(type,'mro'), hash(123), isinstance(type, type),
issubc
;" : "\\\"", "\t" : "\\t", "\n" : "\\n"}
def JSString(Str) :
mapped = [_map.get(Ch, Ch) for Ch in Str]
return "\"" + "".join(mapped) + "\""
--
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ransparent surfaces (or maybe semitransparent).
Take a look at VPython -- easy to start, 3-D display (wall-eye /
cross-eye) easy to run on.
--
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Ron Adam wrote:
> Scott David Daniels wrote:
>> James Stroud wrote:
>>>> I'm looking for a program to do line-drawings in 3d, with output to
>>>> postscript or svg or pdf, etc. I would like to describe a scene with
>>>> certain 1-3d el
Try:
def leaders(sorted_list):
held = None
for phrase in held:
if held is None or not phrase.startswith(held):
held = row
yield held
print list(leaders(sorted(data)))
--Scott David Daniels
[EMAIL PROTECTED]
--
http
Tim Chase wrote:
>> def leaders(sorted_list):
>> held = None
>> for phrase in held:
> ... I suspect you mean
> for phrase in sorted_list:
> no?
Ooops -- renaming code before posting should get its own test.
You are absolutely correct.
-
:\Python25\pythonw.exe"
to:
"C:\Python25\pythonw.exe -m idlelib.idle -n"
If this shortcut works to give you Idle, the problem is in creating
a separate process linked via a socket to "localhost" port 8833.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Ron Adam wrote:
> Scott David Daniels wrote:
>> Ron Adam wrote:
>>> ... Is there a way to have the display show a wire frame image instead of
>>> shaded shapes?
>> You can draw the edges as lines.
>
> Is there a setting for this?, or are you suggesting
on't know about break, continue, and for ... else, go
study the Python language.
--
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers wrote:
> ... idempotent -> no side effects.
Nope. idempotent: f(f(x)) = f(x)
That is, after doing it once, repeating it won't hurt.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
its not a GUI app.
Use a thread that uses something like:
def action():
sleep(50)
if not canceled:
callback(foo)
as its action.
The callback ill be in another thread, but Look up threading for
more details.
--Scott David Daniels
[EMAIL PROTECTED]
-
901 - 1000 of 2111 matches
Mail list logo