简体   繁体   中英

How to store file from .exe in desired folder?

I have a python script, which I have successfully converted to.exe file using pyinstaller. Somehow, the icon doesn't show up, if I could get some help/tip w/ that. It was stored as.icns file as I work on a mac.

Main issue here is, my python script writes a.csv file. When I run the.exe file, the csv saves to the main user folder, and not the same folder as the exe file. How do I solve this? I have tried googling and every other method, but doesn't work.

One solution is to direct to the folder using command-line and then type './file.exe'. But I am really looking for an option, which gets this done by default

While saving the.csv file, you can use os.getcwd()+'/file.csv'. Hope this might help.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM