def Result(self)->str: if sys.platform == "win32" or sys.platform == "cygwin": DownloadFolderLocation = GetRootFileLocation().Result() + "\\Web\\Download\\" return DownloadFolderLocation elif sys.platform == "linux" or sys.platform == "darwin": DownloadFolderLocation = GetRootFileLocation().Result() + "/Web/Download/" return DownloadFolderLocation
def Result(self)->str: if sys.platform == "win32" or sys.platform == "cygwin": TemplateFolderLocation = GetRootFileLocation().Result() + "\\Web\\Template\\" return TemplateFolderLocation elif sys.platform == "linux" or sys.platform == "darwin": TemplateFolderLocation = GetRootFileLocation().Result() + "/Web/Template/" return TemplateFolderLocation
def SubdomainWriteFile(TargetName,WriteFileUnixTimestamp,Subdomain):#写到文本中 FilePath="" FileName = time.strftime("%Y-%m-%d", time.localtime()) + "_" + TargetName +"_Subdomain_"+ WriteFileUnixTimestamp if sys.platform == "win32" or sys.platform == "cygwin": FilePath = GetRootFileLocation().Result() + "\\ScanResult\\" + FileName + ".txt" # 不需要输入后缀,只要名字就好 elif sys.platform == "linux" or sys.platform == "darwin": FilePath = GetRootFileLocation().Result() + "/ScanResult/" + FileName + ".txt" # 不需要输入后缀,只要名字就好 with open(FilePath, 'a+', encoding='utf-8') as f: # 如果filename不存在会自动创建, 'w'表示写数据,写之前会清空文件中的原有数据! f.write(Subdomain + "\n")