#from instaloader import Instaloader, Profile import traceback import copy import operator import dataset import pandas as pd import networkx as nx #import pysftp import codecs import pyvis import sys import pickle import os import searchconsole from pyvis.network import Network import jieba pname='hhh.rb' db = dataset.connect('sqlite:///'+pname+".db") def destroy_db(): global db try: db.query('drop table tmp') except: traceback.print_exc() table=db['tmp'] #pname='cont' #pname='damanwoo' #pname='drama' #pname='news' #pname='www' #pname='ipromise' #pname='sports' #pname='rumor' #pname='korea' rid=0 def get_css(): fr=codecs.open('jared/data/css.txt','r','utf-8') lines=fr.readlines() content=' '.join(lines) fr.close() return content def modify_file(fname): fr=codecs.open(fname,'r','utf-8') lines=fr.readlines() fr.close() # css=get_css() css='' content_output='' for l in lines: if '
' in l[0:10]: content_output+=l content_output+='\n