from multiprocessing import Process
class CustomProcess(Process):
def __init__(self):
super().__init__()
def __enter__(self):
return self
def __exit__(self, exc_type, exc_val, exc_tb):
print(exc_type, exc_val, exc_tb)
print("Посмертное действие")
if __name__ == '__main__':
with CustomProcess() as process:
raise Exception("Some Value")
from PyQt5.QtWidgets import QApplication, QLabel
app = QApplication([])
# This is a requirement of Qt: Every GUI app must have exactly one instance of QApplication.
# Many parts of Qt don't work until you have executed the above line.
# You will therefore need it in virtually every (Py)Qt app you write.
# The brackets [] in the above line represent the command line arguments passed to the application.
# Because our app doesn't use any parameters, we leave the brackets empty.
label = QLabel('Hello World!')
label.show()
app.exec()
autor
создается новый процесс.autor
autor
if __name__ == '__main__':
и создают процессы уже там, чтобы не возникало рекурсии. from multiprocessing import Process
def drop(URL,cardcvc,size1,MIDDLENAME,proxy,MAIL,PASS):
###some_code
print('something')
###some_code
def autor():
###some code
mm={'something':'something'}
for mal in mm:
Process(target = drop,args=(urlg,cvvg,size1,mid,proxy,mal,mm[mal])).start()
if __name__ == '__main__':
autor()
SET link = '%s'
WHERE id = '%s'
create_connection_mysql_db('localhost',
а почему localhost?Я поместил код в exe, но это защищает только сам код
Я поместил код в exe
date_object = datetime.strptime(date_string, "%I:%M %p %Z")
ET.ElementTree(data).write("xml.xml")
<yml_catalog><offer><name>имя abc</name></offer></yml_catalog>
ET.ElementTree(data).write("xml.xml", encoding='UTF-8')
<yml_catalog><offer><name>имя abc</name></offer></yml_catalog>