tk

看盘工具

泄露秘密 提交于 2019-12-06 12:02:03
from tkinter import * import urllib.request from PIL import Image, ImageTk import os,io,threading,time from tkinter import messagebox win=Tk() win.title('疯陈编程-看盘') win.geometry('1270x800+200+100') #win.attributes("-toolwindow", 1) win.resizable(width=False,height=False) f1 = LabelFrame(win,text='上证日线图') f1.grid(row=0,column=0,padx=10,pady=10) f2 = LabelFrame(win,text='上证分时图') f2.grid(row=0,column=1,padx=10,pady=10) f3 = LabelFrame(win,text='个股日线图') f3.grid(row=1,column=0,padx=10,pady=10) f4 = LabelFrame(win,text='个股分时图') f4.grid(row=1,column=1,padx=10,pady=10) f5 = LabelFrame(win,text='股票查询操作'

How can I control keyboard repeat delay in a Tkinter root window?

依然范特西╮ 提交于 2019-12-06 11:30:20
问题 This simple application almost does what I want: import Tkinter as Tk def hello(x): print "Hello" root = Tk.Tk() root.bind("<Up>", hello) root.mainloop() I mash down the up arrow, it prints "Hello" over and over. However, there is a delay before this repetition begins, and the repetition rate is slower than I want. How can I set this repeat delay to zero? How can I control the repeat interval? I know that other Tkinter widgets have configuration options for 'repeatdelay' and 'repeatinterval',

How to get the selected date for DateEntry in tkcalendar (Python)?

空扰寡人 提交于 2019-12-06 07:32:52
I have a tkcalendar and it's pre-defined widget for Calendar, DateEntry and am trying to get the User's selected date for DateEntry. Whereas there is provision to extract the selected date for the Calendar widget using "selection_get()" but nothing for DateEntry that I could find. I have tried get_date(),get(),_date(), cget(), ._selection() amongst many others but they don't seem to return/print the user-selected date. Please help, kindly let me know if any added information is needed Code [picked from a simple tkcalendar tutorial]: import tkinter as tk from tkinter import ttk from tkcalendar

R with tcltk/tcltk2: Improve slow performance when displaying big data.frame with TkTable?

情到浓时终转凉″ 提交于 2019-12-06 06:09:24
Please see two edits below (added later)... I have loaded a big data.frame into memory ( 2.7 mio rows and 7 columns - 74 MB of RAM ). If I want to view the data using Tcl/Tk's Tktable widget via the tcltk2 package function tk2edit it takes over 15 minutes till the window is displayed with the data and about 7 GB of RAM (!) is consumed by R (incl. Tcl/Tk) en plus! Example: library(tcltk2) my.data.frame <- data.frame(ID=1:2600000, col1=rep(LETTERS,100000), col2=rep(letters,1E5), col3=26E5:1) # about 40 MB of data tk2edit(my.data.frame) The basic problem seems to be that each cell of the data

Graphing routines in Tcl/Tk

丶灬走出姿态 提交于 2019-12-06 05:22:00
I want to do simple graphing routines in Tcl/Tk like scatter plot, x-y plot, histograms. I am using Tcl/Tk 8.5.7. I found in Tcler's wiki that there are few options such as BLT which is not supported in Tcl/Tk 8.5+ Is there any Tcl/Tk interface to gnuplot or any widget to accomplish graphing? Please let me know about the choices for graphing routines in Tcl/Tk. Gnuplot can indeed produce output that Tcl/Tk can consume. This page on the Tcler's Wiki describes how (though with some extra complexity because it is doing animations). Here's a simplified version: package require Tk eval [exec

Cannot invoke button command: application has been destroyed

瘦欲@ 提交于 2019-12-06 05:10:16
Given below is the code for creating independent windows using Tkinter and Python: import Tkinter Tkinter.NoDefaultRoot() win1=Tkinter.Tk() win2=Tkinter.Tk() Tkinter.Button(win1, text='Woho!',command=win1.destroy()).pack() Tkinter.Button(win2, text='Woho!',command=win2.destroy()).pack() win1.mainloop() On execution it displays: Traceback (most recent call last): File "C:\Users\Administrator\Desktop\eclipse\Python Projects\Project 1\Source1\mod.py", line 8, in <module> Tkinter.Button(win1, text='Woho!',command=win1.destroy()).pack() File "C:\Python27\lib\lib-tk\Tkinter.py", line 2106, in __init

Display the tail of a filename in an entry box

狂风中的少年 提交于 2019-12-06 05:08:53
I regularly find myself writing Tk dialog boxes using ttk::entry widgets to prompt for a filename. I save the user's last input to such a dialog and display it as the default when next displaying it. After I've populated the widget, if the full filename is longer than the entry box, then it will display the leftmost few characters which are generally the less interesting part of the filename and I'd rather it displayed the rightmost characters. I found that attempting to use $entryWidget xview immediately didn't work very well - it did nothing, which I assume was because of some race condition

Ruby, deploying an exe with ocra that contains the TK GUI

故事扮演 提交于 2019-12-06 04:29:04
问题 Ocra is unable to handle applications that require 'tk' require 'tk' puts 'nope' Packing this code with ocra http://github.com/larsch/ocra doesn't work (like mentioned in one of the issues at the link) Issue: https://github.com/larsch/ocra/issues/29 (Ocra is the 'new' rubyscript2exe for 1.9, essentially it's for deploying a rb script as an executable) The only problem seems to be the missing DLL files for tcl I don't think it's an issue AFAIK the problem are the missing DLL files for tk If

Tkinter StringVar error

只愿长相守 提交于 2019-12-06 02:01:20
Hi i get an error with this code that StringVar() is not defined, and its probably a small thing but i am not that experienced with tkinter and would like some help, thanks. Here's my code: import tkinter as tk class Converter1(tk.Tk): def __init__(self): tk.Tk.__init__(self) self.entry = tk.Entry(self) self.variable = StringVar() self.variable.set("Miles to Kilometers") # default dropdown menu value self.menu = tk.OptionMenu(self, variable, "Miles to Kilometers", "Kilometers to Miles") self.button = tk.Button(self, text="Convert!", command=self.convertMK) self.button.pack() self.menu.pack()

[Python/Tkinter]How can I fetch the value of data which was set in function “event_generate”

北战南征 提交于 2019-12-06 02:01:10
I'm using Python 2.7.4 and new to Tkinter, and I'm stuck with the following code. I generated an event "test" and set the "data" option with a string, but an error occurred when retrieving it from event. Error -> AttributeError: Event instance has no attribute 'data' from Tkinter import * def handle_it(event): # print "event handler" print event.data root = Tk() root.after(1, lambda: root.event_generate('<<test>>', data="hi there")) root.bind('<<test>>', handle_it) root.mainloop() I can't find the related Python docs for this case, so I referred to the tcl document as below http://www.tcl.tk