How to disable warnings in Python

There’s a number of different ways to turn off Python warnings. There’s a lot of annoying future deprecation warnings that might flood your console space like crazy. So in order to suppress unwanted warnings in Python, the easiest way is the following: import warnings warnings.filterwarnings(‘ignore’) if you would like disable some specific type of warnings, … Read more

ModuleNotFoundError: No module named ‘pydrive’

Hey guys, if you stumble upon this error, most probably you have conflicting modules installed in your pip or other package management tool. And by the way, PyDrive is not supported anymore for quite a long time, so it’s better to install PyDrive2 pip install PyDrive2 PyDrive2 an actively maintained fork of PyDrive. If you … Read more

Git clone only files without folder

You can simply pull your master branch: git init git remote add origin “origin-url” git pull origin master Clone commands will usually just clone the whole repository with the directory.

Categories git

List comprehension from python dictionary

Here’s my example: params = { ‘param1’: [[25, 30, 35],[-25, -30, -35]], ‘param2’: [[20, 25, 30],[-20, -25, -30]] } for key, value in paramsNEW.items(): print( key, value[0], value[1] ) for v in value: print(v) for key, value in paramsNEW.items(): print(key, [(v1,v2) for v1 in value[0] for v2 in value[1]])