日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

python做游戏脚本被监测_一个监视CSDN论坛押宝游戏状态的python脚本

發布時間:2023/12/20 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 python做游戏脚本被监测_一个监视CSDN论坛押宝游戏状态的python脚本 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

# -*- encoding:UTF-8 -*-

#以指定的時間間隔獲取CSDN押寶游戲的結果

#網址:http://community.csdn.net/Games/GamePawn.aspx?id=395&_t_fq8zksda

import sys, urllib

import re

import chardet

def getCharset(string):

#todo : automatic discern the charset

charset = chardet.detect(string)

return charset['encoding']

url = "http://community.csdn.net/Games/GamePawn.aspx?id=395&_t_fq8zksda"

#網頁地址

wp = urllib.urlopen(url)

#打開連接

pattern = "(/d+)[/s/t]+/"

p = re.compile(pattern, re.S | re.M);

#匹配串的字符集

print getCharset(pattern)

#獲取頁面內容

while 1:

content = wp.read()

if not content:

break

content = unicode(content, getCharset(content)).encode("gb2312")

m = p.findall(content)[0:]

desc = ['A: P都沒有',

'B: 紅包里面兩張紅票票打發小朋友',

'C: 多一個月薪水罷了',

'D: 1-3K',

'E: 3-5K',

'F: 5-7K',

'G: 7-10K',

'H: 10-15K',

'I: 15-20K',

'J: 20K以上的哥們,你還是贊助吧(本項不列入本次押寶評分)',

]

#打印當前的勝者

subs = [1, 3, 5, 7, 9, 11, 13, 15, 17, 19]

max = 0;

current_max = 0;

for sub in subs:

print m[sub]

if m[sub] > max:

max = m[sub]

current_max = sub / 2;

desc = ['A: P都沒有',

'B: 紅包里面兩張紅票票打發小朋友',

'C: 多一個月薪水罷了',

'D: 1-3K',

'E: 3-5K',

'F: 5-7K',

'G: 7-10K',

'H: 10-15K',

'I: 15-20K',

'J: 20K以上的哥們,你還是贊助吧(本項不列入本次押寶評分)',

]

winner_desc = "當前勝者是:" + desc[current_max]

print unicode(winner_desc, getCharset(winner_desc))

#關閉

wp.close()

#等待輸入

input()

總結

以上是生活随笔為你收集整理的python做游戏脚本被监测_一个监视CSDN论坛押宝游戏状态的python脚本的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。