Re: [Tutor] Question

2005-08-02 Thread Alan G
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

Re: [Tutor] Question about BASIC and Python

2005-08-02 Thread Alan G
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

Re: [Tutor] I've run into a jam on the exercise on file I/O

2005-08-02 Thread Alan G
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 program

Re: [Tutor] I need advice.

2005-08-02 Thread Alan G
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

Re: [Tutor] I need advice.

2005-08-02 Thread Alan G
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...

Re: [Tutor] mailman

2005-08-02 Thread Damien
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

Re: [Tutor] terminology question

2005-08-02 Thread Kent Johnson
[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:

[Tutor] Corrupt files

2005-08-02 Thread Øyvind
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

Re: [Tutor] Color text in Text widget

2005-08-02 Thread sunny sunny
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 of

[Tutor] Directory or File ?

2005-08-02 Thread Damien
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

Re: [Tutor] Directory or File ?

2005-08-02 Thread Kent Johnson
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) return

Re: [Tutor] Directory or File ?

2005-08-02 Thread Wolfram Kraus
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 there is a

Re: [Tutor] Directory or File ?

2005-08-02 Thread Damien
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

[Tutor] time.sleep() error

2005-08-02 Thread sunny sunny
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

Re: [Tutor] time.sleep() error

2005-08-02 Thread Kent Johnson
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 :

Re: [Tutor] time.sleep() error

2005-08-02 Thread sunny sunny
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,

Re: [Tutor] time.sleep() error

2005-08-02 Thread geon
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 : TypeError

Re: [Tutor] fourier transform

2005-08-02 Thread Christian Meesters
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, opposite

Re: [Tutor] I need advice.

2005-08-02 Thread Nathan Pinno
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 tutor@python.org Sent: Tuesday, August 02, 2005 1:47 AM Subject: Re: [Tutor] I need advice. I want to

[Tutor] (no subject)

2005-08-02 Thread Greg Janczak
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!

Re: [Tutor] (no subject)

2005-08-02 Thread Kristian Rink
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

Re: [Tutor] time.sleep() error

2005-08-02 Thread geon
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

[Tutor] Question about resetting values

2005-08-02 Thread Nathan Pinno
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

Re: [Tutor] JBUS and Python which way

2005-08-02 Thread Miguel Lopes
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

Re: [Tutor] Corrupt files

2005-08-02 Thread Danny Yoo
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 verify

Re: [Tutor] Corrupt files

2005-08-02 Thread geon
Ø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 file. If

[Tutor] For Damien

2005-08-02 Thread Enrique Acosta Figueredo
/listinfo/tutor -- next part -- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tutor/attachments/20050802/b0b6ad7c/attachment-0001.htm -- Message: 8 Date: Tue, 2 Aug 2005 12:10:59 -0400 From: sunny sunny [EMAIL

Re: [Tutor] Corrupt files (fwd)

2005-08-02 Thread Danny Yoo
-- 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 for

Re: [Tutor] Corrupt files

2005-08-02 Thread Alan G
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, I

Re: [Tutor] Corrupt files

2005-08-02 Thread Roger Merchberger
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 downloaded file is

Re: [Tutor] Deleting an entry from a dictionary

2005-08-02 Thread Danny Yoo
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 I

Re: [Tutor] Deleting an entry from a dictionary

2005-08-02 Thread Adam Bark
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 {'lunch': 'slimfast',

[Tutor] substituting empty line with stuff

2005-08-02 Thread Srinivas Iyyer
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

Re: [Tutor] print a line in IDLE as bold, italics or a color

2005-08-02 Thread Danny Yoo
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

Re: [Tutor] print a line in IDLE as bold, italics or a color

2005-08-02 Thread Victor Reijs
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 window.

Re: [Tutor] fourier transform

2005-08-02 Thread Jeff Peery
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 =