Exemplo n.º 1
0
     if choose == '2':
         pass
     if choose == '3':
         pass
     if choose == '4':
         nowYear = time.strftime("%y")
         nowMonth = time.strftime("%m")
         nowDate = time.strftime("%d")
         todayDate = nowYear + nowMonth + nowDate
         import os
         with open("plan.ini", "r+") as f:
             fileContent = f.read()
         if not config_file_has_key_value("plan.ini", todayDate, "plan"):
             # 没有plan的值
             plan = input("请输入今天的目标\n>>>")
             update_config_file_key_value("plan.ini", todayDate, "plan", plan)
         if not config_file_has_key_value("plan.ini", todayDate, "main"):
             main = input("请输入今天的主要目标\n>>>")
             update_config_file_key_value("plan.ini", todayDate, "main", main)
         if not config_file_has_key_value("plan.ini", todayDate, "未完成惩罚") and not config_file_has_key_value("plan.ini", todayDate, "完成奖励"):
             if int(nowDate) % 2 == 0:
                 choose = input("今日为惩罚日,你想自己选择惩罚方式还是由我随机帮你选一个? y|Y for your choose,n|N for random,default [n]\n>>>")
                 if choose in ['y', 'Y']:
                     while 1:
                         choose = input('''
 惩罚方法:
     1.周末Ndj
     2.周末全部时间用来学习,禁止娱乐
     3.周末全部时间用来练习五笔
     4.周末全部时间用来背单词
     5.周末背2000个单词后才可以休息,否则不能进行任意娱乐
Exemplo n.º 2
0
import re
import os
from exp10it import update_config_file_key_value

configIniPath="config.ini"

with open(configIniPath, 'r+') as f:
    content = f.read()
#下面用于设置web后台口令及将web后台相关表[session机制,登录数据等属于django功能中要建立的表]存储到数据库
#os.chdir("pannel")
if re.search(r"finish_web_setting", content):
    pass
else:
    os.system("pip3 install Django==1.10.3")
    os.system("python3 pannel/manage.py migrate")
    os.system("python3 pannel/manage.py createsuperuser")
    update_config_file_key_value(configIniPath, 'default', 'finish_web_setting', 1)

os.system("python3 pannel/manage.py runserver 0.0.0.0:8000")


Exemplo n.º 3
0
from scrapy.spiders import Spider
from exp10it import CONFIG_INI_PATH
from exp10it import get_key_value_from_config_file
from exp10it import update_config_file_key_value

try:
    SPLASH_URL = eval(
        get_key_value_from_config_file(CONFIG_INI_PATH, 'default',
                                       'splash_url'))
except:
    print(
        "make sure you have start your scrapy_splash service,if not,do it now")
    SPLASH_SERVER = input(
        "Please input your scrapy_splash server ip address\n:>")
    SPLASH_URL = "http://" + SPLASH_SERVER + ":8050"
    update_config_file_key_value(CONFIG_INI_PATH, 'default', 'SPLASH_URL',
                                 "'" + SPLASH_URL + "'")

try:
    IPProxyPoolUrl = eval(
        get_key_value_from_config_file(CONFIG_INI_PATH, 'default',
                                       'ipproxypoolurl'))
except:
    print("make sure you have start your IPProxyPool service,if not,do it now")
    IPProxyPoolServer = input(
        "Please input your IPProxyPool server ip address\n:>")

    IPProxyPoolUrl = "http://" + IPProxyPoolServer + ":8000/?types=0&count=50"
    update_config_file_key_value(CONFIG_INI_PATH, 'default', 'IPProxyPoolURL',
                                 "'" + IPProxyPoolUrl + "'")

BOT_NAME = 'crawler'
Exemplo n.º 4
0
import re
import os
from exp10it import update_config_file_key_value
from exploit import CONFIG_INI_PATH

with open(CONFIG_INI_PATH, 'r+') as f:
    content = f.read()
#下面用于设置web后台口令及将web后台相关表[session机制,登录数据等属于django功能中要建立的表]存储到数据库
#os.chdir("pannel")
if re.search(r"finish_web_setting", content):
    pass
else:
    os.system("pip3 install Django==1.10.3")
    os.system("python3 pannel/manage.py migrate")
    os.system("python3 pannel/manage.py createsuperuser")
    update_config_file_key_value(CONFIG_INI_PATH, 'default',
                                 'finish_web_setting', 1)

os.system("python3 pannel/manage.py runserver 0.0.0.0:8000")