首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看Python
import turtle
import random
game = turtle.Screen()
turtle.speed(0)
turtle.bgcolor('black')
turtle.color('white')
turtle.pensize(4)
acc_ext = 0
x=10
turtle.penup()
turtle.goto(0,-x)
turtle.pendown()
......................
阅读全部 | hefuchun 贴于 2020年2月7日 10:39     hide bbsi
import requests
from pyquery import PyQuery as pq
from prettyprinter import cpprint
import json
from urllib.parse import urlencode
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
import time
import csv
import datetime
......................
阅读全部 | xiexiejia 贴于 2019年12月13日 19:35     hide bbsi
#!-*- coding:utf-8 -*-
# @author:      dwcai
# @contact:     1510336267.com
# @software:    PyCharm
# @file:        weather_query.py
# @time:        2019-12-05 22:59
# @desc:        查询天气
# --------------------- sep ---------------------
import requests
import json


......................
阅读全部 | dwcai 贴于 2019年12月6日 00:13     hide bbsi
class BookInfoManager(models.Manager):
    """图书模型管理器类"""
    # 1.改变查询的结果集
    def all(self):
        # 1.调用父类的all,获取所有数据
        books = super().all()
        # 2.对数据进行过滤
        books = books.filter(isDelete=False)
        # 3.返回books
        return books

    # 2.封装函数:操作模型类对应的数据表(增删改查)
......................
阅读全部 | fightingboys 贴于 2019年9月17日 10:31     hide bbsi
#######################################################################
# Copyright (C)                                                       #
# 2016-2018 Shangtong Zhang(zhangshangtong.cpp@gmail.com)             #
# 2016 Kenta Shimada(hyperkentakun@gmail.com)                         #
# Permission given to modify the code as long as you keep this        #
# declaration at the top                                              #
#######################################################################

import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
......................
阅读全部 | ssrww000 贴于 2019年9月5日 19:51     hide bbsi
import requests
import json


list1=['day','week','wea','tem','tem1','tem2','win','win_speed','air_level','air_tips']                                                         list2=['','','天气: ','温度: ','最高温度: ','最低温度: ','风向: ','风速: ','空气质量: ','建议: ']

def show(days):
    for i in range(10):
        r=str(list2[i])+str(days[list1[i]])
        print(r)

def show2(days):
......................
阅读全部 | fighting910 贴于 2019年7月25日 19:15     hide bbsi
import urllib2
f=urllib2.urlopen(raw_input("Please enter the URL:"))
ff=open(raw_input("Please enter the filename:"),"w+")

for x in range(1,1000):
       s=f.read()
       ff.write(s)
ff.close()
阅读全部 | cstdio 贴于 2019年4月4日 17:59     hide bbsi
import urllib2
f=urllib2.urlopen(raw_input("Please enter the URL:"))
s=f.read()
ff=open(raw_input("Please enter the filename:"),"w+")
ff.write(s)
ff.close()
阅读全部 | cstdio 贴于 2019年2月28日 17:53     hide bbsi
#coding=utf-8
from __future__ import print_function

#利用泰勒公式计算星期几
#w=y+[y/4]+[c/4]-2c+[26(m+1)/10]+d-1 
def getweek(year,month,day):
    #w        #星期
    #c        #世纪-1 YYYY的头两位
    #y        #年份   YYYY的后两位
    #m        #月份 >=3 1月 2月看成上年的13月 14月
    #d=day    #日
    if month>=3: 
......................
阅读全部 | wp231957 贴于 2019年2月27日 15:05     hide bbsi
from __future__ import print_function
import socket
import sys
import os

filename=sys.argv[1]
txt=open(filename,"rb+")
filesize=os.path.getsize(filename)
i=1
while i<=filesize:
  data=txt.read(1)
  print ("%4s"%str(hex(ord(data)))+' ',end='')
......................
阅读全部 | wp231957 贴于 2019年2月26日 14:00     hide bbsi
上一页 15 16 17 18 19 20 21 22 23 24 下一页