Run compiled python .exe with a file as input

Wealot

So I made a program in Python and compiled it to .exe. This works fine. What I want is to be able to double click files I created (say with text in them) and open those files with the .exe I compiled and then do something with the files as input.

I figured one way to do this might be to at least get the exact location of the file that is being opened with the .exe so as a first test something like this:

.exe file:

get_location = dirname(realpath(My_Clicked_File))
print get_location

The file clicked will be some random extension so .test or something I made up.

Daniel Roseman

If you've associated your file extension with your exe, when you double-click on the file its full file path will be passed as the first argument, which you can get from sys.argv in your script.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Run a compiled batch file (exe) file through a batch file

From Dev

Run an input file using an exe file with cmd

From Dev

How to run a .pyc (compiled python) file?

From Dev

How to run a .pyc (compiled python) file?

From Dev

How to Run an .exe File in Python

From Dev

Read config.py file from a compiled python .exe script

From Dev

Reuse of characters in compiled .exe file

From Dev

Run .exe file via Python as Administrator

From Dev

How to run/execute exe file in python?

From Dev

Open an .exe file and give it input parameters in Python

From Dev

How to run exe file from python script converted to exe

From Dev

Compiled batch file run fullscreen

From Dev

Compiled batch file run fullscreen

From Dev

add manifest to compiled exe file from jar

From Dev

Need to run .exe file for 7 seconds and then kill the exe while performing input and output in text files

From Dev

Need to run .exe file for 7 seconds and then kill the exe while performing input and output in text files

From Dev

Run an .exe file on apache?

From Dev

Run a file .exe in Laravel

From Dev

How to get python script file path that has been compiled in binary .exe?

From Dev

how to run both a .py and a .exe file from the same python script

From Dev

Use Python to run a .exe file in Windows Command Prompt

From Dev

how to run a compiled CPP file with geany

From Dev

python - compiled calling config file

From Dev

How do I run a python file that takes a text file as input?

From Dev

How to run .exe/.bat file with INPUT/OUTPUT in Progress 4GL

From Dev

run exe file on apache server

From Dev

Ansible run remote exe file

From Dev

Run a file within exe with vbs

From Dev

It is possible to run a Exe file in RedHat

Related Related

HotTag

Archive