[Tutor] compiled Python Files ?? and a little OO (fwd)

Danny Yoo dyoo@hkn.eecs.berkeley.edu
Sun, 9 Dec 2001 13:59:23 -0800 (PST)

Hi Frank,

I think you meant to send this to the "tutor@python.org" address.  The
"tutor-admin@python.org" only sends it off to the list admins.

I'll forward your message to the rest of the list.  Best of wishes to you.

---------- Forwarded message ----------
Date: Sun, 09 Dec 2001 10:54:10 -0800
From: Frank Peavy <fpeavy@pop.net>
To: tutor-python.org <tutor@python.org>
Subject: [Tutor] compiled Python Files ?? and a little OO

I created three simple files to test with:
F1.py file and all it contains is:

print "Hello"
Another file F2.py that contains:

print "JSmith"
I have one more FX.py file that contains:

import F1.py
import F2.py
My end result was:


The results seem correct, in my opinion.
So, here are my questions. Although I didn't request it, Python did a line 
feed between Hello and JSmith, is this normal?

After I ran this, I noticed that I had two new versions of F1 and F2; the 
directory showed "Compiled Python file" as a description and they had .pyc 
extensions. Why didn't I see this happening with my other tests? Is it 
because the other tests imported Tkinter?

I understand I can run the .pyc files, instead of the .py files. Is this true?

Why didn't I get a FX.pyc file also... ? The first two files compiled but 
the third file that imported the other two didn't.

A little confused...  :-)

Tutor maillist  -  Tutor@python.org