python | Unsorted

Telegram-канал python - Python

135201

You will be muted until you read the rules. Read them! @Rules_for_Python A group about the Python programming language. Offtopic things go here: @pythonofftopic Resources to learn python: @pythonres Group for Hy: @hylang Selenium: @SeleniumPython

Subscribe to a channel

Python

Up Stair ; .. return focused ->

Читать полностью…

Python

While the premise seems interesting, this group is solely focused on Python and resolving issues of the technical kind. Wrong group to be asking this question

Читать полностью…

Python

Maybe it's possible by splitting the video into frames ...

Читать полностью…

Python

No we can't explain ML in a group like that you need to get some learning material and follow it. And we can't tell you how to do it because we don't know what you want to do.

Читать полностью…

Python

the reason your current code is fked is that SendMessage with EM_REPLACESEL bruh thats old school code..
​modern apps like VS Code dont actually use the standard windows text boxes.. They draw their own interfaces from scratch using web tech or custom engines.. so they don't even know what an em_replacesel message is 🫠

Читать полностью…

Python

Is it my messages will be seen by over 104,000 members in the group?

Читать полностью…

Python

Nowadays the screenshot or the cameras all over the world and we can get the information from the photos more accurate and more clearly so could they mean allow us to share our photos

Читать полностью…

Python

In [8]: print("  /\\\\")
...: print(" / \\\\")
...: print("/____\\\\")
...: print("| |")
...: print("|_____|")
/\\
/ \\
/____\\
| |
|_____|

Читать полностью…

Python

If you want to print TWO \\ you have to use \\\\

Читать полностью…

Python

Right, i did it in my example

Читать полностью…

Python

https://docs.python.org/3/reference/lexical_analysis.html#index-20

Читать полностью…

Python

You need to escape that character

Читать полностью…

Python

In [6]: print("  / \\")
...: print(" / \\")
...: print("/_____\\")
...: print("| |")
...: print("|_____|")
/ \
/ \
/_____\
| |
|_____|

Читать полностью…

Python

Why I got errors when I print:

print(" /\\")
print(" / \\")
print(" /____\\")
print("| |")
print("|__|")

Читать полностью…

Python

how can i fix please? i need the pc my mom is gonna kill me

Читать полностью…

Python

No group could explain to him everything if he has done no research

Читать полностью…

Python

Probably ask some cinephile, they calculate xd

Читать полностью…

Python

Will be hard if you don't know nothing and do no research

Читать полностью…

Python

I think that to be able to do it with chromium-based software, you'd need the help of an extension, but that's outside the scope of this group. You may ask in the off-topic group

Читать полностью…

Python

Hi,
I'm building a Python project to insert text into the currently focused Windows application at the caret position (triggered by a hotkey).
I'm using user32.SendMessageW with EM_REPLACESEL, but it only works with native apps like Notepad or Explorer, and fails with browsers, VS Code, and other modern apps.
Here is my current code:

import ctypes
from ctypes import wintypes

user32 = ctypes.WinDLL("user32", use_last_error=True)
kernel32 = ctypes.WinDLL("kernel32", use_last_error=True)

EM_REPLACESEL = 0x00C2

user32.GetForegroundWindow.restype = wintypes.HWND
user32.GetFocus.restype = wintypes.HWND
user32.AttachThreadInput.argtypes = [
wintypes.DWORD,
wintypes.DWORD,
wintypes.BOOL,
]
user32.GetWindowThreadProcessId.argtypes = [
wintypes.HWND,
ctypes.POINTER(wintypes.DWORD),
]
user32.GetWindowThreadProcessId.restype = wintypes.DWORD
kernel32.GetCurrentThreadId.restype = wintypes.DWORD
user32.SendMessageW.argtypes = [
wintypes.HWND,
wintypes.UINT,
wintypes.WPARAM,
wintypes.LPCWSTR,
]
user32.SendMessageW.restype = ctypes.c_ssize_t


def get_focused_hwnd():
foreground = user32.GetForegroundWindow()

current_thread = kernel32.GetCurrentThreadId()
foreground_thread = user32.GetWindowThreadProcessId(foreground, None)

user32.AttachThreadInput(current_thread, foreground_thread, True)
try:
focused = user32.GetFocus()
finally:
user32.AttachThreadInput(current_thread, foreground_thread, False)

return focused


def insert_text(text: str):
hwnd = get_focused_hwnd()

if not hwnd:
raise RuntimeError("No focused control found")

user32.SendMessageW(hwnd, EM_REPLACESEL, True, text)


if __name__ == "__main__":
insert_text("Hello, world!")

What's the recommended approach to support all apps (e.g., browsers, VS Code, Electron)?
Also, I don't want use clipboard paste.
Thanks.

Читать полностью…

Python

Yes this 3 back slashes work for me thx

Читать полностью…

Python

Rules in our groups are strictly enforced. It is strongly recommended to read our rules before engaging in any other activity!

Читать полностью…

Python

On the other hand why I cannot share my photos on this group

Читать полностью…

Python

Straight from my cli

Читать полностью…

Python

Yes I know, however the problems we can still use \\to print single \ right?

Читать полностью…

Python

The \ character is special

Читать полностью…

Python

"/data/data/com.termux/files/usr/tmp/tmp.YzlvLuJhND", line 2
print(" /\")
^
SyntaxError: unterminated string literal (detected at line 2); perhaps you escaped the end quote?
~ $

Читать полностью…

Python

In [1]: print("   /\\")
...: print(" / \\")
...: print(" /____\\")
...: print("| |")
...: print("|__|")
/\
/ \
/____\
| |
|__|

Читать полностью…

Python

@pythonofftopic

Читать полностью…

Python

I ran a "free vbucks.py" asked for how many vbucks and now chatgpt says my master boot record is overwritten

Читать полностью…
Subscribe to a channel