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 ...
随机推荐
- jQuery中的attr()和prop()使用
总结:除了checked.seleted这样的属性推荐用prop()外,其他的随意都可以. 原因如下: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML ...
- UIStepper 缩放:UI的使用
// 实现文件:声明在对应的.h文件.继承至UIViewControllor - (void)viewDidLoad { [super viewDidLoad]; // 按钮 self.stp = [ ...
- elasticSearch indices VS type
elasticSearch 的中文文档 http://es.xiaoleilu.com/010_Intro/05_What_is_it.html https://www.elastic.co/blog ...
- HDU 4044 GeoDefense
树形DP,和背包差不多.dp[now][x]表示now这个节点的子树上,花费为x的时候,获得的最大防御能力(保证敌方HP<=0) #include<cstdio> #include& ...
- LPC1788的内部EEPROM使用
Lpc1788内置有eeprom 使用代码 #ifndef __E2PRONINCHIP_H_ #define __E2PROMINCHIP_H #include "common.h&quo ...
- MIPI-1
未来的产品都将朝着移动的方向发展,例如智能手机.数码相机.摄像机.平板电脑.媒体播放器.游戏机等,这些产品需要能执行多任务,包括处理多个不同的传感器如麦克风.图像传感器.磁罗盘.三轴加速度计和精细的触 ...
- Memcached源码分析之thread.c
/* * 文件开头先啰嗦几句: * * thread.c文件代表的是线程模块.但是你会看到这个模块里面有很多其它方法, 例如关于item的各种操作函数,item_alloc,item_remove,i ...
- Thinking in scala (3)----求平方根
采用“牛顿法”求一个数的平方根 object sqrt { def main(args:Array[String])={ println( sqrt(args(0).toDouble)) } def ...
- Django中扩展Paginator实现分页
Reference:https://my.oschina.net/kelvinfang/blog/134342 Django中已经实现了很多功能,基本上只要我们需要的功能,都能够找到相应的包.要在Dj ...
- 解决IE增强配置的问题
windows2003上: win 2008上, 其实ie8就是在2008上的 为所有用户启用 IE ESC 关闭所有 Internet Explorer 的实例. 单击"开始", ...