mirror of
https://github.com/nvbn/thefuck.git
synced 2025-11-15 14:25:58 +00:00
15 lines
355 B
Python
15 lines
355 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
|
|
|
|
|
|
def match(command, settings):
|
|
return (command.script.startswith('python ')
|
|
and not command.script.endswith('.py'))
|
|
|
|
|
|
def get_new_command(command, settings):
|
|
return command.script + '.py'
|