You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
587 B
20 lines
587 B
5 years ago
|
from PIL import ImageGrab
|
||
|
import os # to execute cmd commands
|
||
|
#Check if screen is exists
|
||
|
def Exists():
|
||
|
#Try to get 1 px from screen
|
||
|
try:
|
||
|
#Take 1 px
|
||
|
ImageGrab.grab(bbox=(0,0,1,1))
|
||
|
#Screen is exists - return True
|
||
|
return True
|
||
|
#Catch exception
|
||
|
except Exception:
|
||
|
#Screen does not exists - return false
|
||
|
return False
|
||
|
#Make console session
|
||
|
def ConsoleScreenBase():
|
||
|
#Get script folder path
|
||
|
lFolderPath = "/".join(__file__.split("\\")[:-1])
|
||
|
#Send command to cmd
|
||
|
os.system(os.path.join(lFolderPath,"ConsoleStart.bat"))
|