0

I'm learning to make a simple text editor. The thing I want to do is when I double click a .txt file in windows explorer (or using the 'open with' button) I want to execute my program and view the file with my program. I am making the program in tkinter. Is there some kind of way to do this?

Roland Smith
  • 42,427
  • 3
  • 64
  • 94
zaka100
  • 332
  • 1
  • 4
  • 9
  • 1
    Yes. What part of the process are you having trouble with? As it stands this question is too broad to answer here (and depending on what you mean to ask, this might be a more appropriate question for [SuperUser](http://superuser.com) instead). – Henry Keiter Jan 16 '15 at 19:37
  • I mean like programming the program to automatically open the file. – zaka100 Jan 16 '15 at 21:00
  • Right Click on .py file->Open With...->Choose program->Find python interpretator (pythonw.exe for GUI, python.exe for console script) And check this out http://stackoverflow.com/a/9037618/1821490 – Alex Kroll Jan 16 '15 at 22:01

1 Answers1

2

This will send the common text extensions (.txt., .log, etc...) to your program

ftype txtfile="c:\path\to\pythonw.exe" "c:\path\to\my\editor.py" "%1"
tdelaney
  • 73,364
  • 6
  • 83
  • 116