Centos下运行exe

转载来源:
https://blog.csdn.net/weixin_42877471/article/details/83782485

版权归原作者所有。

1、安装需要的软件包

# yum groupinstall ‘Development Tools‘
# yum install libX11-devel freetype-devel zlib-devel libxcb-devel

2、下载并解压Wine包

# cd /usr/src
# wget http://prdownloads.sourceforge.net/wine/wine-1.7.24.tar.bz2
# tar xjf wine-1.7.24.tar.bz2

备注:1.7.24是开发版,不是稳定版,如果你需要安装稳定版请点此链接下载,方法是一样的。

3、安装Wine

这里使用的是源码编译,执行以下命令开始编译,配置好的话30分钟左右可以完成,配置差点的话可能需要更久的时间,耐心等待。

32位系统

# cd wine-1.7.24/
# ./configure
# make
# make install

64位系统

# cd wine-1.7.24/
# ./configure –enable-win64
# make
# make install

4、检查版本

可以使用下面的命令检查你安装的Wine的版本

32位系统

# wine –version

wine-1.7.24

64位系统

# wine64 –version

wine-1.7.24

5、Wine怎么用

使用如下命令运行你的程序,有些程序可能需要root权限:

wine xxx.exe

树莓派检测CPU温度

代码是Python2代码,适当修改为长输出。可自行改为python3.

代码附赠了CPU负载和内存使用情况

代码引用地址:
https://gist.github.com/582033/b94dc1d4941f63bb28d837fa9c72f08d

#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
显示树莓派cpu温度、使用率及内存使用率
'''

import os
import time

def show_temp():
    file = open("/sys/class/thermal/thermal_zone0/temp")
    temp = float(file.read()) / 1000
    file.close()
    print "Temp: %.1f ℃" %temp


def show_mem():
    mem_cmd = "free -m | grep Mem | awk '{print ($4+$6)/$2}'"
    mem_sur = round(float(os.popen(mem_cmd).read()), 2) * 100
    print "Mem avail: %d%%" % mem_sur


def show_cpu():
    cpu_cmd = "uptime | awk '{print $8,$9,$10,$11,$12}'"
    cpu_used = os.popen(cpu_cmd).read()
    print "Cpu Used: %s" % cpu_used.replace('\n', '')


if __name__ == '__main__':

    while 1:
        show_temp()
        show_cpu()
        show_mem()
        print ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
        time.sleep(2)