<div dir="ltr">Hey, there. I've been coding in python for about three weeks now. I have made basic games, tools to check forum PMs for me, and other general utilities with python, but I'm now encountering problems.<br>
<br> <a href="http://ubuntuforums.org/archive/index.php/t-511211.html">http://ubuntuforums.org/archive/index.php/t-511211.html</a><br><br>I want to do that, and I have installed both sets needed from source forge, but I always get this issue when I run the code, and there isn't a single listing on the internet that addresses this.<br>
<br>****<br><br>Traceback (most recent call last):<br> File "C:/Documents and Settings/Guest Editor/Desktop/key.py", line 3, in <module><br> import pythoncom<br> File "C:\Python25\lib\site-packages\pythoncom.py", line 2, in <module><br>
import pywintypes<br>ImportError: No module named pywintypes<br><br>***<br><br><a href="http://ubuntuforums.org/archive/index.php/t-511211.html">http://ubuntuforums.org/archive/index.php/t-511211.html</a> With the code:<br>
<br>import winsound<br>import pyHook<br>import pythoncom<br><br>def funkytown(event): #Play Funky Town<br> if event.Key == 'Back':<br> winsound.Beep(38, 3000)<br> winsound.Beep(392, 100) #Frequency (Hz), Duration(ms)<br>
winsound.Beep(38, 100)<br> winsound.Beep(392, 100)<br> winsound.Beep(38, 100)<br> winsound.Beep(349, 100)<br> winsound.Beep(38, 100)<br> winsound.Beep(392, 300)<br> winsound.Beep(38, 100)<br>
winsound.Beep(294, 300)<br> winsound.Beep(38, 100)<br> winsound.Beep(294, 100)<br> winsound.Beep(38, 100)<br> winsound.Beep(392, 100)<br> winsound.Beep(38, 100)<br> winsound.Beep(523, 100)<br>
winsound.Beep(38, 100)<br> winsound.Beep(494, 100)<br> winsound.Beep(38, 100)<br> winsound.Beep(392, 200)<br><br>hm = pyHook.HookManager()<br>hm.KeyDown = funkytown<br>hm.HookKeyboard()<br>pythoncom.PumpMessages() <br>
<br><br>I've installed pythoncom right from the box. I don't know whats wrong, but I'm sure it has something to do with my stupidity.<br><br><br>BUT, here is the strangest part.<br><br># Magic utility that "redirects" to pythoncomxx.dll<br>
import pywintypes<br>pywintypes.__import_pywin32_system_module__("pythoncom", globals())<br><br><br>That is ALL that pythoncom.py seems to be. ALL that.<br><br>I think that it's trying to import something, THEN tell the interpreter where it is. That seems kinda stupid.<br>
<br>Anyway, what have I done wrong, and how do I fix it?<br><br></div>