0

In doing a project, I need to open files in IDLE on Mac. These files are not .py files. On a PC, if I select 'file types' to be 'any file', I can open these files, but in Mac I haven't found a similar way to handle this yet. By opening, I don't mean writing a code open(...) in IDLE, but literally click open to see what the file looks like.

Any suggestions on this? Thanks!

Camuslu
  • 123
  • 1
  • 3
  • 13
  • 1
    Why do you need to open the files in the interpreter? – That1Guy Jun 26 '14 at 17:02
  • Is there a reason you can't just open the files with your favorite text editor? – shuttle87 Jun 26 '14 at 17:03
  • I want to see what the content of the file is. The files were generated from another python program and don't have suffix such as txt (although they contain texts). I guess the only way for me to see the file's content is then to open them in the interpreter. – Camuslu Jun 26 '14 at 17:04
  • 1
    Why don't you regenerate the files with the appropriate extension? – That1Guy Jun 26 '14 at 17:05
  • In order to guess the file content you can try the `filemagic` module, see this answer: http://stackoverflow.com/questions/18777119/how-to-guess-the-type-of-a-file-in-python – Paulo Scardine Jun 26 '14 at 17:17
  • Add manually `.py` to file and open it. – furas Jun 26 '14 at 19:29
  • Another helpful command to determine what kind of data a file holds is through the [`file`](https://en.wikipedia.org/wiki/File_(command)) and then you can decide which application you want to use to take a look at it – cicolus Jun 06 '20 at 06:09

0 Answers0