본문 바로가기
반응형

전체 글14

Python - UDP (send, receive) https://arduino-dds.tistory.com/entry/esp8266-udp-send-receive esp8266 - udp (send, receive) Code 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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 arduino-dds.tistory.com Code 1 2 3 4 5 6 7 8 9 1.. 2023. 1. 5.
Python - all ip check in pc Code 1 2 3 4 5 6 7 import socket ip_tuple = socket.gethostbyname_ex(socket.getfqdn()) for ip in ip_tuple[2]: if '192.' in ip : print(ip) Colored by Color Scripter cs Result #> python .\ip_check.py 192.168.4.44 192.168.2.9 2023. 1. 4.
python - multicast send with esp8266 https://arduino-dds.tistory.com/entry/esp8266-multicast-with-python-pc esp8266 - multicast with python pc https://python-dds.tistory.com/entry/python-multicast-receive-with-esp8266 https://python-dds.tistory.com/entry/python-multicast-send-with-esp8266 python - multicast send with esp8266 Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import socket MCAST_GRP = '224. arduino-dds.tistory.com Code 1 2 3 .. 2023. 1. 2.
python - multicast receive with esp8266 https://arduino-dds.tistory.com/entry/esp8266-multicast-with-python-pc esp8266 - multicast with python pc https://python-dds.tistory.com/entry/python-multicast-receive-with-esp8266 https://python-dds.tistory.com/entry/python-multicast-send-with-esp8266 python - multicast send with esp8266 Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 import socket MCAST_GRP = '224. arduino-dds.tistory.com Code 1 2 3 .. 2023. 1. 2.
Python - with open 파일 쓰기 (file write) Code 1 2 3 4 file_name = 'write_file.txt' with open(file_name, 'w') as write_data: print(f"open file : {file_name}") write_data.write('WRITE TEST') cs Result #> python .\fie_open_write.py open file : write_file.txt #> cat .\write_file.txt WRITE TEST 2022. 12. 30.
Python - git check and git pull Code 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 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 import git def remote_git_check(): for remote in repo.remotes: print ("[ " + str(remote) + " branches ]") for branch in getattr(repo.remotes,.. 2022. 12. 29.
Python - folder 제거(remove) with os(import) Code 1 2 3 4 5 6 7 8 import os dir_path = 'D:\\new_folder' if os.path.exists(dir_path): os.rmdir(dir_path) print(f"removed folder: {dir_path}") else: print(f'There is no {dir_path}') cs Result #> python .\folder_remove.py removed folder: D:\new_folder 2022. 12. 29.
Python - file 제거(remove) with os(import) Code 1 2 3 4 5 6 7 8 import os file = "remove_file.txt" if os.path.isfile(file): os.remove(file) print(f"removed file: {file}") else: print(f'There is no {file}') cs Result #> python .\file_remove.py There is no remove_file.txt #> echo 'creat' > remove_file.txt #> python .\file_remove.py removed file: remove_file.txt 2022. 12. 29.
Python - pywinauto를 이용한 notepad Control Code 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 from pywinauto.application import Application app = Application(backend="uia").start("notepad.exe") app['Dialog']['Edit'].set_text("TEST") #app['Dialog'].menu_select("파일(F)->열기(O)") app['Dialog'].menu_select("도움말(H)->메모장 정보(A)") dlg = app['Dialog'] #dlg.print_control_identifiers() x = app['Dialog'].child_window(title="응용 프로그램", auto_id="MenuBar", contr.. 2022. 12. 29.
Python - pywin32를 이용한 USB device 검색 Code 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 35 36 37 import win32com.client def check_fw_update_device(): wmi = win32com.client.GetObject ("winmgmts:") devices = [] for usb in wmi.InstancesOf ("Win32_PnPEntity"): find_device = 'USB Input Device' if find_device in str(usb.Description): print(f"DeviceID: + {str(usb.DeviceID)}") print(f"PNPDevic.. 2022. 12. 29.
반응형