I have a doubt about pydev

2009-02-22
2013-03-15
  • rafael massao
    rafael massao
    2009-02-22

    hi, I would like to know how to put a standard header in my python programs.
    eg "#! / usr / bin # -*- coding: iso-8859-1 -*-"

    as in C which has the header "#include"

    If not please let me know
    I am grateful for help

    Masao.

     
    • Fabio Zadrozny
      Fabio Zadrozny
      2009-02-24

      Usually, I have no headers unless actually needed:

      #/usr/bin/python or maybe #/usr/bin/env python -- as pointed in http://mail.python.org/pipermail/tutor/2007-June/054816.html should be used if your module can be executed as a main module.

      #coding: utf-8 (or some other encoding ) should be specified if you have some non-ascii char in your module (note that there are variations on how to specify that, but the important is that 'coding: xxx' is in your string: http://www.python.org/dev/peps/pep-0263/ )

      Cheers,

      Fabio