摘要: 虚拟环境: 安装虚拟环境 1.通过pip安装虚拟环境: -- pip install virtualenv 2.前往目标文件夹创建纯净虚拟环境: -- virtualenv 虚拟环境名 (py3-env1) 4.终端启动虚拟环境: -- cd py3-env1\Scripts -- activate 阅读全文
posted @ 2022-07-26 19:24 Orientation 阅读(66) 评论(0) 推荐(0)
摘要: 创建用户并设置密码 adduser username #添加用户 passwd username #为用户设置密码 添加文件权限 chmod 777 filename 阅读全文
posted @ 2022-07-25 21:29 Orientation 阅读(627) 评论(0) 推荐(0)
摘要: ddl database define language # 新建数据库 create database if not exists database_name character set 'utf8' # 新建数据表 create table table_name ( id int (7) stu 阅读全文
posted @ 2022-07-24 21:03 Orientation 阅读(28) 评论(0) 推荐(0)
摘要: python 3.x import pymysql conn=pymysql.connect(host,port,user,passwd,database,chartset)cursor=conn.cursor()row_count=cursor.execute('show databases;') 阅读全文
posted @ 2022-07-13 20:06 Orientation 阅读(30) 评论(0) 推荐(0)
摘要: 通过 dir 方法 可以查看 dir(obj) 如果是自定义类生成的对象,可以通过 __dict__ 属性来查看, class Test(): ''' this is document ''' x=1 def __init__(self,name,age): self.name=name self. 阅读全文
posted @ 2022-07-13 10:44 Orientation 阅读(286) 评论(0) 推荐(0)
摘要: socket 实现 tcp server import socket soc=socket.socket() #默认 family=-1,type=-1, proto=-1, fileno=None ''' if fileno is None: if family == -1: family = A 阅读全文
posted @ 2022-07-12 20:00 Orientation 阅读(270) 评论(0) 推荐(0)
摘要: import serial ser= serial.Serial('/dev/ttyAMA0',9600)ser.write('hello world'.encode('ascii'))data_len = ser.inWaiting()ser.read(data_len) 阅读全文
posted @ 2022-07-12 19:28 Orientation 阅读(455) 评论(0) 推荐(0)
摘要: openpyxl 用法实例 import requests import openpyxl import json import time res = requests.request('GET', 'http://1.2.32.2:23/data/getsites') text = res.tex 阅读全文
posted @ 2022-07-12 19:24 Orientation 阅读(36) 评论(0) 推荐(0)
摘要: 运算符 + - * / 1+1.0 = 2.0 5/3=1, 5/3.0=1.6667(python2, C) 5/3=1.6667(python3) 数据类型: 基本类型:(int,float,string,bool,enum) 构造类型:数组类型,结构类型,联合类型 阅读全文
posted @ 2022-05-10 14:12 Orientation 阅读(21) 评论(0) 推荐(0)
摘要: ssh server 配置文件 所在目录 /etc/ssh/sshd_config ,中有个 permitrootlogin 选项,取消注释并修改成yes 阅读全文
posted @ 2022-05-07 00:03 Orientation 阅读(147) 评论(0) 推荐(0)