Hi!
Just a followup on this:
On 9/21/07, Kalle Svensson <[EMAIL PROTECTED]> wrote:
> Hi!
>
> On 9/21/07, Boykie Mackay <[EMAIL PROTECTED]> wrote:
> > Ok,I have learnt how to generate prime numbers and how to 'split'
> > input.The above was to help me solve the second 'SPOJ'
> > challenge,PRIME1.T
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Well, chmod 0700 is usually not want you want:
a) 0700 gives only read/write/execute rights to the user. Technically
for historical reason permissions can be written as an octal number,
with the first digit being optional, encoding stuff like setuid/s
I think you need to check to see if the remaining amount is less than the
payment amount.
Eric...
Christopher Spears <[EMAIL PROTECTED]> wrote: I'm working on a problem in
Chapter 5 of Core Python
Programming(2nd Edition). I am supposed to write a
script that take an opening balance and a mont
Hello
I have a problem when copy files and directory tree in
ftp, scripts in here only copy one file:
from ftplib import FTP
rootList = []
session = FTP()
session.connect('workstation', port=21)
session.login(user='saiki', passwd='saiki')
session.retrlines('LIST', rootList.append)
f=open('D:/PARAM
Kalle Svensson wrote:
> After quite a bit of experimentation, I finally managed to write a
> program that was accepted by the judge system. It's a C++
> implementation of the deterministic Miller-Rabin algorithm. My Python
> implementation of the same algorithm is still too slow, though. Has
> anyo
Nelson Kusuma wrote:
> Hello
>
> I have a problem when copy files and directory tree in
> ftp, scripts in here only copy one file:
To transfer an entire directory with ftplib you will have to read the
local directory with os.listdir() and loop to send the files.
There are a few higher-level mod
Eric Walker wrote:
> I think you need to check to see if the remaining amount is less than
> the payment amount.
>
> Eric...
Or just subtract the minimum between the remaining amount and the
payment amount. See below
>
> */Christopher Spears <[EMAIL PROTECTED]>/* wrote:
>
> I'm working on
Greetings Chris,
On 9/25/07, Chris <[EMAIL PROTECTED]> wrote:
>
> Ok as I see it, it's should go like this:
>
> Print 'Think of a number between 1 and 100, and let me guess it'
>
> Type1 = input ('Type 1 if I am high')
> Type2 = input ('Type 2 if I am low')
> Type3 = input ('Type 3 if I am dead
Chris wrote:
> Ok as I see it, it's should go like this:
>
> Print 'Think of a number between 1 and 100, and let me guess it'
>
> Type1 = input ('Type 1 if I am high')
> Type2 = input ('Type 2 if I am low')
> Type3 = input ('Type 3 if I am dead on')
This will ask for three different inputs whi
Greetings,
I don't know how to do ms-windows, but I use GNU/Linux on a daily
basis. There is a nice IDE (Integrated Development Environment) for
Python called IDLE. It is available for ms-windows, GNU/Linux, and maybe
another OS as well. There is information about IDLE at Python.Org. I'd
suggest
Hi Tutors,
Is there a way to get the index of every occurence of a certain element in a
list. listname.index(element) gives me the index of the first occurence. For
example:
>>> t = 'we are we are we we we'.split()
>>> t
['we', 'are', 'we', 'are', 'we', 'we', 'we']
>>> for word in t:
if word =='
Emad Nawfal wrote:
> Hi Tutors,
> Is there a way to get the index of every occurence of a certain element
> in a list. listname.index(element) gives me the index of the first
> occurence. For example:
>
> >>> t = 'we are we are we we we'.split()
> Now I want the index of each 'we' in t. I want
Hi Armand, I suggest you learn Linux command line first. It is the
basic skill in Linux world, like double-click in Windows. If you know how to
run a program in Windows with double-click, you will understand how to run most
program in Windows. If you know how to run a program with comman
Hi Armand, I suggest you learn Linux command line first. It is the
basic skill in Linux world, like double-click in Windows. If you know how to
run a program in Windows with double-click, you will understand how to run most
program in Windows. If you know how to run a program with comman
Hi all,
I'm looking for a tutorial PDF file of Python that is dedicated to
animation and special effects,can ahyone help?If you can please forward
to the following address:
[EMAIL PROTECTED]
[EMAIL PROTECTED]
THANKS
This
Dear all-
I want to do some loops. Each loop will generate a tuple. Eventually I want
to put tuples together in a higher level of tuple. Do you know how to do
this?
Say a=(1,2,3), b=(4,3,2),c=(9,5,6). I want to get a tuple as ((1,2,3),
(4,3,2),(9,5,6)).
If there are just 2 tuples, I can write x
Dear all-
Let a=(3,4,7), b=[3,4,7].
If I type
print '%d + %d = %d' %(a)
I get
3 + 4 = 7
But if I type print '%d + %d = %d' %(b), I get errors.
If there is a way for doing this kind of type dirrectly from array.
Thank you!
Fangwen
___
Tutor maillist
Dear all-
If I have an array array([1, 2, 3, 4, 5, 6]), and I want to get
((1,2),(3,4),(5,6)). What should I do?
Thank you!
Fangwen
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Fangwen Lu wrote:
> Dear all-
>
> I want to do some loops. Each loop will generate a tuple. Eventually I
> want to put tuples together in a higher level of tuple. Do you know how
> to do this?
>
> Say a=(1,2,3), b=(4,3,2),c=(9,5,6). I want to get a tuple as ((1,2,3),
> (4,3,2),(9,5,6)).
>
> I
Fangwen Lu wrote:
> Dear all-
>
> Let a=(3,4,7), b=[3,4,7].
> If I type
> print '%d + %d = %d' %(a)
> I get
> 3 + 4 = 7
>
> But if I type print '%d + %d = %d' %(b), I get errors.
>
> If there is a way for doing this kind of type dirrectly from array.
No, but it's trivial to convert an array
Fangwen Lu wrote:
> Dear all-
>
> I want to do some loops. Each loop will generate a tuple. Eventually I
> want to put tuples together in a higher level of tuple. Do you know
> how to do this?
>
> Say a=(1,2,3), b=(4,3,2),c=(9,5,6). I want to get a tuple as ((1,2,3),
> (4,3,2),(9,5,6)).
>
Fangwen Lu wrote:
> Dear all-
>
> If I have an array array([1, 2, 3, 4, 5, 6]), and I want to get
> ((1,2),(3,4),(5,6)). What should I do?
>
tuple([j for (i,j) in enumerate(zip(x, x[1:])) if i % 2 == 0])
___
Tutor maillist - Tutor@python.org
http:
Fangwen Lu wrote:
> Dear all-
>
> Let a=(3,4,7), b=[3,4,7].
> If I type
> print '%d + %d = %d' %(a)
> I get
> 3 + 4 = 7
>
> But if I type print '%d + %d = %d' %(b), I get errors.
>
> If there is a way for doing this kind of type dirrectly from array.
>
print '%d + %d = %d' % tuple(b)
Fangwen Lu wrote:
> Dear all-
>
> If I have an array array([1, 2, 3, 4, 5, 6]), and I want to get
> ((1,2),(3,4),(5,6)). What should I do?
First, you read some documentation and tutorials on the language, then
you iterate over the list and build tuples out of the elements.
>
> Thank you!
>
Here some more work:
guess = 0
Print ‘Pick a number between 0 and 100’
While guess != :
print ‘My first guess is ‘, guess
print ‘Is my guess correct?’
if guess = = type3
print ‘I got it!’
if guess > ___:
pick l
Well I guess the subject/topic here describes it all. I am looking for a
nice collection of SIMPLE python scripts, IE: How to manipulate files,
text, how to create a bot, how to work with socks...making a
server/client, converting decimal to binary etc. etc. etc. Example
scripts since I am havi
http://examples.oreilly.com/python3/
http://aspn.activestate.com/ASPN/Cookbook/Python/
http://examples.oreilly.com/twistedadn/
http://www.vex.net/parnassus/
I guess you could start with those and see what you can find?
--
b h a a l u u at g m a i l dot c o m
http://www.geocities.com/ek.bhaaluu/in
On 9/26/07, Ulrich Holtzhausen <[EMAIL PROTECTED]> wrote:
>
> Well I guess the subject/topic here describes it all. I am looking for a
> nice collection of SIMPLE python scripts, IE: How to manipulate files,
> text, how to create a bot, how to work with socks...making a
> server/client, converting
Ulrich Holtzhausen wrote:
> Well I guess the subject/topic here describes it all. I am looking for a
> nice collection of SIMPLE python scripts,
http://aspn.activestate.com/ASPN/Cookbook/Python as well as the printed
version already referenced.
http://diveintopython.org/ has fairly long examples
lo there all,
i have a gui program that imports a few modules that i don't need if i am
using the program remotely.
The program has an admin interface and thread interface, only the admin
interface is needed when
i am using the program from a remote computer.
all of my modules are imported at the
shawn bright wrote:
> lo there all,
>
> i have a gui program that imports a few modules that i don't need if i
> am using the program remotely.
> The program has an admin interface and thread interface, only the admin
> interface is needed when
> i am using the program from a remote computer.
>
Here some more work:
guess = 0
Print ?Pick a number between 0 and 100?
While guess != :
print ?My first guess is ?, guess
print ?Is my guess correct??
if guess = = type3
print ?I got it!?
if guess > ___:
pick
Chris wrote:
>
> Here some more work:
>
>
> guess = 0
>
> Print ?Pick a number between 0 and 100?
>
>
> While guess != :
> print ?My first guess is ?, guess
> print ?Is my guess correct??
> if guess = = type3
> print ?I got it!?
> if guess
I don't know what to do at this point. I do not have the book, but will get
it just to have...
Can anyone help me?
> Here some more work:
>
>
> guess = 0
>
> Print ?Pick a number between 0 and 100?
>
>
> While guess != :
> print ?My first guess is ?, guess
> print ?Is m
On 9/27/07, Chris <[EMAIL PROTECTED]> wrote:
>
> I don't know what to do at this point. I do not have the book, but will
> get
> it just to have...
>
> Can anyone help me?
>
> > Here some more work:
> >
> >
> > guess = 0
> >
> > Print ?Pick a number between 0 and 100?
> >
> >
> > While guess != __
On 9/27/07, Ian Witham <[EMAIL PROTECTED]> wrote:
>
> On 9/27/07, Chris <[EMAIL PROTECTED]> wrote:
> >
> > I don't know what to do at this point. I do not have the book, but will
> > get
> > it just to have...
> >
> > Can anyone help me?
> >
> > > Here some more work:
> > >
> > >
> > > guess = 0
>
36 matches
Mail list logo