importing python custom library


Trying out custom library in python. I think the better way to write is basically to have different object into a specific file. For example, paymentMethod in a file instead of nested paymentMethod, payee, account into a single py file.

Let's say we are creating a custom library called payment and placed it under a folder called payment.

First we need to create a "payment" folder. Create a file called __init__.py.

a) __init__.py file

b) payment.py



c) then import it using the following code






Comments

Popular posts from this blog

ionic2 cordova build android - Unable resolve gradle 2.2.3

A quick tutorial for OWASP ZAP tool for beginners

OpenCover code coverage for .Net Core