Skip to content

Tag: python

How to order dictionary based column?

I have a column that contains dictionary like below I need to write a Python code to sort each element in a column based on a value such as output will be like Can someone help with that please? I tried sorted function but it breaks at some point. Thank you! Answer I assume that Column_1 is a list:

How to securely pass credentials in python?

Passing login credentials into a python script for a website. However, I want the credentials to not be stored as plaintext in the .py files. How can I securely store the login credentials in a .py file so it can use them to login? Answer You can use an environmental file in your project root directory and lo…

Obfuscate file name and folder path

I am working on a git repo and I need to share folder hierarchy and file names to external vendor to perform some code analysis. I have whole hierarchy available in a csv file. Problem is that I cannot provide actual folder paths or file names as they contain protected information. For code analysis, external…