Python hints
Untrusted target
If you get untrusted cert error when trying to download library because your firewall, you can do this (only if you really trust the source).python -m pip install --upgrade pip --trusted-host files.pythonhosted.org --trusted-host pypi.org
Working with venv
1. Create a new environment, this will create a directory named some_name from where you execute this
python -m venv some_name
You should see Include, Lib, and Scripts folders and pyvenv.cfg file in this directory
2. Go into that directory then activate the environment
./Scripts/activate
3. Now you should see (some_name) in from of your prompt. Any python code (and Pip) action taken here is isolated to this venv.
4. To exit just type deactivate from this directory
Sorting a List of Dictionary
sorted(ListOfDict, key=(lambda item: item['SomeKeyName']))
No comments:
Post a Comment