摘要: import sys from PyQt5.QtWidgets import (QWidget, QToolTip, QPushButton, QApplication) from PyQt5.QtGui import QFont class Example(QWidget): def __init__(self): super().__init__() self.initUI() def ini 阅读全文
posted @ 2019-10-26 11:28 华小电 阅读(577) 评论(0) 推荐(0)
摘要: The QtCore module contains the core non-GUI functionality. This module is used for working with time, files and directories, various data types, strea 阅读全文
posted @ 2019-10-26 09:45 华小电 阅读(621) 评论(0) 推荐(0)
摘要: 运行python文件的时候报错: SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3:truncated \UXXXXXXXX escape 引起这个错误的原因就是转义的问题。 举 阅读全文
posted @ 2019-10-07 09:24 华小电 阅读(6078) 评论(1) 推荐(1)
摘要: 使用python中的ctypes模块可以很方便的调用windows的dll(也包括linux下的so等文件) 引入ctypes库 有两种方法 加载DLL stdcall调用约定:两种加载方式 cdecl调用约定:也有两种加载方式 引入ctypes库的方法不同,对应不同的加载DLL方式 第一种: 第二 阅读全文
posted @ 2019-10-07 09:16 华小电 阅读(5499) 评论(0) 推荐(0)
摘要: 保存到文本文件numpy.savetxt()numpy.loadtxt() 保存一个数组到二进制文件(npy文件) numpy.save() 保存多个数组到二进制文件(npz文件) numpy.savez() 阅读全文
posted @ 2019-10-06 10:13 华小电 阅读(2251) 评论(0) 推荐(0)
摘要: 读txt文件 python常用的读取文件函数有三种read()、readline()、readlines() read() #一次性读取文本中全部的内容,以字符串的形式返回结果 readline() #只读取文本第一行的内容,以字符串的形式返回结果 readlines() #读取文本所有内容,并且以 阅读全文
posted @ 2019-10-06 10:11 华小电 阅读(14488) 评论(0) 推荐(1)
摘要: import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt # function that returns dz/dt def model(z,t,u): x = z[0] y = z[1] dxdt = (-x + u)/2.0 dydt = (-... 阅读全文
posted @ 2019-06-28 15:03 华小电 阅读(521) 评论(0) 推荐(0)
摘要: import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt # function that returns dz/dt def model(z,t): dxdt = 3.0 * np.exp(-t) dydt = -z[1] + 3 dzdt = [dxdt... 阅读全文
posted @ 2019-06-28 15:02 华小电 阅读(463) 评论(0) 推荐(0)
摘要: import numpy as np from scipy.integrate import odeint import matplotlib.pyplot as plt # function that returns dy/dt def model(y,t): # u steps from 0 to 2 at t=10 if t<10.0: u = 0 ... 阅读全文
posted @ 2019-06-28 14:59 华小电 阅读(670) 评论(0) 推荐(0)
摘要: An example of using ODEINT is with the following differential equation with parameter k=0.3, the initial condition y0=5 and the following differential 阅读全文
posted @ 2019-06-28 14:53 华小电 阅读(1262) 评论(0) 推荐(0)