Re: How to generalize a function?

2005-04-25 Thread jfj
Thomas Köllmann wrote: Hi, everybody! I'm teaching myself Python, and I have no experience in programming apart from some years of shell scripting. So, please bear with me. These two funktions are part of an administrative script I've set myself as a first lesson, and, as you will see, they're

Re: How to generalize a function?

2005-04-24 Thread Dan Sommers
On Sun, 24 Apr 2005 23:40:22 +0200, Thomas Kllmann [EMAIL PROTECTED] wrote: Hi, everybody! I'm teaching myself Python, and I have no experience in programming apart from some years of shell scripting. So, please bear with me. These two funktions are part of an administrative script I've set

Re: How to generalize a function?

2005-04-24 Thread Alexander Schmolck
Thomas Köllmann [EMAIL PROTECTED] writes: confFile.close You want ``confFile.close()`` -- the above won't do anything [1]. 'as Footnotes: [1] Best practice would be something like this (don't worry to much about it -- it just ensures the file is properly closed, even if something

Re: How to generalize a function?

2005-04-24 Thread Michael Spencer
Thomas Köllmann wrote: Hi, everybody! I'm teaching myself Python, and I have no experience in programming apart from some years of shell scripting. So, please bear with me. These two funktions are part of an administrative script I've set myself as a first lesson, and, as you will see, they're

Re: How to generalize a function?

2005-04-24 Thread Scott David Daniels
Alexander Schmolck wrote: [1] Best practice would be something like this (don't worry to much about it -- it just ensures the file is properly closed, even if something goes wrong): confFile = None try: confFile = open(networkConf, 'w')