199 Topics

Member Avatar for
Member Avatar for heinlein_

I have a script where text is inserted into a scrolledText widget, using Pmw megawidgets. A tag is assigned to the text, and when you click on it, the text is hidden, that is, it changes color to the background color. To unhide it you click it again. What I …

Member Avatar for vegaseat
0
244
Member Avatar for 4evrmrepylrning

Hi I am trying my hand at GUI using Python and Tkinter. I know there are probably better options out there but I only have access to Tkinter here at work. My question is this. I have written this: #!/usr/local/bin/python2.6 from Tkinter import * import os root = Tk() root.title("EIMA …

Member Avatar for 4evrmrepylrning
0
1K
Member Avatar for Alexispap

%author: Alexis Papathanassopoulos from Tkinter import * import Image, ImageTk import os import glob import time top = Tk() c=Canvas(top,width=800,height=400, bg='lightblue') c.grid(row=0,columnspan=2,sticky=N+E+W+S) pdict={} class Flow: def __init__(self, clickfunc): self.cfunc = clickfunc def goto(self, canvas, nr): global velocity,autorotate clickeditem = canvas.find_withtag("pic_" + str(nr)) tagsofitem= canvas.gettags(clickeditem) oldcenteritem= canvas.find_withtag('center') if clickeditem: if oldcenteritem: …

Member Avatar for TrustyTony
0
1K
Member Avatar for satnav_8

So i've found this HTTP downloader in python, and I wanted to modify it. I've been trying to add a ttk progressbar, to no avail, but I have no idea why it isn't working! Here is my code: import urllib2 import Tkinter import ttk url = 'http://kharg.czystybeton.pl/pendulum%20-%20%5B2005%5D%20hold%20your%20colour/05.%20through%20the%20loop.mp3' file_name = url.split('/')[-1] …

Member Avatar for TrustyTony
0
2K
Member Avatar for TrustyTony

We can run Python2 script in most simple cases if we just use the 2to3.py script found in recent Python versions: F:\Python27\Tools\Scripts>copy \test\output_window_tk.py \test\output_window_tk2.py 1 tiedosto(a) on kopioitu. F:\Python27\Tools\Scripts>2to3.py -w \test\output_window_tk.py RefactoringTool: Skipping implicit fixer: buffer RefactoringTool: Skipping implicit fixer: idioms RefactoringTool: Skipping implicit fixer: set_literal RefactoringTool: Skipping implicit fixer: …

0
777
Member Avatar for frivolous

Hi, I am making a music player in python 2.6 with Tkinter. Here's my code : from Tkinter import * import mp3play import tkFileDialog import Tkinter def open_file(): #Opens a dialog box to open .mp3 file global music #then sends filename to file_name_label. global mp3 global play_list filename.set (tkFileDialog.askopenfilename(defaultextension = …

Member Avatar for TrustyTony
0
523
Member Avatar for me_mie

Hi :) Can anyone help me? I want to display image in my GUI using tkinter (python 3.2.2) Do i need to download this python image library ==> PIL-1.1.7.win32-py3.2 or actually it was already in tkinter? How about the code? Thanks for the help.

Member Avatar for me_mie
0
357
Member Avatar for Thropian

I'm trying to use the exec command in python to try to get a function to call on different dictionaries and functions as needs change without making my program bigger than it needs to be. Unfortunately I keep getting this error: File "Game Files\Intro.py", line 214, in Anim exec compile('%slegs …

Member Avatar for Gribouillis
0
156
Member Avatar for Thropian

