Loading ...
Sorry, an error occurred while loading the content.
 

Re: pyfile command and __file__ attribute

Expand Messages
  • Bram Moolenaar
    ... No, I think that it s just a matter nobody finding out how to set __file__ from inside Vim. Vim uses execfile(), it s unexpected that the Python
    Message 1 of 2 , Nov 23, 2004
      Hari Krishna Dara wrote:

      > While using :pyfile to execute python script, the __name__ attribute is
      > set to "__main__" but __file__ is undefined. Is this intentional?

      No, I think that it's just a matter nobody finding out how to set
      __file__ from inside Vim. Vim uses execfile(), it's unexpected that the
      Python interpreter doesn't set __file__ automatically.

      --
      Save the plankton - eat a whale.

      /// Bram Moolenaar -- Bram@... -- http://www.Moolenaar.net \\\
      /// Sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
      \\\ Project leader for A-A-P -- http://www.A-A-P.org ///
      \\\ Buy at Amazon and help AIDS victims -- http://ICCF.nl/click1.html ///
    Your message has been successfully submitted and would be delivered to recipients shortly.