mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-28 05:28:38 +00:00
16 lines
333 B
Python
16 lines
333 B
Python
# Appends .py when executing python files
|
|
#
|
|
# Example:
|
|
# > python foo
|
|
# error: python: can't open file 'foo': [Errno 2] No such file or directory
|
|
from thefuck.utils import for_app
|
|
|
|
|
|
@for_app('python')
|
|
def match(command):
|
|
return not command.script.endswith('.py')
|
|
|
|
|
|
def get_new_command(command):
|
|
return command.script + '.py'
|