Skip to content

Commit

Permalink
feat: 添加日志
Browse files Browse the repository at this point in the history
  • Loading branch information
mikumifa committed Apr 17, 2024
1 parent cc9f7b0 commit 68a62da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 0 additions & 4 deletions config.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import logging
import os
import sys





# 获取图标文件的路径
def get_application_path():
if getattr(sys, 'frozen', False):
Expand Down
13 changes: 10 additions & 3 deletions menu/TicketOptions.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import logging
import time
import tkinter as tk
from tkinter import ttk
import logging
import time

from config import cookies_config_path, issue_please_text
from menu.GoodInput import NumberInputApp

from menu.OrderConfig import OrderConfigWindow
from menu.SelectProfileTable import SelectProfileTable
from menu.SelectTicketsTable import TicketBookingApp
Expand Down Expand Up @@ -132,7 +130,9 @@ def __init__(self, master):

# Submit Button
self.submit_button = ttk.Button(master, text="开始", command=self.submit_options)
self.log_button = ttk.Button(master, text="导出日志", command=self.export_log)
self.submit_button.pack(pady=10)
self.log_button.pack(pady=10)

def submit_options(self):
selected_option = self.option_var.get()
Expand All @@ -149,6 +149,13 @@ def submit_options(self):
else:
logging.info("请选择一个选项")

def export_log(self):
with open("log/log.txt", 'r') as file:
log_content = file.read()
with open("log.txt", 'w') as file:
# 将修改后的内容写入文件
file.write(log_content)


if __name__ == "__main__":
root = tk.Tk()
Expand Down

0 comments on commit 68a62da

Please sign in to comment.