fixed bugs and added spec file to build an executable on windows

This commit is contained in:
jangxx 2020-04-16 20:35:05 +02:00
parent 1d199bfcfa
commit 5ee303bdce
4 changed files with 39 additions and 4 deletions

4
.gitignore vendored
View File

@ -1,4 +1,6 @@
.vscode
*.txt
*.csv
__pycache__
__pycache__
build/
dist/

View File

@ -58,7 +58,7 @@ def scrape_id(id):
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: scrape.py <id>")
exit(0)
sys.exit(0)
result = scrape_id(sys.argv[1])

View File

@ -3,12 +3,12 @@ import csv, sys, datetime
if len(sys.argv) < 3:
print("Usage: update_list.py <list.txt> <update_file.csv>")
exit(0)
sys.exit(0)
list_filename = sys.argv[1]
update_filename = sys.argv[2]
update_file = open(update_filename, "w+")
update_file = open(update_filename, "a+")
update_file_writer = csv.writer(update_file)
current_time_string = "{0:%Y-%m-%d %H:%M:%S}".format(datetime.datetime.now())

33
update_list.spec Normal file
View File

@ -0,0 +1,33 @@
# -*- mode: python ; coding: utf-8 -*-
block_cipher = None
a = Analysis(['update_list.py'],
pathex=['C:\\Users\\Jan\\Development\\python3\\mintos-scraper'],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=block_cipher,
noarchive=False)
pyz = PYZ(a.pure, a.zipped_data,
cipher=block_cipher)
exe = EXE(pyz,
a.scripts,
a.binaries,
a.zipfiles,
a.datas,
[],
name='update_list',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True )