Python Bustlings

Loading a library in python from a local path


If all else fails, and you really do want to edit your source code, you’ll need to edit sys.path. sys.path is a list of locations where Python will look for code.

In your code, write:

import sys

import tweepy

Creating a class in python

Code Example 6 – the Shape class
class Shape:
    def __init__(self,x,y):
        self.x = x
        self.y = y
    description = "This shape has not been described yet"
    author = "Nobody has claimed to make this shape yet"
    def area(self):
        return self.x * self.y
    def perimeter(self):
        return 2 * self.x + 2 * self.y
    def describe(self,text):
        self.description = text
    def authorName(self,text): = text
    def scaleSize(self,scale):
        self.x = self.x * scale
    self.y = self.y * scale

source :

Making own library in python

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s