Python Code Snippets cache decorator - increase speed of math calculations from functools import cache, lru_cache @lru_cache(maxsize=5) def fib(n): if n <= 1: return n return fib(n - 1) + fib(n - 2) def main(): for i in range(400): print(i, fib(i)) print("done") if __name__ == '__main__': main() test function def myfunc(a,b): if a>b: print ("It worked") else: print ("No") myfunc(2,1) if_else hungry = True if hungry: print('FEED ME NOW!
create a virtual environment in current directory
python -m venv my_venv create a virtual environment in a specific dirctory
python -m venv path/to/your/venv/my_venv activate a virtual environment using powershell from the venv/scripts folder
./Activate.ps1 deactivate a virtual environment using powershell from the venv/scripts folder
deactivate remove/delete a virtual environment (just delete the directory)
rm -rf /path/to/my_venv clear an existing virtual environment
python -m venv --clear path/to/my_venv update python version in a virtual environment
This article offers a sample of basic Markdown syntax that can be used in Hugo content files, also it shows whether basic HTML elements are decorated with CSS in a Hugo theme.
Hugo ships with several Built-in Shortcodes for rich content, along with a Privacy Config and a set of Simple Shortcodes that enable static and no-JS versions of various social media embeds.
Emoji can be enabled in a Hugo project in a number of ways.