I have a problem while running a newly created shortcut icon on my Desktop.
I used a Script:
from pyshortcuts import make_shortcut
import os
# Define paths
source_file = r"my_path_to_source_code"
icon_path = r"/home/user/icons/myicon.icns"
shortcut_name = "Find"
desktop_folder = os.path.join(os.path.expanduser("~"), "Desktop")
shortcut_path = make_shortcut(source_file, name=shortcut_name, icon=icon_path)
desktop_shortcut_path = os.path.join(desktop_folder, f"{shortcut_name}.lnk")
The code runs all right, the icon gets created on the desktop but after clicking it the Python command prompt shows up for one second and then instantly closes. I also tried to create a shortcut through Powershell but I've got an Error.
Solution: Long story short, the path to python shortcut was using was not matching the path to venv and some packeges were missing. Creating a shortcut to python in venv and adding an argument pointing to a code i wanted to run solved the problem.