-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DD_str方法在python2.x中可以用,python3.x中存在问题,只会输入字符串中第一个字符,就结束了 #57
Comments
调用的是DD94687.64.dll这个驱动 |
输入单字节类型
zxxwslq ***@***.***> 于2022年7月20日周三 15:22写道:
… 调用的是DD94687.64.dll这个驱动
—
Reply to this email directly, view it on GitHub
<#57 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ARXPLN5AWYJUWNV4CL2ZCXLVU6SLBANCNFSM54CQTGPA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
用 from ctypes import *
import time
print("Load DD!")
dd_dll = windll.LoadLibrary("./dd.dll")
time.sleep(2)
st = dd_dll.DD_btn(0) # DD Initialize
if st == 1:
print("OK")
else:
print("Error")
exit(101)
def input_str(s: str):
dd_dll.DD_str(c_char_p(s.encode("ascii")))
time.sleep(5)
input_str("Hello World!") 注意这个解决方案是我随便找的,可能有潜在的问题,我没仔细分析。文档链接。 |
DD_str(b"123")
在 2024-03-06 10:26:47,"kvii" ***@***.***> 写道:
用 c_char_p(s.encode("ascii")) 解决了问题。下面是复现 demo:
fromctypesimport*importtimeprint("Load DD!")
dd_dll=windll.LoadLibrary("./dd.dll")
time.sleep(2)
st=dd_dll.DD_btn(0) # DD Initializeifst==1:
print("OK")
else:
print("Error")
exit(101)
definput_str(s: str):
dd_dll.DD_str(c_char_p(s.encode("ascii")))
time.sleep(5)
input_str("Hello World!")
注意这个解决方案是我随便找的,可能有潜在的问题,我没仔细分析。文档链接。
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you commented.Message ID: ***@***.***>
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
如题,求解~~~
The text was updated successfully, but these errors were encountered: