簡體   English   中英

在Windows 7(64位)上的ctypes中使用windll

[英]Using windll in ctypes on Windows 7 (64bit)

我想問問是否有人像我一樣有類似的問題,以及對此是否有解決方案。

在安裝Windows 7(64位)之前使用Windows XP(32位)時,我已經在Python 2.7.8中使用以下程序,沒有任何錯誤:

from ctypes import *
kernel = windll.kernel32
...

在當前版本的操作系統上運行此序列時,出現錯誤消息:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'windll' is not defined

有人可以知道此錯誤的根本原因在哪里以及如何解決此問題嗎?

在mobaxterm終端下運行注釋中描述的簡短腳本(由jedwards提出)時,會出現錯誤消息。 在cmd.exe控制台中運行腳本時,不會出現錯誤。

謝謝大家,抬頭...

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM