首页    新闻    小组    威客    人才    下载    博客    代码贴    在线编程    论坛
代码贴随便看看Python
print("hello")
阅读全部 | wangyilin 贴于 2021年5月16日 12:41     hide bbsi
https://bbs.bccn.net/member.php?action=activate_bccn_uid=999054_bccn_id=mpZlUs
阅读全部 | xincheng1984 贴于 2021年4月14日 13:58     hide bbsi
# -*- coding:utf-8 -*-

import socket
from time import ctime, sleep
import threading


class ChatRoomPlus:
    def __init__(self):
        # 全局参数配置
        self.encoding = "utf-8"  # 使用的编码方式
        self.broadcastPort = 7788   # 广播端口
......................
阅读全部 | 静夜思 贴于 2021年4月6日 20:29     hide bbsi
import pickle
import os

datafile = 'person.data'
line = '======================================='
message = '''
=======================================
Welcome bookmark:
    press 1 to show list
    press 2 to add pepole
    press 3 to edit pepole
    press 4 to delete pepole
......................
阅读全部 | metersbilly 贴于 2021年3月24日 09:54     hide bbsi
import math
#dot=[[1,1],[3,2],[5,3],[4,1],[2,3],[1,4]]
dot=[[2,1],[4,8],[1,2],[3,6]]
def fang_cheng(dot):
    fc=[]
    l=len(dot)
    for i in range(l) :
      
      for j in range(i+1,l):
        
        a=dot[j][0]-dot[i][0]
        b=dot[i][1]-dot[j][1]
......................
阅读全部 | qunxingw 贴于 2021年3月23日 11:54     hide bbsi
def float_(n):
  if n==0:
    return 0
  len=0
  s=n
  while(n>=1):
    n=n/10
    
    len=len+1
    t=n
  return s/(10**len-1) 

......................
阅读全部 | qunxingw 贴于 2021年3月15日 00:13     hide bbsi
from urllib3 import *
from re import *
#禁止显示警告信息
disable_warnings()
#下载url对应的web页面
def download(url):
    result = http.request('GET',url)
    #获取web页面对应的HTML代码
    htmlStr = result.date.decode('uft-8')
    return htmlStr
#分析HTML代码
def anayse (htmlStr):
......................
阅读全部 | j18293838448 贴于 2021年3月4日 13:49     hide bbsi
from urllib3 import *
from re import *
http =PoolManager()
disable_warnings()
#下载HTML文件
def download(url):
    result = htp.request('GET',url)
    #讲下载的HTML文件代码问uft-8格式解码成字符串
    htmlStr = result.date.decode('uft-8')
    #输出当前抓取的HTML代码
    print(htmlStr)
    result htmlStr
......................
阅读全部 | j18293838448 贴于 2021年3月3日 15:54     hide bbsi
def twonums(nums,target):
    hashmap=dict()
    for i in range(len(nums)):
        if hashmap.get(target-nums[i]) is  None:
             hashmap[nums[i]]=i
            
        else:
            return  [hashmap.get(target-nums[i]),i]
    
if __name__=='__main__':
    nums=[4,3,7,9]
    n=twonums(nums,11)
......................
阅读全部 | qunxingw 贴于 2021年2月15日 09:44     hide bbsi
#Python代码以实例展示求解方程的根。
import  math
def f(x):
    return math.pow(x,3)-9*x+1       
def fd(x):
    return  3*math.pow(x,2)-9

def newton_method(n,x):
    times = n
    next_x = 0
    y= f(x)
    yd = fd(x)
......................
阅读全部 | qunxingw 贴于 2021年1月19日 09:56     hide bbsi
上一页 12 13 14 15 16 17 18 19 20 21 下一页