Recognizing file - Python
Posted
by Francisco Aleixo
on Stack Overflow
See other posts from Stack Overflow
or by Francisco Aleixo
Published on 2010-04-14T18:49:43Z
Indexed on
2010/04/14
19:03 UTC
Read the original article
Hit count: 301
Ok, so the title may trick you a bit, and I'm sorry for that but didn't find a better title.
This question might be a bit hard to understand so I'll try my best.
I have no idea how this works or if it is even possible but what I want to do is for example create a file type (lets imagine .test (in which a random file name would be random.test)). Now before I continue, its obviously easy to do this using for example:
filename = "random.test"
file = open(filename, 'w')
file.write("some text here")
But now what I would like to know is if it is possible to write the file .test so if I set it to open with a wxPython program, it recognizes it and for example opens up a Message Dialog automatically.
I'm sorry if I'm being vague and in case you don't understand, let me know so I can try my best to explain you.
© Stack Overflow or respective owner