1 Replies - 639 Views - Last Post: 27 August 2012 - 02:20 PM Rate Topic: -----

#1 blank_program   User is offline

  • D.I.C Regular
  • member icon

Reputation: 11
  • View blog
  • Posts: 292
  • Joined: 22-July 09

File naming and splitting

Posted 27 August 2012 - 01:57 PM

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.
Is This A Good Question/Topic? 0
  • +

Replies To: File naming and splitting

#2 den510   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 22-August 12

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.

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1