On Thu, 31 Mar 2005 09:14:03 -0500, Kent Johnson [EMAIL PROTECTED] wrote:
If you post your code and the complete error message including the stack
trace we may be able to help.
Kent
Thanks Ken
I'm getting closer to making this work using the XOR cipher. Here's
what I'm doing.
from python
I am sorta starting to get it. So you could use __init__ to ask for
a
file name to see if there is one in a folder or not if there is then
open that file and conitue where that file left off. If its not
there
create a new file with that name, then start the program? Or do I
have
that all
exercise. I need to rewrite the high_low.py program (see below) to
use the
last two digits of time at that moment to be the random number.
This is
using the import time module.
I just can't work out how to do that, I have been looking at it for
the past
2,5 hours but can't break it. Has
Danny,
Thanks for the informative response. After I sent the email I
realized that a circular buffer is a FIFO with fixed capacity, and
that is what I want to implement. I think I recall seeing a recipe in
the Python Cookbook (1st).
If you or anyone else know of other recipes/implementations
Alan and John thanks for the help. I have now this bit of script but it is
not running.
--
from time import *
n = time()
s = str(n)
numb = s[-2:] # last two characters of the string
numb =
You are just a little confused about imports.
If I
import time
then the name 'time' is bound to the time module:
time
module 'time' (built-in)
The time() function is an attribute of the time module:
time.time
built-in function time
time.time()
1112296322.9560001
Alternatively, I can import
My script is still not working properly, I am obviously missing a
statement somewhere, the script return:
Enter a number: 25
You are just a bit too high, try again
The End
The script exits and don't give another try, could you enlight me in
this one, thanks
Hi John,
What does your
I was wondering, can you make a program the uses alot of classes do
the exact same thing with out useing classes?
Yes you can always write a program without classes but it may be a
lot more work and its likely to be a lot harder to maintain.
Especially if its a big program.
However if you
Let me make sure I understand. Let's imagine that we have such a
CircularQueue, with methods:
push(element)
pop()
isEmpty()
[example unittest code]
Danny,
Yes, it looks like that is a valid unittest for a circular buffer. An
enhancement is to modify the accessors:
test!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
1) For plain text use the old DOS trick of sending output direct
to the PRN: file/device - I can't remember if this still works
in XP but I can't think why not...
The only reason I can think of is that Windows XP is not directly based on
DOS, wereas the other versions were. In so doing, they
Cool! Does anybody know of... I guess a rather *thorough* tutorial of win32?
for the very reason that I don't know that this existed, and there may be
other things I can use that I'm missing...
TIA,
Jacob
Richard Lyons wrote:
I have little experience with programming. I have Python installed on
I understand what you are talking about, but I tend toward just making
it one of the things to remember when working with floats. (I've been
bitten a lot when I forget to use '==' instead of '=', too!)
Yeah, but it threw me for a loop, because I could find *no*e way to compare
a
float and an
Quoting Jacob S. [EMAIL PROTECTED]:
Cool! Does anybody know of... I guess a rather *thorough* tutorial of
win32? for the very reason that I don't know that this existed, and there may
be other things I can use that I'm missing...
I don't know of anything online ... It seems a very
Ah, so it has to do with access to the window manager. That answers a
lot, thanks.
On Mar 31, 2005, at 4:09 PM, Max Noel wrote:
On Apr 1, 2005, at 00:14, Mike Hall wrote:
On Mar 31, 2005, at 12:21 AM, Max Noel wrote:
It's been too long since I used Python on MacOSX, but IIRC you
can't just run
An alternative way of doing this (if you have python 2.4):
ppl = ['john', 'mary', 'lary', 'jane'] age = [15, 30, 23, 25] height= [160, 165, 178, 170] sortby = lambda a, b: [a[b.index(x)] for x in sorted(b)] sortby(ppl, age)['john', 'lary', 'jane', 'mary'] sortby(ppl, height)['john', 'mary',
First off, print stuff stills works from an XP cmd.exe, but only for
LPT printers, not USB.
Secondly, Win32's methods are well documented, using them isn't.
There are some tutorials included with the download, and you get a chm
help file filled with the objects and methods, but as far as
John Carmona wrote:
It is WORKING NOW!! You can imagine how long I have spent on that, but I
have learnt so much. Many thanks to all the people that have helped me,
you will probably see me around asking a zillion other (very basics)
questions.
Congratulations! I have one^H^H^Htwo small notes
What's b.index(x) do?
I'm guessing the for a list Delta = [a,b,c], you get
Delta.index(b)
1
Am I right?
On Apr 1, 2005 1:16 PM, py [EMAIL PROTECTED] wrote:
An alternative way of doing this (if you have python 2.4):
ppl = ['john', 'mary', 'lary', 'jane']
age = [15, 30, 23,
What's b.index(x) do?
I'm guessing the for a list Delta = [a,b,c], you get
Delta.index(b)
1
Am I right?
Yes. For future use, the easiest way to answer a question like that is to
do:
help([].index)
Help on built-in function index:
index(...)
L.index(value, [start, [stop]]) -
20 matches
Mail list logo