anshanno anshanno - 1 year ago 99
Linux Question

Is it possible to include interpreter path (or set any default code) when I create new python file in Pycharm?

I haven't been able to find anything and I am not sure if this is the place I should be asking...

But I want to include the path to my interpreter in every new project I create. The reason being is that I develop locally and sync my files to a linux server. It is annoying having to manually type

#! /users/w/x/y/z/bin/python
every time I create a new project. Also would be nice to include certain imports I use 90% of the time.

I got to thinking, in the program I produce music with you can set a default project file. Meaning, when you click new project it is set up how you have configured (include certain virtual instruments, effects, etc).

Is it possible to do this or something similar with IDE, and more specifically, Pycharm?

Answer Source

You should open File in the main menu and click Default Settings, collapse the Editor then click File and Code Templates, in the Files tab click on the + sign and create a new Template, give the new template a name and extension, in the editor box put your template content, in your case #! /users/w/x/y/z/bin/python apply and OK. After that everytime you open a project, select that template to include default lines you want. You could make number of templates.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download