Skip to content

Instantly share code, notes, and snippets.

View Shrestha7's full-sized avatar
:octocat:
Working from home

Swastik Shrestha Shrestha7

:octocat:
Working from home
View GitHub Profile
@Shrestha7
Shrestha7 / main.py
Created April 9, 2023 15:33
To add a .env file outside the .exe file when using PyInstaller, you can use the --add-data option to include the .env file in the distribution. Assuming that your .env file is located in the root directory of your project, and you want to include it in the same directory as the PyInstaller-generated .exe file, you can use the following command:
pyinstaller --add-data=".env;." myscript.py
# This command tells PyInstaller to include the .env file in the distribution, and to place it in the same directory as the .exe file.
# Note that the --add-data option takes two arguments separated by a semicolon: the first argument is the path to the .env file, and the second argument is the destination directory for the file. In this case, the destination directory is the current directory, denoted by the . symbol.
# After running this command, PyInstaller will generate a new directory containing the .exe file and the .env file, as well as any other necessary files for your script to run.
@DomPizzie
DomPizzie / README-Template.md
Last active June 25, 2024 18:20
A simple README.md template

Project Title

Simple overview of use/purpose.

Description

An in-depth paragraph about your project and overview of use.

Getting Started