On Tue, 2005-08-02 at 13:22 -0700, Danny Yoo wrote:
>
> -- Forwarded message --
> Date: Tue, 2 Aug 2005 22:12:34 +0200 (CEST)
> From: "[iso-8859-1] yvind" <[EMAIL PROTECTED]>
> To: Danny Yoo <[EMAIL PROTECTED]>
> Subject: Re: [Tutor] Corrupt files
>
> Hello and thank you.
>
> I d
Hi all,
I am writing a poker game and a blackjack game. I was wondering which way
would be Python smart and work properly. I am trying to figure out whether or
not to use t(n) as a card indicator, when n = randomly drawn number. I could go
that way, or code it as t1, t2, t3, etc. Which way
Never mind all. I was just being stupid as usual. I thought that there might
be a Python command for resetting and wanted to find out if that was the
case.
- Original Message -
From: "Alan G" <[EMAIL PROTECTED]>
To: "Nathan Pinno" <[EMAIL PROTECTED]>; "Tutor mailing list"
Sent: Tuesday
On Tue, 2 Aug 2005 10:12:28 +0100
"Alan G" <[EMAIL PROTECTED]> wrote:
>
> > I forgot to tell that I use Python 2.2.3. When I first got Python, I
> > got
> > 2.4.1, but it refused to run the second time. So I went and got
> > 2.2.3. Your answer would make sense if I had 2.4.1, but I don't.
>
>
Hi Christian,
sorry for the lack of detail. how about I use a sine wave because I know what the output should look like - amplitude of one at frequency equal to the frequency of the sine wave.
one period of a sin wave that cycles at one hertz:
period = 1
input = sin(arange(0,64)*3.14159*2/64.
Hello Danny,
Danny Yoo wrote:
>>This is in a seperate text box, but I want to have the colors
>>(bold/italics) in the default IDLE window.
>
> This will probably be more difficult. I don't believe IDLE itself allows
> a user's program to set its own fonts and colors within the running IDLE
> win
On Tue, 2 Aug 2005, Victor Reijs wrote:
> This is in a seperate text box, but I want to have the colors
> (bold/italics) in the default IDLE window.
[Note: please use Reply-to-all]
This will probably be more difficult. I don't believe IDLE itself allows
a user's program to set its own fonts a
Hello group:
I have a file (3339203 lines) that looks like this:
(col:1)(col:2) (col:3)
AD134KL
X X
X X
X X
AD144KL
Y Y
Y Y
Now I have to fill the rows in co
On Tue, 2 Aug 2005, Victor Reijs wrote:
> I am trying to simply(?) print some text in a print statement as bold
> (or itlaics or an certain color). How do I do this in python? Browsing
> the web gives we all kind of soluation, but non seem to work (a lot are
> related when printing on the web).
meals.pop(key) will do it.
Example:
>>> meals = {}
>>> meals['breakfast'] = 'slimfast'
>>> meals['lunch'] = 'slimfast'
>>> meals['dinner'] = 'something sensible'
>>> meals
{'lunch': 'slimfast', 'breakfast': 'slimfast', 'dinner': 'something sensible'}
>>> meals.pop("breakfast")
'slimfast'
>>> meals
On Tue, 2 Aug 2005, Greg Lindstrom wrote:
> This must be simple, but for the life of me I can't figure out how to
> delete an entry from a dictionary. For example,
>
> meals = {}
> meals['breakfast'] = 'slimfast'
> meals['lunch'] = 'slimfast'
> meals['dinner'] = 'something sensible'
>
> How do
Hello-
This must be simple, but for the life of me I can't figure out how to
delete an entry from a dictionary. For example,
meals = {}
meals['breakfast'] = 'slimfast'
meals['lunch'] = 'slimfast'
meals['dinner'] = 'something sensible'
How do I eliminate 'lunch' from the dictionary so that I onl
Rumor has it that geon may have mentioned these words:
>Øyvind napsal(a):
>
> >Hello.
> >
> >I have created a program that automatically downloads some files I need.
> >It can be .zip, .jpg, .mpg or .txt. However, a lot of the time urlretrieve
> >downloads the file, gives no error, but the download
>>I have created a program that automatically downloads some files I
>>need.
>>It can be .zip, .jpg, .mpg or .txt. However, a lot of the time
>>urlretrieve
>>downloads the file, gives no error, but the downloaded file is
>>corrupted.
>>I use a simple check for the size of the file. If it is way
> I am writing a Blackjack program, and was wondering how to
> reset the values to zero, e.g. cash = 0?
Yes, that's how you do it. Now what is the bit you don't
understand?
Alan G
Author of the Learn to Program web tutor
http://www.freenetpages.co.uk/hp/alan.gauld
__
-- Forwarded message --
Date: Tue, 2 Aug 2005 22:12:34 +0200 (CEST)
From: "[iso-8859-1] �yvind" <[EMAIL PROTECTED]>
To: Danny Yoo <[EMAIL PROTECTED]>
Subject: Re: [Tutor] Corrupt files
Hello and thank you.
I don't really think that will help. The files are mostly smaller ones of
Hello all of you,
I am trying to simply(?) print some text in a print statement as bold
(or itlaics or an certain color). How do I do this in python?
Browsing the web gives we all kind of soluation, but non seem to work (a
lot are related when printing on the web).
Say I want to print the text
I am now using Python 2.4.1, but decided to abandon it. It got too confusing
too fast. I'm better off writing simple games and apps for now.
- Original Message -
From: "Nathan Pinno" <[EMAIL PROTECTED]>
To: "Danny Yoo" <[EMAIL PROTECTED]>
Cc: "Tutor mailing list"
Sent: Tuesday, August 02
os.path.isdir:
> http://python.org/doc/2.4.1/lib/module-os.path.html#l2h-1739
>
> HTH,
> Wolfram
>
>
>
> --
>
> Message: 7
> Date: Tue, 02 Aug 2005 18:00:07 +0200
> From: Damien <[EMAIL PROTECTED]>
> Subject: Re: [Tutor] Directory or F
Øyvind napsal(a):
>Hello.
>
>I have created a program that automatically downloads some files I need.
>It can be .zip, .jpg, .mpg or .txt. However, a lot of the time urlretrieve
>downloads the file, gives no error, but the downloaded file is corrupted.
>I use a simple check for the size of the fil
On Tue, 2 Aug 2005, [iso-8859-1] �yvind wrote:
> Is there some function/modulte that checks a files integrity wheter or
> not the file is corrupt or not?
Hello!
A general technique that people have used before is to provide file
"checksums" of large files. These checksums can be used to verif
pyserial provides serial communication but I think I require an interface that
would abstract/simplify the JBUS/MODBUS protocol.
Thanks Danny and Alan for all the help.
Will check out comp.lang.python for advice.
Best Miguel
---
Chegou o Clix ADSL até 16 Megas
In
I am writing a Blackjack program, and was wondering how to reset the values
to zero, e.g. cash = 0?
Thanks,
Nathan Pinno,Crew, Camrose McDonalds and owner/operator of
Woffee
BEGIN:VCARD
VERSION:2.1
N:Pinno;Nathan;Paul;Mr.
FN:Pinno, Nathan Paul
ORG:Woffee;Executive
TITLE:Owner/operator
TEL;CE
geon napsal(a):
sunny sunny napsal(a):
Hi all,
I am using time.sleep to stop my program execution for some time. I
have imported time and am able to use it sucessfully in the main
program.
However if I use it in any function I get the following error:
the time.sleep(1) command
Greg Janczak schrieb:
> This is a totally unrelated question but does anyone know a good free iso
> image burner?
Well, what don't you like about cdrecord? Otherwise, specifying which
operating system you're intending to use this on would be quite a good
idea. ;)
Cheers,
Kris
--
"Sei Du selbst
This is a totally unrelated question but does anyone know a good free iso
image burner?
greg
_
Express yourself instantly with MSN Messenger! Download today - it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/0
I think I'll leave this one for someone else. I got too confused too quick.
- Original Message -
From: "Alan G" <[EMAIL PROTECTED]>
To: "Nathan Pinno" <[EMAIL PROTECTED]>; "Tutor mailing list"
Sent: Tuesday, August 02, 2005 1:47 AM
Subject: Re: [Tutor] I need advice.
>> I want to write
Hi
Pawel Kraszewski wrote:
> 4. The answer is symmetrical - usually you take only half of it. I
> don't
> remember the exact difference between the halves, but you may find it
> in any
> article on FFT.
The real part is identical the imaginary part has the opposite sign
("same amplitude, oppos
sunny sunny napsal(a):
>Hi all,
>
>I am using time.sleep to stop my program execution for some time. I
>have imported time and am able to use it sucessfully in the main
>program.
>
>However if I use it in any function I get the following error:
>
>the time.sleep(1) command generates this error :
>
Some additional information:
I am calling this function from a thread and I get the error.
However if I call the function from the main program it works fine.
I am using thread.start_new_thread() to start the thread.
Thanks.
Santosh.
On 8/2/05, sunny sunny <[EMAIL PROTECTED]> wrote:
> Hi all
sunny sunny wrote:
> Hi all,
>
> I am using time.sleep to stop my program execution for some time. I
> have imported time and am able to use it sucessfully in the main
> program.
>
> However if I use it in any function I get the following error:
>
> the time.sleep(1) command generates this error
Hi all,
I am using time.sleep to stop my program execution for some time. I
have imported time and am able to use it sucessfully in the main
program.
However if I use it in any function I get the following error:
the time.sleep(1) command generates this error :
TypeError : 'int' object is not ca
Ok, sorry. In the future, I will look more closely the module before
sending my question.
Thanks.
Kent Johnson a écrit :
Damien wrote:
Hi all,
I want to know if a file is a directory or a simple file.
Look at os.path.isdir()
Kent
I have done a little ugly sc
Damien wrote:
> Hi all,
> I want to know if a file is a directory or a simple file.
> I have done a little ugly script :
> # i is my filename, os is imported
> old = os.getcwd()
> try:
> chdir(i)
> is_dir = True
> except:
> is_dir = False
> os.chdir(old)
> return is_dir
>
> But maybe t
Damien wrote:
> Hi all,
> I want to know if a file is a directory or a simple file.
Look at os.path.isdir()
Kent
> I have done a little ugly script :
> # i is my filename, os is imported
> old = os.getcwd()
> try:
> chdir(i)
> is_dir = True
> except:
> is_dir = False
> os.chdir(old)
Hi all,
I want to know if a file is a directory or a simple file.
I have done a little ugly script :
# i is my filename, os is imported
old = os.getcwd()
try:
chdir(i)
is_dir = True
except:
is_dir = False
os.chdir(old)
return is_dir
But maybe there is a better way ?
If you know a bette
Thanks.
Its works very well.
Santosh.
On 8/1/05, Jorge Louis de Castro <[EMAIL PROTECTED]> wrote:
> I found a way to do it but I'm not sure it is the cleanest. Maybe someone
> else on this list can offer a better solution.
>
> I use the text's configuration to define tags that I apply to sections
Hello.
I have created a program that automatically downloads some files I need.
It can be .zip, .jpg, .mpg or .txt. However, a lot of the time urlretrieve
downloads the file, gives no error, but the downloaded file is corrupted.
I use a simple check for the size of the file. If it is way too small
[EMAIL PROTECTED] wrote:
> Quoting Dick Moores <[EMAIL PROTECTED]>:
>
>
>>Why are list comprehensions called that?
>
>
> Because that's what they're called in Haskell, I guess..
>
> It's historical, based on the term "set comprehension" from mathematics, also
> known as "set builder notation":
Mohammad Moghimi a écrit :
[...]
checking that Python has a working distutils... configure: error:
* Distutils is not available or is incomplete for /usr/bin/python
* If you installed Python from RPM (or other package manager)
* be sure to install the -devel package, or install P
Hi Jane,
> I'd like to know what kind of Python I can download. I've tried but
> in vain!
> My computer is windows xp servixe pack 1, version 2002.
There are two main possibilities, either the generuc Python designed
for
any computer or the ActiveSTate vesion witch is the generic version
with
> I forgot to tell that I use Python 2.2.3. When I first got Python, I
> got
> 2.4.1, but it refused to run the second time. So I went and got
> 2.2.3. Your answer would make sense if I had 2.4.1, but I don't.
Version 2.3 should work and has the datetime stuff I think
- just checked and it does
> I want to write a program that will convert time in any other
> time zone to my time zone.
This is a deceptively complex task. There are around 40 timezones
varying by anything from 15 minutes to 2 hours. And some places
change timezone throughout the year. Others have multiple daylight
savi
> What if I were to use ID's for the students and use the ID's as the
> sequence
> index, and link the students and their grades to the IDs?
Its not necessary for what you are doing but it's how you'd normally
do it
in a relational database, so if you ever needed to turn your file
based
progra
> I had a co-worker say to me at work that Python was related
> to or based upon BASIC. Is this true, and if not, how can I
> tell my friend why they are similar?
Both Python and BASIC are interpreted languages intended to
be used (amongst other things) to learn how to program.
There the simil
> Just curious to wonder if Python can be used to write a
> program to check an HTTP mail server for mail,
Yes, you would probably use the urllib module for that.
> and check more than one server,
Yes that would be a fairly typical use for Python as
a web client.
> even if they are using di
46 matches
Mail list logo