독도 광고 모금 캠페인

sap login 화면 말고도 처리가능할거 같아서 찾아보니 실제로 있음 왜 몰랐을까.. ㅡ.ㅡ;;

아까 쓴글로 정상종료까지 시키면 sap batch 프로그램을 만들어버리네... 

실제로 테스트 해본 결과는 기존에 일일이 프로그램을 실행시키는 것보다 빠른 처리가 가능함
물론 실행된 화면을 체크하는 것때문에 느려지는 것이긴 하지만..

모든 것이 혼자서 완벽하게 돌아가는 솔루션은 있을수 없기때문에 그걸 보충할 방법을 제대로 찾아서
사용하는 것이 도리인거 같은데.... 모르겠음... 

한줄요약:

더보기

subprocess.check_call(['C:\Program Files (x86)\SAP\FrontEnd\SAPgui\\sapshcut.exe', '-system=DCG210', '-client=100', '-user=USERNAME', '-pw=PASSWORD'])

 

출처 : 

https://blogs.sap.com/2020/06/01/login-to-sap-using-python/

 

Login to SAP Using Python | SAP Blogs

7 Likes 1,610 View 5 Comments

blogs.sap.com

https://stackoverflow.com/questions/57969773/how-can-i-run-sap-with-python-scripting

 

How can i run SAP with Python scripting?

Currently im working on how can i start SAP Scripting with python with the help of stackoverflow but apparently my sap does not open the connection page the Page where i enter USERNAME and PASSWORD...

stackoverflow.com

 

Posted by 이현호
,

process_find_and_close.py
0.00MB

모든 출처의 글이 사용된것은 아니나 구현 하려고 했던 것의 영감을 줌
process name 과 window title 모두 찾은 이유는 사실 window title로 찾아지지 않는 뭔가를 편하게 끄려고 한 것임

더보기

import psutil
import sys
import os
import traceback
import win32con as wcon
import win32api as wapi
import win32gui as wgui
import win32process as wproc


process_info_list = None


# Callback
def enum_windows_proc(hwnd, param):
pid = param.get("pid", None)
data = param.get("data", None)
if pid is None or wproc.GetWindowThreadProcessId(hwnd)[1] == pid:
text = wgui.GetWindowText(hwnd)
if text:
## 여기에 어떻게 조건을 주느냐에 따라서 active process 또는 visable 속성인 window등만 골라낼 수 있음
# style = wapi.GetWindowLong(wnd, wcon.GWL_STYLE)
# if style & wcon.WS_VISIBLE:
if data is not None:
data.append((hwnd, text))
#else:
#print("%08X - %s" % (wnd, text))


def enum_process_windows(pid=None):
data = []
param = {
"pid": pid,
"data": data
}
wgui.EnumWindows(enum_windows_proc, param)
return data


def get_list():
global process_info_list
temp_obj = None
pslist = list(psutil.process_iter())
process_info_list = []
for ps in pslist:
temp_obj = dict()
temp_obj['pid'] = ps.pid
temp_obj['exec_name'] = ps.name()
data = enum_process_windows(ps.pid)
if data:
temp_obj['data'] = data
# proc_text = "PId {0:d}{1:s}windows:".format(ps.pid, " (File: [{0:s}]) ".format(ps.name()) if ps.name() else " ")
# print(proc_text)
# for handle, text in data:
# print(" {0:d}: [{1:s}]".format(handle, text))
# print(temp_obj)
process_info_list.append(temp_obj)
# print(process_info_list)
# for pr in process_info_list:
# print(pr)

def main(*args):
global process_info_list
filtered_list = list()
# proc_name = args[0] if args else None
# proc_name = 'excel' # 이건 process name 테스트용
proc_name = '통합 문서' # 이건 window title 테스트용
get_list()
if len(process_info_list) > 0:
for pr in process_info_list:
is_correct = False
data = None
if 'data' in pr:
data = pr['data']
else:
data = list()
##############################
# 지금은 close 버튼 클릭한 것과 동일한 내용만 표시함
# 차후에 popup 창 찾아서 &Yes 또는 &Ok등 버튼 찾아 클릭하는 내용까지 추가하면 완전히 종료가능
##############################
if proc_name in pr['exec_name'].lower():
print('exec find - {0}'.format(proc_name))
for hwnd , text in data:
wgui.SendMessage(hwnd,wcon.WM_CLOSE,0,0)
else:
for hwnd , text in data:
if proc_name in text:
print('window title find - {0}'.format(proc_name))
wgui.SendMessage(hwnd,wcon.WM_CLOSE,0,0)

if __name__ == "__main__":
print("Python {0:s} {1:d}bit on {2:s}\n".format(" ".join(item.strip() for item in sys.version.split("\n")), 64 if sys.maxsize > 0x100000000 else 32, sys.platform))
main(*sys.argv[1:])
print("\nDone.")

 

 

출처 : 

https://stackoverflow.com/questions/31278590/get-the-title-of-a-window-of-another-program-using-the-process-name

 

Get the title of a window of another program using the process name

This question is probably quite basic but I'm having difficulty cracking it. I assume that I will have to use something in ctypes.windll.user32. Bear in mind that I have little to no experience using

stackoverflow.com

http://timgolden.me.uk/python/win32_how_do_i/find-the-window-for-my-subprocess.html

 

Tim Golden's Python Stuff: Find the window for my subprocess

Find the window for my subprocess Tim Golden > Python Stuff > Win32 How Do I...? > Find the window for my subprocess Introduction The challenge: to find the windows belonging to the process you've just kicked off. The idea is that if, for example, you run

timgolden.me.uk

https://stackoverflow.com/questions/51418928/find-all-window-handles-from-a-subprocess-popen-pid

 

Find all window handles from a subprocess.Popen pid

I'm currently trying to get all window handles from a process started by subprocess.Popen looking like this: def openMP(): mp_p = os.path.abspath("C:\Program Files (x86)\Mobile Partner\Mobile

stackoverflow.com

https://stackoverflow.com/questions/17272572/get-window-handler-from-started-process

 

get window handler from started process

I see there's win32process.GetWindowThreadProcess() that gets a window handler and returns it's process id. Is there a way to do the opposite: get the window handler of a running process by it's pr...

stackoverflow.com

 

Posted by 이현호
,

https://github.com/microsoft/terminal

 

microsoft/terminal

The new Windows Terminal and the original Windows console host, all in the same place! - microsoft/terminal

github.com

 

https://github.com/microsoft/PowerToys

 

microsoft/PowerToys

Windows system utilities to maximize productivity. Contribute to microsoft/PowerToys development by creating an account on GitHub.

github.com

aka.ms/powershell

 

PowerShell 설명서 - PowerShell

PowerShell 공식 제품 설명서

docs.microsoft.com

https://code.visualstudio.com/

 

Visual Studio Code - Code Editing. Redefined

Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications.  Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows.

code.visualstudio.com

Python , PHP 등등 쓰기 좋아지는거 같음 (WSL2는 아직 설치중이라서 써본뒤 정리)

Java 는 Plugin 버그가 고쳐졌나 모르겠음

Posted by 이현호
,