目前我有一個python腳本(proofreader.py),可以幫助我讀取文本文件,從多種校對方法中進行處理,並將校正後的測試結果輸出到文件中。適合大型python腳本的佈局
但是該腳本非常冗長,例如> 1000行代碼,所以我想更好地組織它,並在未來更好地重用。
當前結構:proofreader.py
def main(argv)
..
def read_text_file():
def proofreading_method_1():
def proofreading_method_2():
def proofreading_method_3():
..
def common_string_function_1():
def common_string_function_2():
def common_string_function_3():
..
def write_text_file():
任何人都可以提出這個項目(校對)一個適當的佈局?
據:http://jcalderone.livejournal.com/39794.html,我想出了以下各項:
Proofreader/
|-- bin/
| |-- proofreader (The python script with the .py extension)
|
|-- proofreader/
| |-- test/
| | |-- __init__.py
| | |-- test_main.py
| |
| |-- __init__.py
| |-- main.py
| |-- proofreading.py (class for proofreading methods)
| |-- stringutil.py (class for frequently used string methods)
|
|-- setup.py
|-- README
上述建議的任何問題?