Skip to content

Instantly share code, notes, and snippets.

@Eidansoft
Last active July 5, 2019 06:55
Show Gist options
  • Save Eidansoft/4cae288fef4a195c9e3ad25d760ddfbb to your computer and use it in GitHub Desktop.
Save Eidansoft/4cae288fef4a195c9e3ad25d760ddfbb to your computer and use it in GitHub Desktop.
Python tips
# View the source code of any function in use directly at the debugger, useful to be sure what code are you executing
import inspect
print(''.join(inspect.getsourcelines(NAME_OF_METHOD_TO_SEE_SOURCE_CODE)[0]))
# Create a virtual environment with a specific python version
virtualenv --python=/usr/bin/python2.7 ~/.virtualenvs/test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment