Some good answers to your questions already, so I'll ask some additional stuff. For what reason are you wanting to open it to Notepad? To copy it, to view it? If you are in TK then you may want to consider the
modules. They offer you a whole swag of possibilities that are available in notepad, but don't make it dependent on an external application.
Also if you want it in clipboard to copy somewhere else after running you could use the
module.
Hope that helps.