Python Forum
data file for .exe program to access
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
data file for .exe program to access
#1
Hello.
My question is hypothetical regarding whether Python would be the correct choice.
I have written a few Python programs being an amateur, that display data that I provide within the program. I compile the program into a standalone .exe. If I want the program to display different data, then I have to include the new data and recompile the .exe program.
My question is, is it possible to write a standalone .exe python program that can access the 'data' not from within the program itself, but from an external data file separate from the program. This way I could make changes to the data file that the program will access without having to recompile the .exe program each time. Im not sure if Python is the right choice here.
thanks for your consideration.
Ose
Reply
#2
Quote:My question is, is it possible to write a standalone .exe python program that can access the 'data' not from within the program itself, but from an external data file separate from the program.

Most all programming languages allow for file access, python included.

So the answer to your question is yes. To see all the methods available, with many examples see:
https://docs.python.org/3/library/filesy...ory-access

Since python is an intrepreted language, you will have to take extra steps to create to an executable, but it's simple enough.
Most scripts are run from the python intrepreter, unless they need to be distributed, and for that there is extensive support.
ose likes this post
Reply
#3
There are several ways,if use sys.argv can call with .exe like this.
C:\> my.exe <arg1> <arg2>
Or use CLI package like eg Click | example

Write a GUI and take data in that way,a simple way is to use Gooey.
See Packaging that is has doc for Pyinstaller.
Pyinstaller is the most used for making .exe is that what you use?

I have long time prosject where i use WxPython drag and drop functionally that it has build in.
So i compile to .exe with pyinstaller,then end user start it which load the GUI.
Then they drag url from browser into GUI and it will start download.
ose likes this post
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Trying to access excel file on our sharepoint server but getting errors cubangt 0 824 Feb-16-2023, 08:11 PM
Last Post: cubangt
  I have written a program that outputs data based on GPS signal kalle 1 1,185 Jul-22-2022, 12:10 AM
Last Post: mcmxl22
  Suggestions for a simple data analysis program t4keheart 0 1,793 Mar-08-2021, 03:45 PM
Last Post: t4keheart
  xml file creation from an XML file template and data from an excel file naji_python 1 2,125 Dec-21-2020, 03:24 PM
Last Post: Gribouillis
  sqlite3 database does not save data across restarting the program SheeppOSU 1 3,458 Jul-24-2020, 05:53 AM
Last Post: SheeppOSU
  How to save CSV file data into the Azure Data Lake Storage Gen2 table? Mangesh121 0 2,117 Jun-26-2020, 11:59 AM
Last Post: Mangesh121
  Making .exe file that requires access to text and html files ClassicalSoul 0 1,587 Apr-23-2020, 05:03 PM
Last Post: ClassicalSoul
  FileNotFoundError: No such file or no access agatte 2 4,965 Sep-12-2019, 08:48 AM
Last Post: agatte
  I can't read data from the clipboard in an external program AlekseyPython 1 2,620 Mar-19-2019, 07:56 AM
Last Post: buran
  How to get all the data for the current month in ms Access using python? aeo03 1 2,318 Nov-07-2018, 08:21 PM
Last Post: micseydel

Forum Jump:

User Panel Messages

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