Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PyInstaller OneFile
#2
Create a folder ("Resources") in the same folder where the script is

and then change your script (for example)

import os
import sys
mydir = os.path.join(os.path.dirname(sys.argv[0]), "Resources")
excelfile = os.path.join(mydir, "myexcelfile.csv")
if os.path.isfile(excelfile ):
    print("exists") ### to check file exists
    # your code ...
Reply


Messages In This Thread
PyInstaller OneFile - by felixS_zema - Oct-08-2019, 01:43 PM
RE: PyInstaller OneFile - by Axel_Erfurt - Oct-08-2019, 03:29 PM
RE: PyInstaller OneFile - by snippsat - Oct-08-2019, 04:39 PM
RE: PyInstaller OneFile - by felixS_zema - Oct-09-2019, 09:07 AM
RE: PyInstaller OneFile - by felixS_zema - Oct-09-2019, 01:02 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  pyinstaller --onefile mhzr 6 3,282 Jun-24-2021, 05:56 PM
Last Post: Marbelous

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020