Hi all,
I have a problem about variables efficiency.
As below, I import f from config.py, Then f is appended to app1.py global
variables.
In class App, there're two ways to use this variable. One is "self.file =f",
then use self.file; the other is using "f" directory. Which way is high
efficient?

config.py:
f = file("test.txt")


app1.py:
from config import *

class App:
    def __init__(self):
        self.file = Attr1

    def run(self):
        self.file.write("...")
        # f.write("...")

Regards.
Joson
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to