> 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,
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
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 be
First off, print 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 tutorials
go,
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)[
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 a
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 poorl
An early language translator app was fed
'Out of sight, out of mind'
and then the result fed back in for reverse translation.
The output was:
'Invisible, lunatic'
Cute, Alan. I like it!
Jeff - thanks for the insight. I guess I think more in theory than in
reality sometimes.
Kent - thanks for your
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 int
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
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 h
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 a Python GUI program from the shell. Or something like
that...you should ask this one on the python-mac SIG mailing list:
http://w
On Mar 31, 2005, at 23:07, Alan Gauld wrote:
And if Sun ever get round to finishing their JVM on a chip
we'll have a chip that is both OO and procedural!
At that point it would be a JRM, then, wouldn't it? :D
-- Max
maxnoel_fr at yahoo dot fr -- ICQ #85274019
"Look at you hacker... A pathetic c
C Smith, Danny and Kent, thanks for the replies.
Here is my programme (I have reinstated the "while loop"
C Smith I like very much your method to get the last digits of a number.
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 pe
test!
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
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".
Be sure you understand what format the time number has and that you
understand the problem statement. Here are two time values:
1112306463.0
1112306463.01
Do you se
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 a Python GUI program from the shell. Or something like
that...you should ask this one on the python-mac SIG mailing list:
http://www.python.org/sigs/pythonmac-sig/
Kent
Yo
> 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:
> ps -- as for the need for a circular buffer vs. FIFO: I think my dsp
> background pushed me toward the CB. My app involves data acquisition
> for extended periods of time. I can't grow the FIFO infinitely, but it
> is no big deal if a few samples get overwritten. Does this make sense?
Hi Mar
Just to be picky...
> code to be executed by the processor. Machine language is not
> object-oriented.
In some cases it is. The Rekursiv computer by Linn systems had
a CPU that had an OO machine language which supported parallelism
by exposing 'threads' as active objects at the machine code l
> Would limiting the max capacity of the FIFO improve performance by
> allowing one to preallocate the FIFO buffer?
In a language like C it would help but in Python there's not much
likliehood of advantage. BUt if you were writing a C module to
integrate with Python then yes it might be an idea
> 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
> 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,
Thanks Kent I kind of see what you are trying to explain to me, it makes it
easier by trying the different combination.
So even is I change the first line to
import time
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 little confused about imports.
If I
>>> import time
then the name 'time' is bound to the time module:
>>> time
The time() function is an attribute of the time module:
>>> time.time
>>> time.time()
1112296322.9560001
Alternatively, I can import the time function directly:
>>> f
Marcus Goldfish wrote:
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 recip
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 = in
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 pl
> 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. H
> 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
> between binary and decimal representation. Just as a phrase that's
> translated from English into Russian and then back to English again
> can have its meaning shifted,
Urban legend ,maybe but illustrates the point well:
An early language translator app was fed
'Out of sight, out of mind'
Hi!
In a class derived from thread I open a socket-Connection to a remote
Server.
Here I start about 500 Thread's on a solaris-System. Sofar there is no
problem, when the filedescriptorlimit is set high enough with ulimit -n.
My Problem is, when a function in the class tries to open a regular
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
Mark Thomas wrote:
Does anyone have some examples on the use of A.M. Kuchling's Python
Cryptography Toolkit? I've tried his examples but get "AttributeError"
and "TypeError". What I'm trying to do is encrypt/decrypt a file. I'm
using Python 2.3 on xp pro.
If you post your code and the complete erro
Does anyone have some examples on the use of A.M. Kuchling's Python
Cryptography Toolkit? I've tried his examples but get "AttributeError"
and "TypeError". What I'm trying to do is encrypt/decrypt a file. I'm
using Python 2.3 on xp pro.
Thanks
--
_
( ) Mark Thomas ASCII ribbon campaign
X ww
On Wed, 30 Mar 2005, Marcus Goldfish wrote:
> I need to implement a FIFO with a fixed maximum capacity.
Hi Marcus,
Out of curiosity, why do you require a first-in-first-out queue with a
maximum capacity?
> Would limiting the max capacity of the FIFO improve performance by
> allowing one to p
On Mar 31, 2005, at 01:56, Kent Johnson wrote:
Mike Hall wrote:
I looked over the global module index and the closest thing I could
find relating to my os (osx) was EasyDialogs, which has a few
functions pertaining to this, "AskFileForOpen()" being one. Calling
any function within EasyDialogs ho
37 matches
Mail list logo