tk

How can I get TK button commands to take in a parameter with a variable (Python)

拟墨画扇 提交于 2021-02-19 08:01:27
问题 This has stumped me for over a week. As the title asks, how can I get TK button commands to take in a parameter with a variable? Here is the exact code I'm using: i=0 # Make a Staff list button staffButton = Button(masterFrame, text='Staff List', width=20, justify=LEFT, #command=lambda:self.openTabHere(isLeft,STAFF_LIST_TAB)) command=lambda:self.openTabHere(isLeft,i)) staffButton.grid(column=0, row=1) # Make a course list button courseButton = Button(masterFrame, text='Course List', width=20,

Python tkinter.filedialog askfolder interfering with clr

余生长醉 提交于 2021-02-07 07:01:22
问题 I'm mainly working in Spyder, building scripts that required a pop-up folder or file Browse window. The code below works perfect in spyder. In Pycharm, the askopenfilename working well, while askdirectory do nothing (stuck). But, if running in debug mode - the script works well. I tried to run the script from SAS jsl - same issue. Any Idea what should I do? Python 3.6 Pycharm 2017.2 Thanks. The Code I'm using includes: import clr #pythonnet 2.3.0 import os import tkinter as tk from tkinter

Python tkinter.filedialog askfolder interfering with clr

▼魔方 西西 提交于 2021-02-07 07:01:08
问题 I'm mainly working in Spyder, building scripts that required a pop-up folder or file Browse window. The code below works perfect in spyder. In Pycharm, the askopenfilename working well, while askdirectory do nothing (stuck). But, if running in debug mode - the script works well. I tried to run the script from SAS jsl - same issue. Any Idea what should I do? Python 3.6 Pycharm 2017.2 Thanks. The Code I'm using includes: import clr #pythonnet 2.3.0 import os import tkinter as tk from tkinter

Tkinter OpenGL context in Python

岁酱吖の 提交于 2021-02-05 19:56:38
问题 I need to create an OpenGL context in Tkinker, for using it with PyOpenGL Python module. Tkinker doesn't natively support OpenGL context, but I found this page on PyOpenGL docs, explaining how to use a wrapper included in the module for this: http://pyopengl.sourceforge.net/documentation/context/ I tried to run the provided code but I got a message saying TOGL module was not found. I downloaded the module from http://togl.sourceforge.net/, but couldn't get it to work. PS. I did the test on

How to run two parallel scripts from tkinter?

丶灬走出姿态 提交于 2021-01-29 21:25:47
问题 With this code I was able to create a TK Inter pop-up with a button to run a Sample_Function . This Sample_Function destroys the tk pop-up, runs another python file, and then opens itself (the first pop-up) again. How can I run the other_python_file and pop-up 'itself' at the same time — so I can be able to trigger many functions before each one gets completed? import sys, os from tkinter import * import tkinter as tk root = Tk() def Sample_Function(): root.destroy() sys.path.insert(0,'C:

It is difficult to handle multiple dimension list with tcl

蓝咒 提交于 2021-01-29 20:53:52
问题 I need to handle kind of complex data with tcl. I need 3 dimension list to store the data, but I find tcl is bad for this work. Based on my current study, tcl does not support simple index of list like: listname(index). So for multiple dimension list, if I want to assign a new value for certain element, it will be very troubling. Are there some skills to handling data effectively? 回答1: The most efficient representation for a multi-dimensional array is a nested list (unless you're going for a

textract failed with exit code 127: pdftotext on windows 10

杀马特。学长 韩版系。学妹 提交于 2021-01-29 18:21:56
问题 I am trying to run a python program on a windows 10 machine with which I am trying to read and convert PDF files. However every time I run the program I get the following error. I have not found out how to resolve this yet. Is there anyone who can help me please :) Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\trpfinance\AppData\Local\Programs\Python\Python38-32\lib\site-packages\textract\parsers\utils.py", line 82, in run pipe = subprocess.Popen( File "C:

How to access and modify a sibling of a Tcl/Tk object in R

我的梦境 提交于 2021-01-29 08:26:59
问题 In short: I use tcltk package in R. But non-R users may suggest ideas too and provide examples in other language than R. I have a list of Tcl/Tk objects in R <Tcl> .1.1.1.1 .1.1.1.2 .1.1.1.3 and want to access and modify each object separately. How can I do it? Or If I have button A object, how can I access and modify button B object? Details: I have the following widget: The code to create it: library(tcltk) top <- tktoplevel() frame_1 <- tkframe(top) tkgrid(frame_1) frame_n <- tkframe(frame

Attaching event to self (canvas) tkinter

 ̄綄美尐妖づ 提交于 2021-01-29 08:06:09
问题 i have created a class in python that extends the tkinter canvas. I am trying to attach an event to this canvas to handle click's within the class. It functions if i attach the event outside of the class itself but when binding within the class the click event only occur's once and then proceeds not to do anything at all only performing the first click: class myCanvas(Canvas): def callback(event): print('clicked at', event.x, event.y) def __init__(self, parent, **kwargs): Canvas.__init__(self

Attaching event to self (canvas) tkinter

廉价感情. 提交于 2021-01-29 08:00:26
问题 i have created a class in python that extends the tkinter canvas. I am trying to attach an event to this canvas to handle click's within the class. It functions if i attach the event outside of the class itself but when binding within the class the click event only occur's once and then proceeds not to do anything at all only performing the first click: class myCanvas(Canvas): def callback(event): print('clicked at', event.x, event.y) def __init__(self, parent, **kwargs): Canvas.__init__(self