I am about to start a medium to large project, maybe not to others but to me, and I am curious as to how other people name their files and split the scripts into multiple files. I was thinking each class would be a file but I am not sold on the idea. Since I am still newer to Python I am looking for opinions and input and realize there may not be a "right" way to do it.
File naming and splitting
Page 1 of 11 Replies - 325 Views - Last Post: 27 August 2012 - 02:20 PM
Replies To: File naming and splitting
#2
Re: File naming and splitting
Posted 27 August 2012 - 02:20 PM
You could have on Python file be your library, a collection of smaller, commonly used functions, another being your main program, and the others could be collections of similar functions.
Ex: I have power_management.py, my main script.
I have power_libs.py, a group of misc. functions I use in power_management.py.
I have power_data_parse.py, a group of custom data parsing functions I've made.
I have power_logging.py, a group of logging tools.
and so on. You can call each function from your main program, making your main code more tidy and easier to read.
Hope this helps, good luck on your project.
-Dennis
Ex: I have power_management.py, my main script.
I have power_libs.py, a group of misc. functions I use in power_management.py.
I have power_data_parse.py, a group of custom data parsing functions I've made.
I have power_logging.py, a group of logging tools.
and so on. You can call each function from your main program, making your main code more tidy and easier to read.
Hope this helps, good luck on your project.
-Dennis
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|