Answers for "python small console application"

2

how to do a console command with python

import subprocess

subprocess.run("Your command here")
Posted by: Guest on August-01-2021
0

python put console window on top

import win32gui, win32process, win32con
import os

windowList = []
win32gui.EnumWindows(lambda hwnd, windowList: windowList.append((win32gui.GetWindowText(hwnd),hwnd)), windowList)
cmdWindow = [i for i in windowList if "c:python26python.exe" in i[0].lower()]
win32gui.SetWindowPos(cmdWindow[0][1],win32con.HWND_TOPMOST,0,0,100,100,0) #100,100 is the size of the window
Posted by: Guest on August-27-2020

Code answers related to "python small console application"

Python Answers by Framework

Browse Popular Code Answers by Language