1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-11-15 14:25:58 +00:00
Files
thefuck/thefuck/rules/python_execute.py
mcarton 5552fd3dc9 s/compile/execute when talking about Python
The word 'compile' is just misleading here.
2015-06-26 14:54:33 +02:00

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'