<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Windows :: 标签 :: yafeng 的博客</title>
    <link>https://yafengabc.github.io/tags/windows/index.html</link>
    <description></description>
    <generator>Hugo</generator>
    <language>zh-cn</language>
    <lastBuildDate>Sat, 19 Sep 2026 16:30:07 +0800</lastBuildDate>
    <atom:link href="https://yafengabc.github.io/tags/windows/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Nim 入门之基于对话框的简单的GUI程序的编写</title>
      <link>https://yafengabc.github.io/cnblogs/p17229429/index.html</link>
      <pubDate>Sat, 18 Mar 2023 09:55:00 +0800</pubDate>
      <guid>https://yafengabc.github.io/cnblogs/p17229429/index.html</guid>
      <description>最近Golang玩的很嗨，现代的C语言不是盖的。唯一有点不爽的就是golang是专为高并发设计的，每次启动都一堆线程。在htop下看着很不爽。有没有一种写起来爽，又是编译型语言，速度也可以的语言呢？&#xA;当然有，Nim算是其中之一吧。并且这个语言比较像Python，也是缩进语法的语言。先来个例子感受下语法：&#xA;import time def fib(n): if n==0: return 0 if n==1: return 1 return fib(n-1)+fib(n-2) t=time.time() print(fib(40)) print(time.time()-t) 错了错了，这是python。下边才是Nim&#xA;import times proc fib(n:int):int= if n==0: return 0 if n==1: return 1 return fib(n-1)+fib(n-2) var t=times.cpuTime() echo fib(40) echo times.cputime()-t 可以看到是不是有点像Golang跟python的结合体？&#xA;顺便贴一下测试结果：&#xA;[yafeng@SongSrv fibn]$ python fib.py 102334155 69.87282729148865 [yafeng@SongSrv fibn]$ pypy3 fib.py 102334155 13.181118726730347 [yafeng@SongSrv fibn]$ go run fib.go 102334155 1.237680831s [yafeng@SongSrv fibn]$ g++ fib.cpp &amp;&amp; ./a.out 102334155 1.99962 sec [yafeng@SongSrv fibn]$ g++ -O3 fib.cpp &amp;&amp; ./a.out秒， 102334155 0.373478 sec [yafeng@SongSrv fibn]$ nim r fib.nim 102334155 3.16008495 [yafeng@SongSrv fibn]$ nim -d:release r fib.nim 102334155 1.067569256 [yafeng@SongSrv fibn]$ nim -d:danger r fib.nim 102334155 0.017291094 python 70秒，pypy 13秒，go 1.2秒，g++不优化2秒，优化0.3秒。</description>
    </item>
    <item>
      <title>Python64&#43;win10_64&#43;cython&#43;msys2(ming64)踩坑记</title>
      <link>https://yafengabc.github.io/cnblogs/p11399939/index.html</link>
      <pubDate>Mon, 26 Aug 2019 15:56:00 +0800</pubDate>
      <guid>https://yafengabc.github.io/cnblogs/p11399939/index.html</guid>
      <description>一直在linux下用python，一直妥妥的，从没想过在windows下编译cython模块，直到昨天……&#xA;过程是曲折的，解决方法是简单的，时间不多，长话短说，直接先来个传送门：&#xA;https://www.jianshu.com/p/50105307dea5&#xA;这里的步骤是可以的，因为我用的msys2，所以过程有一点点曲折，下边补充说明一下：&#xA;msys2算是个windows下的linux系统，里边一共包含了3套工具链，&#xA;比如安装GCC，可以直接安装gcc这个包，也可以安装mingw-w64-i686-gcc或者mingw-w64-x86_64-gcc&#xA;这三个包不同之处在于，gcc是属于msys2系统本身的工具链，如果编译软件，会连接到/usr/lib下，也就是虽然生成的是exe，但是是没法离开msys2运行的&#xA;而mingw-w64-i686-gcc与mingw-w64-x86_64-gcc实际上是个交叉工具链，编译出来的exe是只依赖宿主系统的库的，所以可以直接在windows系统下运行的&#xA;甚至只要吧msys2下的mingw64/bin目录加到系统系统变量，是可以随便调用的。&#xA;python配合msys2的使用方式：&#xA;python也可以有3种安装方式，&#xA;1，直接从python官方下载安装包安装，这是最普遍的做法，跟msys2完全没关系，可以直接通过系统环境变量调用相应的mingw32或者mingw64编译器，编译自己的包&#xA;2，在msys2直接安装python，配合msys2的gcc，这样类似直接在linux安装gcc python，最方便，编译连接时也不需要指定路径，类似linux下的体验，缺点是编译生成的exe文件无法离开msys2运行&#xA;3，安装mingw-w64-x86_64-gcc mingw-w64-x86_64-python这种工具链下的包，这个其实跟1类似，可以编译直接在系统下运行的exe，也可以直接在msys2下使用。&#xA;因为我系统下已经安装了python3 64bit，并且安装了大量的包，所以装完msys2以后，直接安装mingw-w64-x86_64-gcc就可以在pyhon3中使用这个编译器了。&#xA;pacman -S mingw-w64-x86_64-gcc 然后把mingw64加到系统环境变量比如我msys2安装在E:\linux（没错我伪装成linux了哈）下，系统环境变量就加一条E:\linux\mingw64\bin。&#xA;根据传送门的教程：在python安装目录C:\Program Files\Python\Lib\distutils中新建distutils.cfg文件，内容如下：&#xA;[build] compiler=mingw32 [build_ext] compiler=mingw32 注意，这地方是没错的，不要因为是mingw64就写mingw64，写mingw32是对的。&#xA;这时候，编译一个cython程序，会报VC版本1900 1906之类，根据教程这么改：&#xA;三、修改cygwinccompiler.py文件&#xA;进入python安装目录C:\Program Files\Python\Lib\distutils中，修改cygwinccompiler.py文件，添加以下内容到get_msvcr()函数（用于解决ValueError: Unknown MS Compiler version 1900错误）。&#xA;elif msc_ver == &#39;1900&#39;: # Visual Studio 2015 / Visual C++ 14.0 # &#34;msvcr140.dll no longer exists&#34; return [&#39;vcruntime140&#39;] 因为我这报的是1906，所以就改成了&#xA;elif msc_ver == &#39;1906&#39;: # Visual Studio 2015 / Visual C++ 14.0 # &#34;msvcr140.dll no longer exists&#34; return [&#39;vcruntime140&#39;] 这一步一定要根据实际版本改。</description>
    </item>
  </channel>
</rss>