Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ build
*.pyc
swcr.egg-info
swcr.spec
user
*.docx
70 changes: 70 additions & 0 deletions dummy_code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# This is a comment
# Another comment
def hello_world(): # Code line 1
# This is an indented comment
print("Hello, world!") # Code line 2
# Another indented comment

# More comments
# Even more comments

def another_function(): # Code line 3
pass # Code line 4

# Let's add a lot of lines to trigger a page break
# Each of these print statements counts as a line of code

print("Line 5")
print("Line 6")
print("Line 7")
print("Line 8")
print("Line 9")
print("Line 10")
print("Line 11")
print("Line 12")
print("Line 13")
print("Line 14")
print("Line 15")
print("Line 16")
print("Line 17")
print("Line 18")
print("Line 19")
print("Line 20")
print("Line 21")
print("Line 22")
print("Line 23")
print("Line 24")
print("Line 25")
print("Line 26")
print("Line 27")
print("Line 28")
print("Line 29")
print("Line 30")
print("Line 31")
print("Line 32")
print("Line 33")
print("Line 34")
print("Line 35")
print("Line 36")
print("Line 37")
print("Line 38")
print("Line 39")
print("Line 40")
print("Line 41")
print("Line 42")
print("Line 43")
print("Line 44")
print("Line 45")
print("Line 46")
# This is a comment before line 47
print("Line 47")
# This is a comment before line 48
print("Line 48")
# This is a comment before line 49
print("Line 49")
# This is a comment before line 50
print("Line 50")
# This is a comment before line 51
# This should be on the next page
print("Line 51")
print("Line 52")
29 changes: 29 additions & 0 deletions swcr/command.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// 安装click
pip install click

// 安装docx
pip install docx

//在线安装
pip install python-docx

//离线安装
// 下载安装包
https://pypi.org/project/python-docx/#files
python-docx-0.8.11.tar.gz

// 安装
pip install python-docx-0.8.11.tar.gz

// 执行命令,user为目录下的代码文件目录
python swcr.py --title 'DAB蓝牙收音机音箱软件V1.0' --indirs 'user' --exts 'h' 'c' --comment_chars '//' '/*' '*' '*/' --font_name '宋体' --font_size 10.5 --space_before 0.0 --space_after 2.3 --line_spacing 10.5 --outfile 'DAB蓝牙收音机音箱软件V1.0.docx'

python swcr.py --title '固件合并软件V1.0' --indirs 'src' --exts 'h' 'c' --comment_chars '//' '/*' '/**' '*' '*/' --font_name '宋体' --font_size 10.5 --space_before 0.0 --space_after 2.3 --line_spacing 10.5 --outfile '固件合并软件V1.0.docx'
python swcr.py --title '固件合并软件V1.6.3' --indirs 'src' --exts 'h' 'c' --comment_chars '//' '/*' '/**' '*' '*/' --font_name '宋体' --font_size 10.5 --space_before 0.0 --space_after 2.3 --line_spacing 10.5 --outfile '固件合并软件V1.6.3.docx'

python swcr.py --title '软著生成软件V1.0' --indirs 'swcr' --exts 'py' --comment_chars '#' --font_name '宋体' --font_size 10.5 --space_before 0.0 --space_after 2.3 --line_spacing 10.5 --outfile '软著生成软件V1.0.docx'

python swcr.py --title '模拟空中升级软件V1.0.1' --indirs 'user' --exts 'h' 'c' --comment_chars '//' '/*' '/**' '*' '*/' --font_name '宋体' --font_size 10.5 --space_before 0.0 --space_after 2.3 --line_spacing 10.5 --outfile '模拟空中升级软件V1.0.1.docx'

// 打包程序为exe
pyinstaller -i apple.ico -n swcr -F swcr.py --noconsole
Loading