Using Python 3.1 with TextMate

前端 未结 4 1235
旧巷少年郎
旧巷少年郎 2020-12-04 16:14

TextMate seems to use the built-in Python version I assume (sys.path doesn\'t work). How do you configure it to use 3.1 instead? I\'ve already installed the 3.1 package and

4条回答
  •  情歌与酒
    2020-12-04 16:19

    Late to the party, sorry! I take it you want to run the script using TextMate's 'built-in' interpreter? I've found the simplest solution is to add a shebang, which works extremely well;

    #!/usr/bin/env python3
    

    for python 3.1 or;

    #!/usr/bin/env python
    

    for default system python, although the latter is superfluous for the exercise.

提交回复
热议问题