Author Topic: Project file: python source files  (Read 2568 times)

cappy2112

  • Community Member
  • Posts: 91
  • Hero Points: 0
Project file: python source files
« on: July 25, 2007, 10:05:13 pm »

On Windows platforms, Python source files have two different extensions: .PY and .PYW.

The .PYW just tells the interpreter to launch the program without starting up a console window (this is for GUI applications).

I've got a Slick project file that contains a .PYW file. Until I mapped .pyw to .py, syntax coloring for the .pYW file did not work.

Now when I add more .PYW files to the Slick project, they are moved to the "Other Files" part of the project, instead of showing under source files.

Is there something i can change so the .pyw file show up under Source Files?

Is it possible to configure a Slick project which has mixed source types to show all files with the same extensions together? That is all .c/.h/cpp./hpp files in one Source File group, all .py/.pyw files in another Source Files Group?


hs2

  • Senior Community Member
  • Posts: 2733
  • Hero Points: 284
Re: Project file: python source files
« Reply #1 on: July 25, 2007, 10:57:10 pm »
Right click 'Source Files' in the Projects TB tree and adjust the 'Folder props' accordingly.
You can add more folders there (see context menu: Add Folder) e.g. 'Python Source Files' and 'C/C++ Source Files'.
But remember that 'Project' corresponds with 'Compilation unit' by default.
But of course you can use your own tailored build tools.

HS2

StephenW

  • Senior Community Member
  • Posts: 186
  • Hero Points: 21
Re: Project file: python source files
« Reply #2 on: July 25, 2007, 11:04:21 pm »
Go to "Project/New", select the "Project" tab and click on the "Customize" button and then the "New" button.  That allows you to create a new project type that has whatever options you prefer.  I have types for my PL/M and in-house PAL language projects.

I only discovered this recently - before that I was using generic projects and then in the Projects toolbar I was right-clicking on folders, adjusting the "Project Properties", and then right-clicking the project and using "Refilter".  That was rather tedious.

hs2

  • Senior Community Member
  • Posts: 2733
  • Hero Points: 284
Re: Project file: python source files
« Reply #3 on: July 25, 2007, 11:19:57 pm »
Cool hint StephenW [HP++] !
Didn't know this nifty feature - there are just too much of them...
This is definitely helpful also for my non-standard projects :)

HS2