Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../lib64/python3..../tkinter
File: filedialog.py
"""File selection dialog classes.
[0] Fix | Delete
[1] Fix | Delete
Classes:
[2] Fix | Delete
[3] Fix | Delete
- FileDialog
[4] Fix | Delete
- LoadFileDialog
[5] Fix | Delete
- SaveFileDialog
[6] Fix | Delete
[7] Fix | Delete
This module also presents tk common file dialogues, it provides interfaces
[8] Fix | Delete
to the native file dialogues available in Tk 4.2 and newer, and the
[9] Fix | Delete
directory dialogue available in Tk 8.3 and newer.
[10] Fix | Delete
These interfaces were written by Fredrik Lundh, May 1997.
[11] Fix | Delete
"""
[12] Fix | Delete
[13] Fix | Delete
from tkinter import *
[14] Fix | Delete
from tkinter.dialog import Dialog
[15] Fix | Delete
from tkinter import commondialog
[16] Fix | Delete
from tkinter.simpledialog import _setup_dialog
[17] Fix | Delete
[18] Fix | Delete
import os
[19] Fix | Delete
import fnmatch
[20] Fix | Delete
[21] Fix | Delete
[22] Fix | Delete
dialogstates = {}
[23] Fix | Delete
[24] Fix | Delete
[25] Fix | Delete
class FileDialog:
[26] Fix | Delete
[27] Fix | Delete
"""Standard file selection dialog -- no checks on selected file.
[28] Fix | Delete
[29] Fix | Delete
Usage:
[30] Fix | Delete
[31] Fix | Delete
d = FileDialog(master)
[32] Fix | Delete
fname = d.go(dir_or_file, pattern, default, key)
[33] Fix | Delete
if fname is None: ...canceled...
[34] Fix | Delete
else: ...open file...
[35] Fix | Delete
[36] Fix | Delete
All arguments to go() are optional.
[37] Fix | Delete
[38] Fix | Delete
The 'key' argument specifies a key in the global dictionary
[39] Fix | Delete
'dialogstates', which keeps track of the values for the directory
[40] Fix | Delete
and pattern arguments, overriding the values passed in (it does
[41] Fix | Delete
not keep track of the default argument!). If no key is specified,
[42] Fix | Delete
the dialog keeps no memory of previous state. Note that memory is
[43] Fix | Delete
kept even when the dialog is canceled. (All this emulates the
[44] Fix | Delete
behavior of the Macintosh file selection dialogs.)
[45] Fix | Delete
[46] Fix | Delete
"""
[47] Fix | Delete
[48] Fix | Delete
title = "File Selection Dialog"
[49] Fix | Delete
[50] Fix | Delete
def __init__(self, master, title=None):
[51] Fix | Delete
if title is None: title = self.title
[52] Fix | Delete
self.master = master
[53] Fix | Delete
self.directory = None
[54] Fix | Delete
[55] Fix | Delete
self.top = Toplevel(master)
[56] Fix | Delete
self.top.title(title)
[57] Fix | Delete
self.top.iconname(title)
[58] Fix | Delete
_setup_dialog(self.top)
[59] Fix | Delete
[60] Fix | Delete
self.botframe = Frame(self.top)
[61] Fix | Delete
self.botframe.pack(side=BOTTOM, fill=X)
[62] Fix | Delete
[63] Fix | Delete
self.selection = Entry(self.top)
[64] Fix | Delete
self.selection.pack(side=BOTTOM, fill=X)
[65] Fix | Delete
self.selection.bind('<Return>', self.ok_event)
[66] Fix | Delete
[67] Fix | Delete
self.filter = Entry(self.top)
[68] Fix | Delete
self.filter.pack(side=TOP, fill=X)
[69] Fix | Delete
self.filter.bind('<Return>', self.filter_command)
[70] Fix | Delete
[71] Fix | Delete
self.midframe = Frame(self.top)
[72] Fix | Delete
self.midframe.pack(expand=YES, fill=BOTH)
[73] Fix | Delete
[74] Fix | Delete
self.filesbar = Scrollbar(self.midframe)
[75] Fix | Delete
self.filesbar.pack(side=RIGHT, fill=Y)
[76] Fix | Delete
self.files = Listbox(self.midframe, exportselection=0,
[77] Fix | Delete
yscrollcommand=(self.filesbar, 'set'))
[78] Fix | Delete
self.files.pack(side=RIGHT, expand=YES, fill=BOTH)
[79] Fix | Delete
btags = self.files.bindtags()
[80] Fix | Delete
self.files.bindtags(btags[1:] + btags[:1])
[81] Fix | Delete
self.files.bind('<ButtonRelease-1>', self.files_select_event)
[82] Fix | Delete
self.files.bind('<Double-ButtonRelease-1>', self.files_double_event)
[83] Fix | Delete
self.filesbar.config(command=(self.files, 'yview'))
[84] Fix | Delete
[85] Fix | Delete
self.dirsbar = Scrollbar(self.midframe)
[86] Fix | Delete
self.dirsbar.pack(side=LEFT, fill=Y)
[87] Fix | Delete
self.dirs = Listbox(self.midframe, exportselection=0,
[88] Fix | Delete
yscrollcommand=(self.dirsbar, 'set'))
[89] Fix | Delete
self.dirs.pack(side=LEFT, expand=YES, fill=BOTH)
[90] Fix | Delete
self.dirsbar.config(command=(self.dirs, 'yview'))
[91] Fix | Delete
btags = self.dirs.bindtags()
[92] Fix | Delete
self.dirs.bindtags(btags[1:] + btags[:1])
[93] Fix | Delete
self.dirs.bind('<ButtonRelease-1>', self.dirs_select_event)
[94] Fix | Delete
self.dirs.bind('<Double-ButtonRelease-1>', self.dirs_double_event)
[95] Fix | Delete
[96] Fix | Delete
self.ok_button = Button(self.botframe,
[97] Fix | Delete
text="OK",
[98] Fix | Delete
command=self.ok_command)
[99] Fix | Delete
self.ok_button.pack(side=LEFT)
[100] Fix | Delete
self.filter_button = Button(self.botframe,
[101] Fix | Delete
text="Filter",
[102] Fix | Delete
command=self.filter_command)
[103] Fix | Delete
self.filter_button.pack(side=LEFT, expand=YES)
[104] Fix | Delete
self.cancel_button = Button(self.botframe,
[105] Fix | Delete
text="Cancel",
[106] Fix | Delete
command=self.cancel_command)
[107] Fix | Delete
self.cancel_button.pack(side=RIGHT)
[108] Fix | Delete
[109] Fix | Delete
self.top.protocol('WM_DELETE_WINDOW', self.cancel_command)
[110] Fix | Delete
# XXX Are the following okay for a general audience?
[111] Fix | Delete
self.top.bind('<Alt-w>', self.cancel_command)
[112] Fix | Delete
self.top.bind('<Alt-W>', self.cancel_command)
[113] Fix | Delete
[114] Fix | Delete
def go(self, dir_or_file=os.curdir, pattern="*", default="", key=None):
[115] Fix | Delete
if key and key in dialogstates:
[116] Fix | Delete
self.directory, pattern = dialogstates[key]
[117] Fix | Delete
else:
[118] Fix | Delete
dir_or_file = os.path.expanduser(dir_or_file)
[119] Fix | Delete
if os.path.isdir(dir_or_file):
[120] Fix | Delete
self.directory = dir_or_file
[121] Fix | Delete
else:
[122] Fix | Delete
self.directory, default = os.path.split(dir_or_file)
[123] Fix | Delete
self.set_filter(self.directory, pattern)
[124] Fix | Delete
self.set_selection(default)
[125] Fix | Delete
self.filter_command()
[126] Fix | Delete
self.selection.focus_set()
[127] Fix | Delete
self.top.wait_visibility() # window needs to be visible for the grab
[128] Fix | Delete
self.top.grab_set()
[129] Fix | Delete
self.how = None
[130] Fix | Delete
self.master.mainloop() # Exited by self.quit(how)
[131] Fix | Delete
if key:
[132] Fix | Delete
directory, pattern = self.get_filter()
[133] Fix | Delete
if self.how:
[134] Fix | Delete
directory = os.path.dirname(self.how)
[135] Fix | Delete
dialogstates[key] = directory, pattern
[136] Fix | Delete
self.top.destroy()
[137] Fix | Delete
return self.how
[138] Fix | Delete
[139] Fix | Delete
def quit(self, how=None):
[140] Fix | Delete
self.how = how
[141] Fix | Delete
self.master.quit() # Exit mainloop()
[142] Fix | Delete
[143] Fix | Delete
def dirs_double_event(self, event):
[144] Fix | Delete
self.filter_command()
[145] Fix | Delete
[146] Fix | Delete
def dirs_select_event(self, event):
[147] Fix | Delete
dir, pat = self.get_filter()
[148] Fix | Delete
subdir = self.dirs.get('active')
[149] Fix | Delete
dir = os.path.normpath(os.path.join(self.directory, subdir))
[150] Fix | Delete
self.set_filter(dir, pat)
[151] Fix | Delete
[152] Fix | Delete
def files_double_event(self, event):
[153] Fix | Delete
self.ok_command()
[154] Fix | Delete
[155] Fix | Delete
def files_select_event(self, event):
[156] Fix | Delete
file = self.files.get('active')
[157] Fix | Delete
self.set_selection(file)
[158] Fix | Delete
[159] Fix | Delete
def ok_event(self, event):
[160] Fix | Delete
self.ok_command()
[161] Fix | Delete
[162] Fix | Delete
def ok_command(self):
[163] Fix | Delete
self.quit(self.get_selection())
[164] Fix | Delete
[165] Fix | Delete
def filter_command(self, event=None):
[166] Fix | Delete
dir, pat = self.get_filter()
[167] Fix | Delete
try:
[168] Fix | Delete
names = os.listdir(dir)
[169] Fix | Delete
except OSError:
[170] Fix | Delete
self.master.bell()
[171] Fix | Delete
return
[172] Fix | Delete
self.directory = dir
[173] Fix | Delete
self.set_filter(dir, pat)
[174] Fix | Delete
names.sort()
[175] Fix | Delete
subdirs = [os.pardir]
[176] Fix | Delete
matchingfiles = []
[177] Fix | Delete
for name in names:
[178] Fix | Delete
fullname = os.path.join(dir, name)
[179] Fix | Delete
if os.path.isdir(fullname):
[180] Fix | Delete
subdirs.append(name)
[181] Fix | Delete
elif fnmatch.fnmatch(name, pat):
[182] Fix | Delete
matchingfiles.append(name)
[183] Fix | Delete
self.dirs.delete(0, END)
[184] Fix | Delete
for name in subdirs:
[185] Fix | Delete
self.dirs.insert(END, name)
[186] Fix | Delete
self.files.delete(0, END)
[187] Fix | Delete
for name in matchingfiles:
[188] Fix | Delete
self.files.insert(END, name)
[189] Fix | Delete
head, tail = os.path.split(self.get_selection())
[190] Fix | Delete
if tail == os.curdir: tail = ''
[191] Fix | Delete
self.set_selection(tail)
[192] Fix | Delete
[193] Fix | Delete
def get_filter(self):
[194] Fix | Delete
filter = self.filter.get()
[195] Fix | Delete
filter = os.path.expanduser(filter)
[196] Fix | Delete
if filter[-1:] == os.sep or os.path.isdir(filter):
[197] Fix | Delete
filter = os.path.join(filter, "*")
[198] Fix | Delete
return os.path.split(filter)
[199] Fix | Delete
[200] Fix | Delete
def get_selection(self):
[201] Fix | Delete
file = self.selection.get()
[202] Fix | Delete
file = os.path.expanduser(file)
[203] Fix | Delete
return file
[204] Fix | Delete
[205] Fix | Delete
def cancel_command(self, event=None):
[206] Fix | Delete
self.quit()
[207] Fix | Delete
[208] Fix | Delete
def set_filter(self, dir, pat):
[209] Fix | Delete
if not os.path.isabs(dir):
[210] Fix | Delete
try:
[211] Fix | Delete
pwd = os.getcwd()
[212] Fix | Delete
except OSError:
[213] Fix | Delete
pwd = None
[214] Fix | Delete
if pwd:
[215] Fix | Delete
dir = os.path.join(pwd, dir)
[216] Fix | Delete
dir = os.path.normpath(dir)
[217] Fix | Delete
self.filter.delete(0, END)
[218] Fix | Delete
self.filter.insert(END, os.path.join(dir or os.curdir, pat or "*"))
[219] Fix | Delete
[220] Fix | Delete
def set_selection(self, file):
[221] Fix | Delete
self.selection.delete(0, END)
[222] Fix | Delete
self.selection.insert(END, os.path.join(self.directory, file))
[223] Fix | Delete
[224] Fix | Delete
[225] Fix | Delete
class LoadFileDialog(FileDialog):
[226] Fix | Delete
[227] Fix | Delete
"""File selection dialog which checks that the file exists."""
[228] Fix | Delete
[229] Fix | Delete
title = "Load File Selection Dialog"
[230] Fix | Delete
[231] Fix | Delete
def ok_command(self):
[232] Fix | Delete
file = self.get_selection()
[233] Fix | Delete
if not os.path.isfile(file):
[234] Fix | Delete
self.master.bell()
[235] Fix | Delete
else:
[236] Fix | Delete
self.quit(file)
[237] Fix | Delete
[238] Fix | Delete
[239] Fix | Delete
class SaveFileDialog(FileDialog):
[240] Fix | Delete
[241] Fix | Delete
"""File selection dialog which checks that the file may be created."""
[242] Fix | Delete
[243] Fix | Delete
title = "Save File Selection Dialog"
[244] Fix | Delete
[245] Fix | Delete
def ok_command(self):
[246] Fix | Delete
file = self.get_selection()
[247] Fix | Delete
if os.path.exists(file):
[248] Fix | Delete
if os.path.isdir(file):
[249] Fix | Delete
self.master.bell()
[250] Fix | Delete
return
[251] Fix | Delete
d = Dialog(self.top,
[252] Fix | Delete
title="Overwrite Existing File Question",
[253] Fix | Delete
text="Overwrite existing file %r?" % (file,),
[254] Fix | Delete
bitmap='questhead',
[255] Fix | Delete
default=1,
[256] Fix | Delete
strings=("Yes", "Cancel"))
[257] Fix | Delete
if d.num != 0:
[258] Fix | Delete
return
[259] Fix | Delete
else:
[260] Fix | Delete
head, tail = os.path.split(file)
[261] Fix | Delete
if not os.path.isdir(head):
[262] Fix | Delete
self.master.bell()
[263] Fix | Delete
return
[264] Fix | Delete
self.quit(file)
[265] Fix | Delete
[266] Fix | Delete
[267] Fix | Delete
# For the following classes and modules:
[268] Fix | Delete
#
[269] Fix | Delete
# options (all have default values):
[270] Fix | Delete
#
[271] Fix | Delete
# - defaultextension: added to filename if not explicitly given
[272] Fix | Delete
#
[273] Fix | Delete
# - filetypes: sequence of (label, pattern) tuples. the same pattern
[274] Fix | Delete
# may occur with several patterns. use "*" as pattern to indicate
[275] Fix | Delete
# all files.
[276] Fix | Delete
#
[277] Fix | Delete
# - initialdir: initial directory. preserved by dialog instance.
[278] Fix | Delete
#
[279] Fix | Delete
# - initialfile: initial file (ignored by the open dialog). preserved
[280] Fix | Delete
# by dialog instance.
[281] Fix | Delete
#
[282] Fix | Delete
# - parent: which window to place the dialog on top of
[283] Fix | Delete
#
[284] Fix | Delete
# - title: dialog title
[285] Fix | Delete
#
[286] Fix | Delete
# - multiple: if true user may select more than one file
[287] Fix | Delete
#
[288] Fix | Delete
# options for the directory chooser:
[289] Fix | Delete
#
[290] Fix | Delete
# - initialdir, parent, title: see above
[291] Fix | Delete
#
[292] Fix | Delete
# - mustexist: if true, user must pick an existing directory
[293] Fix | Delete
#
[294] Fix | Delete
[295] Fix | Delete
[296] Fix | Delete
class _Dialog(commondialog.Dialog):
[297] Fix | Delete
[298] Fix | Delete
def _fixoptions(self):
[299] Fix | Delete
try:
[300] Fix | Delete
# make sure "filetypes" is a tuple
[301] Fix | Delete
self.options["filetypes"] = tuple(self.options["filetypes"])
[302] Fix | Delete
except KeyError:
[303] Fix | Delete
pass
[304] Fix | Delete
[305] Fix | Delete
def _fixresult(self, widget, result):
[306] Fix | Delete
if result:
[307] Fix | Delete
# keep directory and filename until next time
[308] Fix | Delete
# convert Tcl path objects to strings
[309] Fix | Delete
try:
[310] Fix | Delete
result = result.string
[311] Fix | Delete
except AttributeError:
[312] Fix | Delete
# it already is a string
[313] Fix | Delete
pass
[314] Fix | Delete
path, file = os.path.split(result)
[315] Fix | Delete
self.options["initialdir"] = path
[316] Fix | Delete
self.options["initialfile"] = file
[317] Fix | Delete
self.filename = result # compatibility
[318] Fix | Delete
return result
[319] Fix | Delete
[320] Fix | Delete
[321] Fix | Delete
#
[322] Fix | Delete
# file dialogs
[323] Fix | Delete
[324] Fix | Delete
class Open(_Dialog):
[325] Fix | Delete
"Ask for a filename to open"
[326] Fix | Delete
[327] Fix | Delete
command = "tk_getOpenFile"
[328] Fix | Delete
[329] Fix | Delete
def _fixresult(self, widget, result):
[330] Fix | Delete
if isinstance(result, tuple):
[331] Fix | Delete
# multiple results:
[332] Fix | Delete
result = tuple([getattr(r, "string", r) for r in result])
[333] Fix | Delete
if result:
[334] Fix | Delete
path, file = os.path.split(result[0])
[335] Fix | Delete
self.options["initialdir"] = path
[336] Fix | Delete
# don't set initialfile or filename, as we have multiple of these
[337] Fix | Delete
return result
[338] Fix | Delete
if not widget.tk.wantobjects() and "multiple" in self.options:
[339] Fix | Delete
# Need to split result explicitly
[340] Fix | Delete
return self._fixresult(widget, widget.tk.splitlist(result))
[341] Fix | Delete
return _Dialog._fixresult(self, widget, result)
[342] Fix | Delete
[343] Fix | Delete
[344] Fix | Delete
class SaveAs(_Dialog):
[345] Fix | Delete
"Ask for a filename to save as"
[346] Fix | Delete
[347] Fix | Delete
command = "tk_getSaveFile"
[348] Fix | Delete
[349] Fix | Delete
[350] Fix | Delete
# the directory dialog has its own _fix routines.
[351] Fix | Delete
class Directory(commondialog.Dialog):
[352] Fix | Delete
"Ask for a directory"
[353] Fix | Delete
[354] Fix | Delete
command = "tk_chooseDirectory"
[355] Fix | Delete
[356] Fix | Delete
def _fixresult(self, widget, result):
[357] Fix | Delete
if result:
[358] Fix | Delete
# convert Tcl path objects to strings
[359] Fix | Delete
try:
[360] Fix | Delete
result = result.string
[361] Fix | Delete
except AttributeError:
[362] Fix | Delete
# it already is a string
[363] Fix | Delete
pass
[364] Fix | Delete
# keep directory until next time
[365] Fix | Delete
self.options["initialdir"] = result
[366] Fix | Delete
self.directory = result # compatibility
[367] Fix | Delete
return result
[368] Fix | Delete
[369] Fix | Delete
#
[370] Fix | Delete
# convenience stuff
[371] Fix | Delete
[372] Fix | Delete
[373] Fix | Delete
def askopenfilename(**options):
[374] Fix | Delete
"Ask for a filename to open"
[375] Fix | Delete
[376] Fix | Delete
return Open(**options).show()
[377] Fix | Delete
[378] Fix | Delete
[379] Fix | Delete
def asksaveasfilename(**options):
[380] Fix | Delete
"Ask for a filename to save as"
[381] Fix | Delete
[382] Fix | Delete
return SaveAs(**options).show()
[383] Fix | Delete
[384] Fix | Delete
[385] Fix | Delete
def askopenfilenames(**options):
[386] Fix | Delete
"""Ask for multiple filenames to open
[387] Fix | Delete
[388] Fix | Delete
Returns a list of filenames or empty list if
[389] Fix | Delete
cancel button selected
[390] Fix | Delete
"""
[391] Fix | Delete
options["multiple"]=1
[392] Fix | Delete
return Open(**options).show()
[393] Fix | Delete
[394] Fix | Delete
# FIXME: are the following perhaps a bit too convenient?
[395] Fix | Delete
[396] Fix | Delete
[397] Fix | Delete
def askopenfile(mode = "r", **options):
[398] Fix | Delete
"Ask for a filename to open, and returned the opened file"
[399] Fix | Delete
[400] Fix | Delete
filename = Open(**options).show()
[401] Fix | Delete
if filename:
[402] Fix | Delete
return open(filename, mode)
[403] Fix | Delete
return None
[404] Fix | Delete
[405] Fix | Delete
[406] Fix | Delete
def askopenfiles(mode = "r", **options):
[407] Fix | Delete
"""Ask for multiple filenames and return the open file
[408] Fix | Delete
objects
[409] Fix | Delete
[410] Fix | Delete
returns a list of open file objects or an empty list if
[411] Fix | Delete
cancel selected
[412] Fix | Delete
"""
[413] Fix | Delete
[414] Fix | Delete
files = askopenfilenames(**options)
[415] Fix | Delete
if files:
[416] Fix | Delete
ofiles=[]
[417] Fix | Delete
for filename in files:
[418] Fix | Delete
ofiles.append(open(filename, mode))
[419] Fix | Delete
files=ofiles
[420] Fix | Delete
return files
[421] Fix | Delete
[422] Fix | Delete
[423] Fix | Delete
def asksaveasfile(mode = "w", **options):
[424] Fix | Delete
"Ask for a filename to save as, and returned the opened file"
[425] Fix | Delete
[426] Fix | Delete
filename = SaveAs(**options).show()
[427] Fix | Delete
if filename:
[428] Fix | Delete
return open(filename, mode)
[429] Fix | Delete
return None
[430] Fix | Delete
[431] Fix | Delete
[432] Fix | Delete
def askdirectory (**options):
[433] Fix | Delete
"Ask for a directory, and return the file name"
[434] Fix | Delete
return Directory(**options).show()
[435] Fix | Delete
[436] Fix | Delete
[437] Fix | Delete
# --------------------------------------------------------------------
[438] Fix | Delete
# test stuff
[439] Fix | Delete
[440] Fix | Delete
def test():
[441] Fix | Delete
"""Simple test program."""
[442] Fix | Delete
root = Tk()
[443] Fix | Delete
root.withdraw()
[444] Fix | Delete
fd = LoadFileDialog(root)
[445] Fix | Delete
loadfile = fd.go(key="test")
[446] Fix | Delete
fd = SaveFileDialog(root)
[447] Fix | Delete
savefile = fd.go(key="test")
[448] Fix | Delete
print(loadfile, savefile)
[449] Fix | Delete
[450] Fix | Delete
# Since the file name may contain non-ASCII characters, we need
[451] Fix | Delete
# to find an encoding that likely supports the file name, and
[452] Fix | Delete
# displays correctly on the terminal.
[453] Fix | Delete
[454] Fix | Delete
# Start off with UTF-8
[455] Fix | Delete
enc = "utf-8"
[456] Fix | Delete
import sys
[457] Fix | Delete
[458] Fix | Delete
# See whether CODESET is defined
[459] Fix | Delete
try:
[460] Fix | Delete
import locale
[461] Fix | Delete
locale.setlocale(locale.LC_ALL,'')
[462] Fix | Delete
enc = locale.nl_langinfo(locale.CODESET)
[463] Fix | Delete
except (ImportError, AttributeError):
[464] Fix | Delete
pass
[465] Fix | Delete
[466] Fix | Delete
# dialog for opening files
[467] Fix | Delete
[468] Fix | Delete
openfilename=askopenfilename(filetypes=[("all files", "*")])
[469] Fix | Delete
try:
[470] Fix | Delete
fp=open(openfilename,"r")
[471] Fix | Delete
fp.close()
[472] Fix | Delete
except:
[473] Fix | Delete
print("Could not open File: ")
[474] Fix | Delete
print(sys.exc_info()[1])
[475] Fix | Delete
[476] Fix | Delete
print("open", openfilename.encode(enc))
[477] Fix | Delete
[478] Fix | Delete
# dialog for saving files
[479] Fix | Delete
[480] Fix | Delete
saveasfilename=asksaveasfilename()
[481] Fix | Delete
print("saveas", saveasfilename.encode(enc))
[482] Fix | Delete
[483] Fix | Delete
[484] Fix | Delete
if __name__ == '__main__':
[485] Fix | Delete
test()
[486] Fix | Delete
[487] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function