Some python tricks and small utilities

I have decided to collect here some Python tricks that I find interesting and useful: How to show a function’s variables: print vars() #Inside the function How to show an object’s methods: def getMethods(self, object): temp = inspect.getmembers(object, predicate=inspect.ismethod) for method in temp: print method[0] How to re-scale one value: def scale(Value, OldMin, OldMax, NewMin, […]