I really need an updated answer for this question. I want to convert the script into an executable that runs when I'd double click it. Some procedures, available online since last two-three years, are not working. I have just one script that's utilizing selenium and Geckodriver. The response I get against "which python3" is
So kindly give answer if you've had yourself performed such a task in last few months.
您可以使用在 Mac 上运行的 PyInstaller 来生成可执行文件。
PyInstaller didn't work in my case. Maybe it'd work on someone else's system. So, I went the simple "chmod" way and converted the python file into an executable. These were the steps:
which python3
and copy-pasted the result at the start of my python script, preceded with #!
.command
chmod +x fileName.command
(755 instead of +x works too)So, this is how I made my python file executable. There are other solutions too, but this one worked for me and is also simpler.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.