I started making a simple drawing program, to use for a level maker, and I came across a slight issue [CODE]from Tkinter import * class Main: def __init__(self,root): w,h = root.winfo_screenwidth(), root.winfo_screenheight() current = {} canvas = Canvas(root, width = w, height = h, bd=0) canvas.pack() root.overrideredirect(1) root.geometry("%dx%d+0+0" % (w, …

Member Avatar for Thropian
0
174
Member Avatar for Dillary

(I'm new to programming in general) I created a program in python without an interface and part of it used a raw_input to get a users answer and compare with a stored answer. This was in a loop that limited the number of attempts the user could have. This worked …

Member Avatar for Dillary
0
409
Member Avatar for Thropian

I started into a project in Python,Tkinter. I have a button that I have two images for. I know buttons include the "-relief" option so I can get rid of the border. Now I'm trying to get rid of the click animation border, and have the image on the button …

Member Avatar for floatingshed
0
6K
Member Avatar for chris99

I'm having trouble with an application in Tkinter. The program displays a button that has a picture on it and that button takes you to a website about that picture, but that is not where the issue lies. There is another module that I have found on an internet tutorial …

Member Avatar for chris99
0
2K
Member Avatar for TrustyTony

This code is based on code from series of programs [URL="http://www.ferg.org/thinking_in_tkinter/"]'Thinking in tkinter'[/URL] This code is not perfect, especially it does not recognize key release when mouse moves out of button area during push. Leave event could also be captured for that to stop the event in that case.

0
497
Member Avatar for init

Hi. I'm creating an interface using the Tkinter library, but I seem to be having some issues with placing 3 buttons BELOW 3 buttons which are on top. All buttons should be inside the second LabelFrame. I've looked all over and I can't seem to figure out why the other …

Member Avatar for Ismatus3
0
1K
Member Avatar for next_tech

Hi Guys, My final project has come and it is to make a GUI for a program that we previously wrote. So I have to use tkinter as my package for python to get this written. Now I can't find anything on tkinter and python 3.2 or any GUI "designers" …

Member Avatar for TrustyTony
0
702
Member Avatar for TrustyTony

I post here the code for histogram using the turtle graphics module, which I posted long time ago in discussion thread. For more special graphs there exist other fancier options, but this tkinter based routine can function in most standard installations of Python. Example data.txt, like mentioned in module docstring: …

0
2K
Member Avatar for effBlam

I'm confused on how i can change or "toggle" the text of a button from say "D" to "A" when clicked, and then back to "D" if clicked again. So far I have this: [ICODE]from Tkinter import * from tkFileDialog import * class Game(Frame): def __init__(self,root): Frame.__init__(self,root) self.grid() self.buttons() def …

Member Avatar for effBlam
0
179
Member Avatar for TrustyTony

This is similar to earlier posts in DaniWeb by vegaseat, but it demonstrates getkey with withdrawn tkinter, restart inside object by re-calling it's __init__ method.

Member Avatar for TrustyTony
2
2K
Member Avatar for Gobble45

Hello everyone at DaniWeb, this is my first post here, so please correct me, if i am wrong in asking this question. Firstly, i had a 10minute search amongst Google, and here at Daniweb. But im not entirely sure what to search for. So my question. i have a Python …

Member Avatar for Gobble45
0
921
Member Avatar for ryufire
Member Avatar for momus

How to suppress end user ability to edit/add/delete text in a Text widget? (Python v3.2.. and tkinter) The point is to [B]suppress only the ability to change/add/delete text[/B] but not to castrate other features. Perhaps a NoEdit Text widged would be a better name. I've tried [B].text['state'] = 'disabled'[/B] and …

Member Avatar for momus
-1
1K
Member Avatar for JoshuaBurleson

I'm trying to use cx_Freeze and everything everything seems like it should work fine, however I'm getting an import error for import tkinter [CODE]Traceback #... from tkinter import __fix #... import_tkinter ImportError: DLL load failed: The specified module could not be found.[/CODE] This only happens when I take the the …

Member Avatar for JoshuaBurleson
0
350
Member Avatar for JoshuaBurleson

Does anybody know how to clear all widgets; labels, buttons, etc. from a tkinter frame so that new ones may be put in their place? I've tried self.destroy() but that makes the frame unreachable, and self.grid_forget() followed by, "and without" self.grid() neither of these work, at least not as expected. …

Member Avatar for JoshuaBurleson
0
30K
Member Avatar for JoshuaBurleson

As most of us know in tkinter in order to properly display an image it must be assigned to a variable, however what if you don't know that amount of images that are going to be necessary? i.e. A friend list, how would one display the friends pictures?

Member Avatar for JoshuaBurleson
0
216
Member Avatar for JoshuaBurleson

I'm trying to utilize partial in order to bind an image to it's associated name in a list "you'll see what I mean" but I'm getting a TypeError thrown on it, this is my first time trying to work with partials so I'm just not quite sure what's going on: …

Member Avatar for JoshuaBurleson
0
189
Member Avatar for woooee

From a thread on another forum, I wondered how difficult it would be to create a Tic-Tac-Toe game that could not be beaten. Since it is easiest if the computer goes first and chooses the center square, this code implements that portion. The logic is fairly simple; occupy the center …

Member Avatar for TrustyTony
5
563
Member Avatar for JoshuaBurleson

Just fooling around I came across an issue updating a digital-clock like label. This: [CODE]self.now=time.strftime('%a. %b %d %Y %H:%M:%S',time.localtime()) self.clock=ttk.Label(self,text=self.now) self.clock.pack() while True: self.now=time.strftime('%a. %b %d %Y %H:%M:%S',time.localtime()) self.clock['text']=self.now[/CODE] simply freezes the program, I've managed to get it to update on certain events like the user hitting a button but …

Member Avatar for JoshuaBurleson
0
210
Member Avatar for JoshuaBurleson

Hello mates, I was wondering if in that vast amount of knowledge floating around here if any of you knew how I could save an image using Python 3.x. I know that PIL is a great, and easy option for Python 2, but I assume there must be some way …

Member Avatar for JoshuaBurleson
0
582
Member Avatar for Gustavo_B

Hi, I'm writing a small application that gets some data from the user and launches a second application related to what process the user is working on. So, sometimes the user needs to choose from different versions of the same aplication. I decided that after the Ok button is pressed …

Member Avatar for JoshuaBurleson
0
1K
Member Avatar for TrustyTony

Inspired by password entry discussions, I did this simple entry. You must of course find safe way to store the passwords, for example hashlib ([url]http://stackoverflow.com/questions/4820043/basics-of-python-encryption-w-hashlib-sha1[/url]) or [URL="https://www.dlitz.net/software/pycrypto/"]PyCrypto[/URL] and replace the simplistic example match for real life usage. The print at line 23 is just to check the attempts and to …

Member Avatar for Enalicho
0
10K

The End.