-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathSharedMemory.py
More file actions
34 lines (25 loc) · 693 Bytes
/
SharedMemory.py
File metadata and controls
34 lines (25 loc) · 693 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Created on 2017年3月30日
@author: Irony
@site: https://pyqt.site , https://github.com/PyQt5
@email: 892768447@qq.com
@file: TestQSharedMemory
@description:
"""
from PyQt5.QtWidgets import QWidget
from Lib.Application import SharedApplication # @UnresolvedImport
class Widget(QWidget):
def __init__(self, *args, **kwargs):
super(Widget, self).__init__(*args, **kwargs)
if __name__ == "__main__":
import sys, os
print(os.getpid())
app = SharedApplication(sys.argv)
if app.isRunning():
print("app have already running")
sys.exit(0)
w = Widget()
w.show()
sys.exit(app.exec_())