
python
时光_Bayzhen
这个作者很懒,什么都没留下…
展开
-
解决回放问题: pysc2 replay ValueError: Unknown game version: Known versions: [‘latest‘].
笔者研究了很久,终于弄明白了。第一眼看上去以为是版本限制,但实际上像下面这样的在cmd执行的方法已经不可再用了。python -m pysc2.bin.play --norender --replay D:\sc2replay\Zerg_2021-09-10-09-21-15.SC2Replay不要再钻进pysc2下面的play或者platform或者bin里面去找版本的代号,哈希码等等。。。。。完全不需要,我这找到一个github上的项目,项目已打包。...原创 2021-09-10 21:49:03 · 1616 阅读 · 0 评论 -
python numpy argsort 白话解释
大家在使用numpy的时候可能遇到这样的代码:argsort()官方给的这个函数的解释是一句有些让人迷惑的话:Returns the indices that would sort an array.返回将对数组进行排序的索引。(官方)这句话就很绕,那么我给大家解释一下:有numpy.argsort()这个样的用法:比如说:a = [1,2,3,4]np.argsort(a)返回是:array([0, 1, 2, 3], dtype=int64)这个返回代表着,从小到大,a[0]&原创 2021-06-21 19:58:38 · 210 阅读 · 0 评论 -
python 二进制字符串 减法
def reduce_binary(a, b): max_len = max(len(a), len(b)) a = a.zfill(max_len) b = b.zfill(max_len) new_binary = '' carry = 0 i = max_len - 1 while i >= 0: s = int(a[i]) - int(b[i]) if s == -1: if c原创 2021-05-27 20:24:37 · 655 阅读 · 0 评论 -
python if 使用 and 节省时间
// An highlighted blockimport timeif __name__ == '__main__': a = 1 b = 2 t1 = time.time() if a == 1 and b==2: for i in range(100000000): c = 0 t2 = time.time() print(t2-t1) t1 = time.time() if a == 0原创 2021-05-15 21:59:41 · 237 阅读 · 0 评论 -
python multiprocessing Pool 多进程有什么用? 看图就知道了
原创 2021-05-15 20:17:42 · 138 阅读 · 0 评论 -
Fatal Python error: init_import_size: Failed to import the site module Python runtime state: initial
Fatal Python error: init_import_size: Failed to import the site modulePython runtime state: initializedTraceback (most recent call last):File “C:\python\python39\lib\site.py”, line 73, in import osFile “C:\python\python39\lib\os.py”, line 29, in from原创 2021-05-10 22:38:04 · 9710 阅读 · 5 评论 -
无法打开python39_d.lib
把python39.lib复制改个名python39_d.lib就好了。原创 2021-05-09 20:18:22 · 1700 阅读 · 1 评论 -
VisualStudio找不到Python.h
找到自己的python安装位置,笔者如下:include文件夹里有Python.h在visual studio2019里面设置:如图就可以了。原创 2021-05-09 09:26:43 · 3391 阅读 · 0 评论 -
Failed building wheel for pycuda
使用清华源安装pycuda失败,原因不明记下自己cuda版本,比如10.2版本记下自己python版本,比如3.8记下自己Windows位数,比如64位前往网址:http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml找到对应pycuda文件,比如:pycuda‑2020.1+cuda102‑cp38‑cp38‑win_amd64.whl下载到本地:比如:C:\Users\你的用户名\Downloads然后到安装位置:输入:pip install C:\原创 2021-01-30 11:48:28 · 3784 阅读 · 5 评论