cygwin 运行窗口程序
首先, 默认安装的cygwin是不能运行窗口程序的
import * from tkinter
Tk()
mainloop()
python3 py.py #py.py内容是上段代码
Traceback (most recent call last):
File "py.py", line , in <module>
Tk()
File "/usr/lib/python3.4/tkinter/__init__.py", line , in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: no display name and no $DISPLAY environment variable
export DISPLAY=:0.0
#或者
export DISPLAY=:
#抑或
export DISPLAY=localhost:12.0
Traceback (most recent call last):
File "py.py", line , in <module>
Tk()
File "/usr/lib/python3.4/tkinter/__init__.py", line , in __init__
self.tk = _tkinter.create(screenName, baseName, className, interactive, wantobjects, useTk, sync, use)
_tkinter.TclError: couldn't connect to display ":0.0"


export DISPLAY=:0.0
startx
$/usr/bin/xterm: Xt error: Can't open display: :0.0
Some products that have been reported to cause problems:
Aventail Connect
Zonealarm PC Firewall from Zonelab
Note: These products may not cause problems in all configurations. However, the Cygwin/X project has neither the time, ability, nor resources to help you correctly configure your third-party software.
xorg-server and xinit, and run startxwin.export DISPLAY=:0.0
startxwin & #后面加上&就可以了继续在cygwin里面输入命令了,不出意外的话应该可以了,而且托盘会有xming的图标,可以从那退出


startxwin &> x-server-log &
export DISPLAY=:0.0
export DISPLAY=:0.0
startxwin &> x-server-log &
cygwin 运行窗口程序的更多相关文章
- vs2010运行C程序时,运行结果窗口一闪而过
摘要:vs2010运行C程序时,运行结果窗口一闪而过; ------------------------------------------------------------ Ctrl F5测试运行 ...
- windows cmd窗口提示“telnet”命令不能内部或外部命令,也不是可运行的程序
windows cmd窗口提示“telnet”命令不能内部或外部命令,也不是可运行的程序 原因:C:\Windows\System32目录下没有telnet.exe,path系统变量的值包含了C:\W ...
- cmd 窗口中运行 Java 程序
1.CMD 命令提示符(Command Processor)(CMD) CMD命令:开始->运行->键入 cmd(在命令行里可以看到系统版本.文件系统版本) 2.对文件夹操作的部分命令 启 ...
- WinServer2008R2 + IIS 7.5 + .NET4.0 经典模式 运行WebAPI程序报404错误的解决方案
在Windows Server 2008 R2系统下,IIS 7.5 + .NET Framework 4.0的运行环境,以经典模式(Classic Mode)部署一个用.NET 4.0编译的 Web ...
- windows批处理运行java程序
明确需求 今天你编了一个java swing版照片查看器,想让计算机上的所有照片默认打开方式都改成你的照片查看器. 使用工具软件 很多工具软件都是不把jre打包到exe中的,这就是说打包之后的exe只 ...
- Cocos2dx集成于windows桌面窗口程序的步骤
2D游戏需要做编辑器,而编辑器总是希望可以复用游戏中的逻辑来运行场景试看效果. 对于cocos2dx开发的程序,这个需求可以描述为: 实现一种方法,在桌面窗口程序中的某个控件上显示cocos2dx的场 ...
- C#:只运行一个程序
一.通过系统事件 1.实现如下: using System; using System.Collections.Generic; using System.Linq; using System.Tex ...
- CentOS6.5 64bit 运行Mono程序
前几日和一技术友聊天,认为转Java好,java可以在Linux下运行,貌似c#不可以哦,就做了个尝试,运行控制台程序和窗口程序(界面编程,Linux下Java好像也比较烦吧) 现在贴环境: 参考:C ...
- QT源码解析(一) QT创建窗口程序、消息循环和WinMain函数
QT源码解析(一) QT创建窗口程序.消息循环和WinMain函数 分类: QT2009-10-28 13:33 17695人阅读 评论(13) 收藏 举报 qtapplicationwindowse ...
随机推荐
- 如何高效的用判断用js判断ie6
用js判断ie6的方法有很多,如: 1. var isIE=!!window.ActiveXObject; var isIE6=isIE&&!window.XMLHttpRequest ...
- Nginx 虚拟主机下支持Pathinfo并隐藏入口文件的完整配置
server { listen 80; server_name zuqiu.com; # 设置你的域名 index index.html index.htm index.php; root D:/wn ...
- (中等) POJ 2886 Who Gets the Most Candies? , 反素数+线段树。
Description N children are sitting in a circle to play a game. The children are numbered from 1 to N ...
- print打印网页相关
作者:zccst 1,CSS <link href="/style/print.css" rel="stylesheet" type="text ...
- 《玩转Bootstrap(基础)》笔记
基本的HTML模板 <!DOCTYPE html> <html lang="en"> <head> <meta charset=" ...
- Led控件
在 WindowMobile 上的模拟LED 显示屏插件 一个简单Led控件 一个经典的控制Led的单片机程序 Led控件(2)——Led显示屏模拟
- UVa 900 - Brick Wall Patterns
题目大意:用1*2的砖头建n*2的墙,问有多少种不同的砖头排列方式?与斐波那契序列相似. #include <cstdio> #define MAXN 60 #define N 50 un ...
- IOS开发中使用CNContact\CNMutableContact 对通讯录增删改查
IOS开发中使用CNContact\CNMutableContact 对通讯录增删改查 首先当然是把CNcontact包含在工程中: @import Contacts; 1.下面是增加联系人的程序段: ...
- 快速搭建LNMP
[centos 6.4 server]系统安装请参考:http://blog.zhuyin.org/748.html1.防火墙设置: iptables -F service iptables save ...
- make 要点简记
make 要点简记 1.隐式推导 make可以自动推导文件及其文件依赖关系后面的命令,所以我们没有必要在每一个.o文件后面都写上类似的命令,因为make 会自动识别并且自动推导命令. objects ...