Question: So I'm trying to use a KeyBoardEvent honestly just for testing purposes.. what I'm doing does not seem to be working :/ Hopefully you guys can tell me where I'm derping. Thanks! 

```
package com.dillyg10.test.Keys;

import java.awt.Window;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingUtilities;

public class Keys extends JPanel implements KeyListener  {
    private static final long serialVersionUID = 1L;

    public Keys(){

    }

    public static void registerEvent(Window w){
        w.setFocusTraversalKeysEnabled(false);
        w.setFocusable(true);
        w.addKeyListener(new Keys());
    }
    public void keyPressed(KeyEvent e) {
        System.out.println(KeyEvent.getKeyText(e.getKeyCode()));
    }
    public void keyReleased(KeyEvent e) {

    }
    public void keyTyped(KeyEvent e) {

    }
    public static void gui() {

        JFrame frame = new JFrame("Keys");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        registerEvent(new Window(frame));

        //Display the window.
        frame.pack();
        frame.setVisible(true);
    }

    public static void main(String[] args){
        SwingUtilities.invokeLater(new Runnable(){
            public void run(){
                gui();
            }
        });
     }
    }

```

This code is basically a test to determine if the keyboardevents work, i jsut print out the key when it's pressed.. but nothing is printed.

Answer: 
You can seek in Python as well - the answer you linked is just pointing that you can't *insert* in the middle of a file (`ABC` -> `ABXC`).

If you seek and then write, whatever data is written **overwrites** the contents at that position of the file (`ABC` -> `AXC`).
You can modify a file in place; if the data you are replacing is the same size as the data you are replacing (smaller and you just pad). What if it is larger? Well, then everything after the modification would need to be rewritten to disk anyway, right? You also can't assume you have enough room at the end in all cases, so the file may need to be moved to a completely new location.

Obviously this makes the valid use cases rather rare. Normally it's not worth it unless you have a really good reason to do so. As for whether or not you have access to in-place modification API's in Python... I have no idea.