上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 33 下一页
摘要: 1、数据库操作 1.1增 直接use xxx #如果数据库不存在则创建数据库,如果存在则切换到该数据库下 1.2查 show dbs #查看所有数据库 当你刚刚创建一个数据库,并且shou dbs的时候发现刚刚创建的不在数据库中, MongoDB默认不显示空的数据库,药箱显示,往里面插入一点数据有有 阅读全文
posted @ 2018-01-19 16:57 前方、有光 阅读(942) 评论(0) 推荐(1)
摘要: import requests from bs4 import BeautifulSoup html_doc = """ <html><head><title>The Dormouse's story</title></head> <body> <p class="title"><b>The Dor 阅读全文
posted @ 2018-01-19 13:54 前方、有光 阅读(417) 评论(0) 推荐(0)
摘要: # -*- coding: utf-8 -*- import re import requests session = requests.session() # 第一步,访问51job登录页面 # 请求url: https://login.51job.com/login.php # 请求方式:get 阅读全文
posted @ 2018-01-17 18:50 前方、有光 阅读(3223) 评论(1) 推荐(0)
摘要: from selenium import webdriver from selenium.webdriver import ActionChains from selenium.webdriver.common.by import By from selenium.webdriver.common. 阅读全文
posted @ 2018-01-17 15:52 前方、有光 阅读(303) 评论(0) 推荐(0)
摘要: import requests import re # 一:先获取登陆页面,拿到authenticity_token: # 1 请求的url:https://github.com/login # 2 请求方法:GET # 3 请求头: # User-Agent r1 = requests.get('https://github.com/login', ... 阅读全文
posted @ 2018-01-15 22:03 前方、有光 阅读(1688) 评论(0) 推荐(0)
摘要: # -*- coding: utf-8 -*- import requests from urllib.parse import urlencode # python模仿百度搜索引擎 # keyword = input(">>:").strip() # res = urlencode({"wd": keyword}, encoding="utf-8") # url = "https://www... 阅读全文
posted @ 2018-01-15 22:01 前方、有光 阅读(657) 评论(0) 推荐(0)
摘要: # 简易版爬取校花网视频import requests import re import hashlib import time movie_path = "C:\mp4" #视频存储目录 def get_page(url): ''' 返回一个字符串的网页页面 :param url: :return: ''' try: ... 阅读全文
posted @ 2018-01-15 21:13 前方、有光 阅读(2184) 评论(2) 推荐(0)
摘要: 执行命令: 初次: python manage.py db init python manage.py db migrate python manage.py db upgrade 阅读全文
posted @ 2018-01-14 20:06 前方、有光 阅读(1269) 评论(0) 推荐(0)
摘要: Flask Script扩展提供向Flask插入外部脚本的功能,包括运行一个开发用的服务器,一个定制的Python shell,设置数据库的脚本,cronjobs,及其他运行在web应用之外的命令行任务;使得脚本和系统分开; Flask Script和Flask本身的工作方式类似,只需定义和添加从命 阅读全文
posted @ 2018-01-14 12:11 前方、有光 阅读(336) 评论(0) 推荐(0)
摘要: __author__ = 'admin' from gevent import monkey monkey.patch_all(thread=False) import gevent,time,os from threading import Thread,currentThread from multiprocessing import Process,Pool,current_process... 阅读全文
posted @ 2018-01-14 10:11 前方、有光 阅读(555) 评论(0) 推荐(0)
摘要: <!--done--> SQLAlchemy 一. 介绍 SQLAlchemy是一个基于Python实现的ORM框架。该框架建立在 DB API之上,使用关系对象映射进行数据库操作,简言之便是:将类和对象转换成SQL,然后使用数据API执行SQL并获取执行结果。 pip3 install sqlal 阅读全文
posted @ 2018-01-11 22:30 前方、有光 阅读(398) 评论(0) 推荐(0)
摘要: # -*- coding: utf-8 -*- from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column,Integer,String,Text,ForeignKey,DateTime,UniqueConstraint,Index from sqlalchemy import cre... 阅读全文
posted @ 2018-01-11 20:20 前方、有光 阅读(246) 评论(0) 推荐(0)
摘要: redis安装 阅读全文
posted @ 2018-01-11 17:28 前方、有光 阅读(571) 评论(0) 推荐(0)
摘要: 链接测试↓ 表操作:↓ 阅读全文
posted @ 2018-01-11 15:49 前方、有光 阅读(510) 评论(0) 推荐(0)
摘要: 源码流程: class Flask(_PackageBoundObject): def full_dispatch_request(self): self.try_trigger_before_first_request_functions() try: # ############### 触发re 阅读全文
posted @ 2018-01-09 20:36 前方、有光 阅读(252) 评论(0) 推荐(0)
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 33 下一页