I have some custom text editor with multitabs logic, created with Python3 and PyQt5. I want to open txt-files in this editor with double click and I want to add new tab in my editor each time when I do double-click on file. I added batch, with calls 'python editor.py', when I click on txt. Thats OK, but instead of open new tab in current IDE it always start new python process and open new IDE. I want to make it work on Win10. How to make logic to add new tab to current editor? Probably I don't even need new python process, if my editor is already running.
Asked
Active
Viewed 121 times
0
-
The first step is to ensure only a single instance of your program is running. You an try a lock file or try to connect to a TCP port. Perpaps this last option is the best because then you can command the running program to open the file. Take a look at this thread: https://stackoverflow.com/questions/380870/make-sure-only-a-single-instance-of-a-program-is-running – titusjan Mar 06 '19 at 08:33
-
Sure, I have some block where I determine is application already running and exit if so. – Alex Mar 06 '19 at 09:19
-
@titusjan thanks for help! Solved with qlocalsocket and qlocalserver! – Alex Mar 06 '19 at 11:00