Ⅰ 如何解決Mac版關於python3.5.X的Tcl/Tk 的警告
ActiveTcl Downloads
從這里下載Tcl試試
下載8.6.4版本還會報錯,我又試著裝了下8.5.18,重啟IDLE便沒有提示不穩定了。
而且,也可以列印中文了:
<img src="https://pic2.mg.com/50/_hd.png" data-rawwidth="697" data-rawheight="755" class="origin_image zh-lightbox-thumb" width="697" data-original="https://pic2.mg.com/_r.png">
原因如下(google而來):
Stan W writes (NB. edited for brevity):
Over the last couple of days I have started using your great book with my two sons (13 and 15 years old).I'm reaching out to you with the following question because I have noticed other people asking about the same issue online, withat least one mentioning your book, so I think you posting the question and answer to your blog might help other people in additionto me and my sons.
We are using Mac OSX and have installed Python 3.3.3 from python.org, and are getting this message when opening IDLE:
"WARNING: The version of Tcl/Tk (8.5.9) in use may be unstable. Visit IDLE and tkinter with Tcl/Tk on Mac OS X forcurrent information."
I have installed "Mac OS X 64-bit/32-bit Installer (3.3.3) for Mac OS X 10.6 and later" (file: python-3.3.3-macosx10.6.dmg) andinstalled the "ActiveTcl 8.6.1 for Mac OS X (10.5+, x8664/x86)" (file: ActiveTcl8.6.1.1.297588-macosx10.5-i386-x8664-threaded),but IDLE keeps showing the same error message.
Thank you very much for any help you can provide!
I'm not convinced ActiveTcl 8.6.1 is the right version to install - I suspect rather than installing the latest and greatest, you should be using version 8.5.15.0. Python (and thus IDLE) will probably be using the latest 8.5 version of Tcl/Tk (i.e. 8.5.x) — you're installing a completely different version (8.6), which it's not looking for at all. Hence even though you think you've re-installed, you'll still be getting the same error message.
Hope that helps.
Ⅱ 現在用的一款軟體時tcl/tk和c++寫的,但我修改了.cc文件後,整個軟體不受影響,
可執行程序的運行與代碼沒有關系,代碼修改後只有重新編譯生成可執行程序,修改的內容才會生效!
Ⅲ 怎麼在linux上安裝tcl tk
tcl
[user@localhost 桌面]$ ls tcl8.5.9-src.tar.gz
tcl8.5.9-src.tar.gz
[user@localhost 桌面]$ su
密碼:
[root@localhost 桌面]# cp tcl8.5.9-src.tar.gz /usr/local/src/
[root@localhost 桌面]# cd /usr/local/src/
[root@localhost src]# tar -zxvf tcl8.5.9-src.tar.gz
[root@localhost src]# cd tcl8.5.9/
[root@localhost tcl8.5.9]# cd unix/
[root@localhost unix]# ./configure --prefix=/usr/local/tcl/ --enable-shared
[root@localhost unix]# make
[root@localhost unix]# make install
[root@localhost unix]# /usr/local/tcl/bin/tclsh8.5
% exit
[root@localhost unix]#
tk
[user@localhost 桌面]$ ls tk8.5.9-src.tar.gz
tk8.5.9-src.tar.gz
[user@localhost 桌面]$ su
密碼:
[root@localhost 桌面]# cp tk8.5.9-src.tar.gz /usr/local/src/
[root@localhost 桌面]# cd /usr/local/src/
[root@localhost src]# tar -zxvf tk8.5.9-src.tar.gz
[root@localhost src]# cd tk8.5.9/
[root@localhost tk8.5.9]# cd unix/
[root@localhost unix]# ./configure --prefix=/usr/local/tk/ --with-tcl=/usr/local/tcl/lib/ --enable-shared
[root@localhost unix]# make
[root@localhost unix]# make install
[root@localhost unix]# /usr/local/tk/bin/wish8.5
/usr/local/tk/bin/wish8.5: error while loading shared libraries: libtcl8.5.so: cannot open shared object file: No such file or directory
[root@localhost unix]# ln -s /usr/local/tcl/lib/libtcl8.5.so /usr/local/tk/lib/libtcl8.5.so
[root@localhost unix]# /usr/local/tk/bin/wish8.5
% exit
[root@localhost unix]#
Ⅳ tcl語言文件夾里文件移動到另一個文件夾
~/tcltk$ tclsh
% file exists hello3.tcl
1
% file executable testit
0
% file pathtype ./hello3.tcl
relative
% set dir1 home
home
% set dir2 brian
brian
% set dir3 tcltk
tcltk
% file join /$dir1 dir2 dir3
/home/dir2/dir3
% file delete testit~
%
文件和路徑操作是跨平台環境中具有挑戰性的問題。對於主機 OS,Tcl 使用 UNIX
路徑名(預設情況下,用『/』字元分隔)和本機路徑名結構。即使當程序內的數據構造正確時,也很難確保用戶輸入與系統需求匹配。file
join 命令用於將 UNIX 格式轉換成本機路徑名。其它路徑字元串命令包括 file split、dirname、file
extension、nativename、pathtype 和 tail。
在它扮演的「工具控制語言」角色中,Tcl 有許許多多種內部文件測試和操作功能。每條命令都以 file 開始,正如 file
exists name 中一樣。其它測試命令(它們都返回布爾值)包括
executable、isdirectory、isfile、owned、readable 和 writable。
文件信息和操作(再提醒您一次,所有都是以 file 開始)是通過
atime、attributes、、delete、lstat、mkdir、mtime、readlink、rename、rootname、
size、stat 和 type 來完成。請注意,在 Windows 或 Mac
環境中運行一些文件信息命令時,可能會返回未定義的數據,因為例如在那些文件系統中沒有表示索引節點和符號(和硬)鏈接數據。
使用 file ... 命令而不使用通過 exec 的本機命令的好處在於,前者會提供一個可移植介面