Did I find the right examples for you? yes no

All Samples(10)  |  Call(5)  |  Derive(0)  |  Import(5)
str(object='') -> string

Return a nice string representation of the object.
If the argument is a string, the return value is the same object.

src/t/a/tasty-flask-app-HEAD/app.py   tasty-flask-app(Download)
 
# Imports modules
from config import PORT, PATH
from shared import app
 
	"""
	inject_object = {
		"path": PATH
	}
	return inject_object

src/b/b/BBot-HEAD/modules/trekbot.py   BBot(Download)
    def __init__(self, server=config.network):
        self.blacklist = []  # Load Blacklist
        with open(os.path.join(config.PATH, 'trekbot', 'blacklist')) as blfile:
            for line in blfile.readlines():
                self.blacklist.append(line.strip('\r\n'))
 
        self.whitelist = []  # Load Whitelist
        with open(os.path.join(config.PATH, 'trekbot', 'whitelist')) as wlfile:
    def write_blacklist(self):
        '''Write the blacklist to the harddrive'''
        self.blconfig = open(os.path.join(config.PATH, 'trekbot', 'blacklist'), 'w')
        for each in self.blacklist:
            self.blconfig.write(each + '\n')
 
    def write_whitelist(self):
        '''Write the whitelist to the harddrive'''
        self.wlconfig = open(os.path.join(config.PATH, 'trekbot', 'whitelist'), 'w')

src/b/b/BBot-HEAD/modules/factoids.py   BBot(Download)
try:
    import json
    factoids = open(config.PATH + 'database.json')
    database = json.load(factoids)
    del factoids
def write_dict():
    '''Write all factoids to the hard drive'''
    with open(config.PATH + 'database.json', 'w') as dbfile:
        dbfile.write(json.dumps(database))
 
def read_dict():
    '''Read factoids from the harddrive keep in RAM'''
    with open(config.PATH + 'database.json') as dbfile:
        database = json.load(dbfile)