摘要:
code >>> import sys >>> sys.version_info sys.version_info(major=3, minor=7, micro=4, releaselevel='final', serial=0) >>> 阅读全文
摘要:
code pip3 install mitmproxy 阅读全文
摘要:
os.remove() 方法用于删除指定路径的文件。如果指定的路径是一个目录,将抛出OSError。 code #!/usr/bin/python3 import os, sys # 列出目录 print ("目录为: %s" %os.listdir(os.getcwd())) # 移除 os.re 阅读全文
摘要:
os.rename() 方法用于命名文件或目录,从 src 到 dst,如果dst是一个存在的目录, 将抛出OSError。 code #!/usr/bin/python3 import os, sys # 列出目录 print ("目录为: %s"%os.listdir(os.getcwd())) 阅读全文
摘要:
Code import unittest class SimplisticTest(unittest.TestCase): def test(self): a = 'a' b = 'a' self.assertEqual(a, b) Output macname@MacdeMacBook-Pro c 阅读全文
摘要:
client.py from socket import * import os def main(): # 建立套接字 tcp_socket = socket(AF_INET, SOCK_STREAM) # 接收用输入的服务器端的ip和端口 tcp_ip = input("请输入ip:") tcp 阅读全文
摘要:
code #coding=utf-8 import os import random import time def test(book_type,book_id): #获取指定长度的随机数字 #支持16进制数的最大的长度为9 random_str_length=random.randint(3,6 阅读全文
摘要:
code Traceback (most recent call last): File "test.py", line 190, in <module> cursor.execute(sql) sqlite3.OperationalError: near "s": syntax error cod 阅读全文
摘要:
code import sys,os sys.path.append("/".join(os.path.dirname(os.path.abspath(__file__)).split("/")[:-1])+'/lib') from selenium import webdriver import 阅读全文
摘要:
code import sys,os sys.path.append("/".join(os.path.dirname(os.path.abspath(__file__)).split("/")[:-1])+'/lib') from selenium import webdriver import 阅读全文
摘要:
code import sys,os sys.path.append("/".join(os.path.dirname(os.path.abspath(__file__)).split("/")[:-1])+'/lib') from selenium import webdriver import 阅读全文
摘要:
code #!/usr/bin/python3 import smtplib from email.mime.text import MIMEText from email.header import Header from email.mime.multipart import MIMEMulti 阅读全文
摘要:
code #!/usr/bin/python3 import smtplib from email.mime.text import MIMEText from email.header import Header # 第三方 SMTP 服务 mail_host="smtp.mxhichina.co 阅读全文
摘要:
问题描述: 在阿里云的自带centos上运行python manage.py runserver的时候报错: django.core.exceptions.ImproperlyConfigured: SQLite 3.8.3 or later is required (found 3.7.17). 阅读全文
摘要:
code from selenium.webdriver.common.action_chains import ActionChains from selenium import webdriver driver = webdriver.Chrome() asleep(driver) driver 阅读全文
摘要:
code from selenium.webdriver.common.action_chains import ActionChains from selenium import webdriver driver = webdriver.Chrome() asleep(driver) driver 阅读全文
摘要:
code import sys,os sys.path.append("/".join(os.path.dirname(os.path.abspath(__file__)).split("/")[:-1])+'/lib') from selenium import webdriver import 阅读全文
摘要:
code pip3 install lxml 阅读全文
摘要:
code #安装pipenv pip3 install pipenv #安装虚拟环境 pipenv install #进入虚拟环境 pipenv shell #查看当前环境依赖 pip3 list #安装包 pipenv install flask #卸载包 pipenv uninstall fla 阅读全文
摘要:
code python -V pip -V 阅读全文
摘要:
python socket 实现点对点聊天,包括文字,语音,无声视频 client #!/usr/bin/env python # -*- encoding: utf-8 -*- ''' @File : newclient.py @Time : 2020/01/13 14:17:16 @Author 阅读全文
摘要:
code class ListNode: def __init__(self,x): self.val=x self.next=None def listToListNode(input): # Generate list from the input numbers = [int(x) for x 阅读全文
摘要:
code pytest pytest_lean2.py -o log_cli=true -o log_cli_level=INFO 阅读全文
摘要:
code import sqlite3 cx = sqlite3.connect("/Users/macname/Downloads/temp/ibook/db.sqlite3") if(cx): print("success") for i in range(1,70): cx.execute(" 阅读全文
摘要:
code open -a Google\ Chrome 阅读全文
摘要:
code from flask import Flask, send_from_directory import os cur_dir=os.path.dirname(__file__) app = Flask(__name__) @app.route("/download") def index( 阅读全文
摘要:
code http://www.htmleaf.com/js/jquery/jquery-1.9.1.html 阅读全文
摘要:
Index.html <!DOCTYPE html> <html> <head> <link href="/static/css/style.css" rel="stylesheet"> <script src="http://code.jquery.com/jquery-2.0.3.min.js" 阅读全文
摘要:
index.html <!DOCTYPE html> <html> <head> <link href="/static/css/style.css" rel="stylesheet"> <script src="https://cdnjs.cloudflare.com/ajax/libs/reac 阅读全文
摘要:
接收json class Root(object): @cherrypy.expose @cherrypy.tools.json_in() def index(self): data = cherrypy.request.json print(data) 返回json import cherrypy 阅读全文
摘要:
code import cherrypy class MyCookieApp(object): @cherrypy.expose def set(self): cookie = cherrypy.response.cookie cookie['cookieName'] = 'cookieValue' 阅读全文
摘要:
code cherrypy.log("hello there") test.py import logging import logging.config import cherrypy logger = logging.getLogger() db_logger = logging.getLogg 阅读全文
摘要:
tut12.py import random import string import cherrypy class StringGenerator(object): @cherrypy.expose def index(self): return "Hello world!" @cherrypy. 阅读全文
摘要:
目录结构 index.html <!DOCTYPE html> <html> <head> <link href="/static/css/style.css" rel="stylesheet"> <script src="http://code.jquery.com/jquery-2.0.3.mi 阅读全文
摘要:
目录结构 code import os, os.path import random import string import cherrypy class StringGenerator(object): @cherrypy.expose def index(self): return """<h 阅读全文
摘要:
This is why /static/css/style.css is found in public/css/style.css code import os, os.path import random import string import cherrypy class StringGen 阅读全文
摘要:
code import random import string import cherrypy @cherrypy.expose class StringGeneratorWebService(object): @cherrypy.tools.accept(media='text/plain') 阅读全文
摘要:
code import random import string import cherrypy class StringGenerator(object): @cherrypy.expose def index(self): return """<html> <head></head> <body 阅读全文
摘要:
code import random import string import cherrypy class StringGenerator(object): @cherrypy.expose def index(self): return """<html> <head></head> <body 阅读全文
摘要:
code import random import string import cherrypy class StringGenerator(object): @cherrypy.expose def index(self): return "Hello world!" @cherrypy.expo 阅读全文