Skip to content

Commit

Permalink
Update open.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KorryKatti committed Apr 8, 2024
1 parent 4bdea6d commit bfebe32
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions open.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,10 @@ def activate_venv(directory):

# Function to run main.py or updater.py using the Python interpreter from the virtual environment
def run_script_py(venv_directory, script_name):
if os.name == 'nt':
activate_command = activate_venv(venv_directory)
script_path = f"{script_name}.py"
subprocess.run(f"{activate_command} && python {script_path}", shell=True)
else:
python_executable = os.path.join(venv_directory, "bin", "python")
script_path = f"{script_name}.py"
subprocess.run([python_executable, script_path])
python_executable = os.path.join(venv_directory, "bin", "python" if os.name != 'nt' else "Scripts", "python")
script_path = f"{script_name}.py"
subprocess.run([python_executable, script_path])



def main():
Expand Down

0 comments on commit bfebe32

Please sign in to comment.