コード例 #1
0
ファイル: tools.py プロジェクト: amazingcosmos/BCspider
def count_user(file_path = './filter/user_next.txt'):
    total_user = []
    users = BCspider.read_from_txt(file_path , ' ', 0)
    for line in users:
        total_user += line.split('$||$')
        total_user = list(set(total_user))
    return len(total_user)
コード例 #2
0
ファイル: tools.py プロジェクト: amazingcosmos/BCspider
def get_user_from_next(file_path):
    """
    """
    user_todo = BCspider.read_from_txt(file_path, '$||$', 'all')
    user_todo = list(set(user_todo))
    BCspider.write_to_txt(user_todo, './filter/user_todo.txt')
コード例 #3
0
ファイル: tools.py プロジェクト: amazingcosmos/BCspider
def get_user_from_filter(file_path , index_from, index_to):
    """
    """
    user_todo = BCspider.read_from_txt(file_path, '$||$', 0)[index_from:index_to]
    BCspider.write_to_txt(user_todo, file_path + 'user_todo.txt')