wxPythonWindow class) should create a “native” interpreter window. It is easy to connect that window to the Python interpreter. You can redirect Python’s i/o to _any_ object that supports read and write, so all you need is a Python object (defined in your extension module) that contains read() and write() methods. 

## 6.7 How do I keep editors from inserting tabs into my Python source? 

The FAQ does not recommend using tabs, and the Python style guide, PEP 8 , recommends 4 spaces for distributed Python code; this is also the Emacs python-mode default. 

Under any editor, mixing tabs and spaces is a bad idea. MSVC is no different in this respect, and is easily configured to use spaces: Take Tools ‣ Options ‣ Tabs , and for file type “Default” set “Tab size” and “Indent size” to 4, and select the “Insert spaces” radio button. 

Python raises IndentationError or TabError if mixed tabs and spaces are causing problems in leading whitespace. You may also run the tabnanny module to check a directory tree in batch mode. 

## 6.8 How do I check for a keypress without blocking? 

Use the$_{msvcrt}$module. This is a standard Windows-specific extension module. It defines a function$_{kbhit()}$ which checks whether a keyboard hit is present, and$_{getch()}$ which gets one character without echoing it. 

