Home>
Is it possible
pyinstaller
-The turn file
.py.
at
.exe
And then to autorun or through the planner?
Yes, and Bat is superfluous. You can right so, with all the arguments.
GrAnd2021-04-07 18:20:20It is possible, but why such difficulties?
Интик2021-04-07 18:21:16The EXE program with the help of the code itself added to autoload (on Python)
Blex2021-04-07 20:31:35-
Answer # 1
Alternatively, you can check for the presence of just running script in the startup folder, and if it is not there -copy there.
Import OS, SYS Thisfile= sys.argv [0] # full path to the file, including the name and expansion Thisfile_name= os.path.basename (thisfile) # file name without a way user_path= os.path.expanduser ('~') # path to user folder If not os.path.exists (F "{User_Path} \\ AppData \\ Roaming \\ Microsoft \\ Windows \\ Start Menu \\ Programs \\ Startup \\ {thisfile_name}"): OS.System (F'Copy "{thisfile}" "{User_Path} \\ AppData \\ Roaming \\ Microsoft \\ Windows \\ Start Menu \\ Programs \\ Startup" ') Print (f '{thisfile_name} added to autoload')
But it will work only if you have a script compiled in .exe Otherwise, in addition to the script itself, you will need to create .bat or .cmd file in the starter of the startup or .cmd file that will already run the script.
@echo off Python pythoncode.py. EXIT.
Related questions
- python : How can I change the binary picture code?
- Automatic viewing video Python + Selenium
- python : As a column from XLSX to turn into data recorded through the comma, in TXT
- Why is the variable from another file does not work in the function of the second file? Python
- python : Why I can't generate dictionaries with such generators
- python : Status Machine on PyQT5
- python : Pandas Column List Amount
- python : The problem with switching windows on PyQT5
- Problem with relative imports in Python
- python : Checking the subprocess.popen from the .poll () functions but after which I scream external .exe get none
Do you definitely exe? And what if Bat, which will hang in autorun and in the scheduler?
Konstantin Fedorov2021-04-08 17:55:20