摘要:
环境: Windows 2012 R2 SQL Server 2014 通过MSSQL查询数据库服务器时间,报错如下: pyodbc.ProgrammingError: ('42000', '[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL 阅读全文
摘要:
# string to bytes # 方法一:直接复制bytes类型 b'<str>' b = b'Hello World' print(type(b)) print(b) # 方法二:转换 s = 'Hello World' b = bytes(s,encoding='utf-8') print 阅读全文
摘要:
运行环境 Windows 2012 R2 1. Windows需要打开WinRM服务,Server系统默认打开,默认端口5985 # WinRM服务查看 PS C:\Users\Administrator> winrm enumerate winrm/config/listener Listener 阅读全文
摘要:
# 获取服务信息 PS C:\Users\Administrator> Get-Service win* Status Name DisplayName Stopped WinHttpAutoProx... WinHTTP Web Proxy Auto-Discovery Se... Running 阅读全文
摘要:
使用subprocess模块 import subprocess # 防火墙服务存在关闭状态 child1 = subprocess.Popen(["systemctl status firewalld | grep Active"], stdout=subprocess.PIPE, shell=T 阅读全文
摘要:
Linux执行完命令之后默认会有一个返回值 # ls app backupconfig.json Doc manage.py __pycache__ settings.py # echo $? 0 错误对照表 "OS error code 1: Operation not permitted" "O 阅读全文
摘要:
- 错误代码如下: pip install pyodbc Looking in indexes: http://172.16.1.250/repository/douban/simple Collecting pyodbc Downloading http://172.16.1.250/reposi 阅读全文
摘要:
Python 通过pyodbc 连接SQL Server 数据库驱动 安装环境 cat /etc/redhat-release CentOS Linux release 7.7.1908 (Core) 微软官网 https://docs.microsoft.com/zh-cn/sql/connect 阅读全文
摘要:
方法一:Key Value 直接获取 databases = {1: 'Student', 2: 'School'} for k,v in databases.items(): print(k,v) 1 Student 2 School 方法二:通过循环Key获取Value databases = 阅读全文
摘要:
用法:isinstance(变量,list) li = [1,2,3] print(type(li)) if isinstance(li,list): print("This is a List") <class 'list'> This is a List 阅读全文