A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-February/098019.html below:

[Python-Dev] __file__

[Python-Dev] __file__ [Python-Dev] __file__Greg Ewing greg.ewing at canterbury.ac.nz
Sun Feb 28 02:25:15 CET 2010
Glenn Linderman wrote:

> What I did was:
> 
> python -m test
> ren test.pyc foo.py
> foo.py
> 
> and it worked.

Source files mentioned on the command line aren't required to
have a .py extension. I think what's happening is that the
interpreter ignores the filename altogether in that case and
examines the contents of the file to figure out what it is,
in order to support running .pyc files from the command line.

-- 
Greg
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4