1,133 Topics

Member Avatar for
Member Avatar for SoulMazer

Hi, I'm trying to add an icon to my Tkinter GUI window and have had no luck. After some searching, I came up with the same piece of code which does not work. Here is a snippet of my code: [code=python]from Tkinter import * root = Tk() root.minsize(290, 700) root.title("My …

Member Avatar for SoulMazer
0
24K
Member Avatar for SoulMazer

I'm trying to bind a Tkinter widget to a method in another file. I'm not quite sure how to do this, but let me show you what I have so far. [code=python]#!/usr/bin/python # File1.py from Tkinter import * import File2 class MyFile: def __init__(self): master = Tk() obj = File2.DoStuff(master) …

0
71
Member Avatar for Ash_Pokemaster

Hello pals. We're having a project to make a Backup and Restore program in Python. As we think that making a GUI is of course very important, we started using Tkinter after initially trying wxPython which was kind of difficult given the time we had. Either way, we made a …

Member Avatar for Ash_Pokemaster
0
2K
Member Avatar for ribot

Hello, I'm trying to deal a bit with IRC and Python 3. The decoding from bytes to Unicode create quite a dilemma. 1. Somehow it works to convert the å character from utf-8 to bytes, but the received bytes seem to often be encoded in latin-1, or at least they …

0
69
Member Avatar for Destray

I'm working with Tkinter and I need to make 600 buttons in a grid of 6x100. Is there a way to produce generic variables by going through a for loop? Or do I have to type all 600?

Member Avatar for Destray
0
207
Member Avatar for yvos91

Hello everybody, I made a wonderfull software, using Windows / python26 / tkinter / tkSnack. As long as I'm on my computer, it works fine. I try to distribute it, using py2exe. And I've not found the way to include tkSnack in the distribution. I tried also with pyInstaller, with …

Member Avatar for Stefano Mtangoo
0
84
Member Avatar for vegaseat

The module tkSnack from our friends at KTH in Stockholm, Sweden allows you to play a variety of sound files using the Tkinter GUI. Supported sound files are WAV, MP3, AU, SND and AIFF formats.

Member Avatar for yvos91
0
1K
Member Avatar for ribot

Hello! My application is crashing randomly, and I thought it might have to do with it manipulating widgets that are not yet mapped, despite them being already gridded. Have you experienced this problem? I supply some code that shows that the print function happens before tkinter recognizes the button being …

Member Avatar for ribot
0
110
Member Avatar for manathisbest

I made this Rock Paper Scissors Game with GUI. It works fine. But what can I do to make it simpler? Anybody? [CODE]import random class RPC: def __init__(self): self.comChoice = '' self.choices = ['Rock','Paper','Scissors'] def chooseCom(self): self.comChoice = self.choices[random.randint(0,2)] return self.comChoice def player(self, choice, Com): if choice == 'rock' and …

Member Avatar for manathisbest
0
2K
Member Avatar for d8m9

Hi, I want to change a variable in a definition everytime it is called. for example: when I click on button, it will print 1 when I click on button again, it will print 2 Is this possible? I have written this code but it doesnt work :) [CODE]k=0 def …

Member Avatar for d8m9
0
126
Member Avatar for wildplace

self.button1 = Button(root, text = '1', \ command = self.buttonAction) self.button1.grid(row = 1, column = 0) self.button2 = Button(root, text = '2', \ command = self.buttonAction) def buttonAction(self): if self.button1 [COLOR="Red"]is clicked/pressed... [/COLOR]: value = 1 how do i express the word in red in python code?!!?? thanks :D

Member Avatar for lrh9
0
129
Member Avatar for chris99

[CODE]global Num1 from Tkinter import * Num1 = "" def buttonNPush(n): global Num1 Num1 = Num1+n print Num1 def clearScr(): global Num1 Num1 = "" root = Tk() textbox = Entry(root) textbox.pack(side=TOP) #Create Frame with buttons numbered 0-9 frameButtons = Frame(root) frameButtons.pack(side=LEFT) button1 = Button(frameButtons, text="1", command=buttonNPush("1")) button1.grid(row=0, column=0) button2 …

Member Avatar for vegaseat
0
210
Member Avatar for ribot

Hi! I'm trying to combine some frames in a GUI as a toolbar and content area. Currently I'm on windows and using python 3, and I want preferrably my app to work on *nix and mac as well. The problem is that in the following app, when I resize it …

Member Avatar for ribot
0
2K
Member Avatar for i are smart

i just started learning GUI, and i made my first graphic interface using the tkinter module, but as information is piled up and goes beyond the window's dimensions, i need those scroll bars to up and down

Member Avatar for woooee
0
102
Member Avatar for Elvedon

Thanks for your input vegaseat. I have posted the code that is giving me the problem in the two scripts and I hope you can comment further. Thanks in advance - Elvedon. [CODE]#The script displayed below is only part of the larger original script.# #filename = 'firstScript.py' #!/usr/bin/python from Tkinter …

Member Avatar for vegaseat
0
715
Member Avatar for Dan08

hey everyone, i am writting an app with tkinter, well ive tried quite alot of different ways but i couldnt find the solution for my problem. So, in that window there is time and i need it to constantly change, like every second. Any ideas? Thanks Dan08

Member Avatar for Dan08
0
22K
Member Avatar for SoulMazer

Okay, well I'm having trouble getting a variable from one place to the other. I have two scripts: for now, let's call them MainScript.py and ChildScript.py. [code=python]#!/usr/bin/python # MainScript.py import ChildScript from Tkinter import * class GetVariable: def __init__(self): master = Tk() master.withdraw() ChildScript.VariableDialog(master) # From right here, I would …

Member Avatar for SoulMazer
0
144
Member Avatar for need help!

This is some code I wrote for a music program... Any way on making it neater/more pythonic? [CODE] from Tkinter import * import pygame playlist=[] pygame.init() pygame.mixer.init() camera=pygame.mixer.Sound("E:\\Peter\\Python_stuff\\data\\Music\\camera1.wav") one=pygame.mixer.Sound("E:\\Peter\\Python_stuff\\data\\Music\\one.wav") wrong=pygame.mixer.Sound("E:\\Peter\\Python_stuff\\data\\Music\\wrong.wav") root=Tk() root.title("DJ Pro") def sound_play(event=None): playlist.append(wrong) wrong.play() def sound_play1(event=None): playlist.append(one) one.play() def sound_play2(event=None): playlist.append(camera) camera.play() def play_all(event=None): for ii in …

Member Avatar for need help!
0
144
Member Avatar for fuston05

i am trying to make a password system that will run another one of my programs when answered correctly. not sure how to call my main program in the password prog function. i have played w this over and over, and browsed the library and i am officially stuck. :) …

Member Avatar for fuston05
0
163
Member Avatar for d8m9

Hi, Iam new in python (1/2year) and here is the thing: I made a small text editor with tkinter and I want to generate web page from the text editor (from formated text). To web page generating I will use the HTMLgen module. So it must be created another python …

Member Avatar for d8m9
0
185
Member Avatar for mahela007

I've been trying to read up about how tkinter (or more accurately Tk) works on windows AND linux. Here's what I've understood so far. Tk is a predefined set of widgets. That is stuff like text boxes, check boxes, drop down lists etc. Tkinter is just a way of translating …

Member Avatar for vegaseat
0
1K
Member Avatar for Elvedon

I have written two scripts in python. When I run the two scripts as individual programs they run correctly. But when the second script is run as a module within the first by importing it, an image file is not recognised. I have tried calling the full pathwayof the image …

Member Avatar for vegaseat
0
153
Member Avatar for lrh9

I'm wondering if it's possible to change the border color of a tkinter entry widget border. I don't think it is, because no such option exists in relevant documentation. You can change the width, but that just results in the whitespace being recessed - creating a raised 3d border. If …

Member Avatar for Ene Uran
0
12K
Member Avatar for deonis

Hello I'm trying to add highlighting to the specific keywords in the text widget. For instance I would like to highlight : Hello World. where is "hello" - will be coloured in red and "World" coloured green. Any Idea ??? [CODE] from Tkinter import * import os import subprocess import …

Member Avatar for deonis
0
3K
Member Avatar for SoulMazer

So, I have a script that needs to "clean up" when it is exited: it needs to clear a special logging file and other small things that affect the next startup of the script. The script has a GUI written in Tkinter, if that is relevant at all. Is there …

Member Avatar for SoulMazer
0
103
Member Avatar for SoulMazer

Okay, so I'm having a little trouble. Let's say I run "scriptA.py" and it has a GUI (Tkinter) and it is running in its mainloop. I want to create a "scriptB.py" that can end "scriptA.py"; would there be a way to do this regardless of the OS it is on …

Member Avatar for SoulMazer
0
269
Member Avatar for awn

Hi, I'm writing an application in python to read data from a joystick and display it onto a screen with a background image overlay. i used the canvas widget to display the data to my screen. The problem is, the text keeps updating the entries without clearing the previous entry …

Member Avatar for awn
0
801
Member Avatar for MineSweep

I'm pretty new to python, but I'm trying to create a simplistic version of Mineweeper. I have developed functions that randomly place mines in a 9x9 matrix (nested lists) and then I have functions that assign values to every cell that doesn't contain a mine corresponding to the number of …

Member Avatar for MineSweep
0
7K
Member Avatar for masterofpuppets

hi everyone, I am trying to design an assembler program with Python using Tkinter and so far it is going pretty good. I just have one question: Is there anyway to change the text color of just a selected text using a text area? What I mean is, you know …

Member Avatar for masterofpuppets
0
5K
Member Avatar for v_rod

hi! i am making a prototype of an online stock trading application in python using tkinter module for Gui and a csv file for all the stock market data. i wish to know if there is an api using which stock prices can be changed if i keep all the …

Member Avatar for v_rod
1
117
Member Avatar for mahela007

I've just started learning tkinter for python. I'm a little curious as to how tk runs on different platforms. From another thread on these forums, l leaned that tk talks to the kernel. The kernel talks to the device driver which talks to the hardware. (Please correct me if I'm …

Member Avatar for mahela007
0
100
Member Avatar for mahela007

The tkinter tutorial at tkdocs ([url]http://www.tkdocs.com/tutorial/firstexample.html[/url]) shows these two lines at the beginning of every example. [CODE]from tkinter import * from tkinter import ttk[/CODE] Doesn't the first line import everything in the tkinter module? if so, why bother writing the second line? EDIT: Just found an answer (kind of ) …

Member Avatar for bumsfeld
0
144
Member Avatar for Aiban

Hi Everyone. I want to use this thread for some help as i'm sure this will not be the only question as i have just over 300 lines of code from my old python 3.1 script. I'm now using 2.6.4 and it is obvious some code isn't backwards compatible. Soooo …

Member Avatar for Aiban
0
141
Member Avatar for AutoPython

Well, I've written a simple program that gives you info about your computer. The program runs perfectly fine, but the console window pops up and really does nothing. So I would like to hide the console window and only show the gui frame. Pointers on how to do this?

Member Avatar for sheeps
0
15K
Member Avatar for kjpadilla

[CODE]import Tkinter class converter(Tkinter.Tk): def __init__(self,parent): Tkinter.Tk.__init__(self,parent) self.parent = parent self.initialize() def initialize(self): self.grid() self.labelVariable = Tkinter.IntVar() welcome = Tkinter.Label(self, textvariable=self.labelVariable, anchor="w", fg="black", bg="lightgrey") welcome.grid(column=0, row=0, columnspan=3, sticky='EW') self.labelVariable.set(u"Hello there. Welcome to MAKK's currency converter.") self.entryVariable = Tkinter.StringVar() self.entry = Tkinter.Entry(self,textvariable=self.entryVariable) self.entry.grid(column=0, row=1, sticky='EW') self.entry.bind("<Return>", self.OnPressEnter) self.entryVariable.set(u"Enter currency here.") money …

Member Avatar for kjpadilla
0
883
Member Avatar for mahela007

What would it take to make graphics show on the monitor without using stuff like tkinter and Qt? (tkinter and Qt are called toolkits right?)

Member Avatar for mahela007
0
261
Member Avatar for python.noob

Hai guys, A very good morning to you.Currently i'm using python3 in linux. In windows tkinter is working fine but in mandriva linux spring 2009 it fails to import. Can you please tell me step-by-step on how to fix this issue? In python3.1 home page the description is not clear …

Member Avatar for python.noob
0
382
Member Avatar for masterofpuppets

hi all, I am designing a text editor program in Python using Tkinter and I was wondering if there's any way to get the current line number when the mouse is clicked somewhere on the text field, i.e the mouse position should determine the current line, like in the python …

Member Avatar for masterofpuppets
0
962
Member Avatar for aot

I'd like to make a bogus Windows window pop up asking the user to choose between energy settings (better performance vs. better energy savings). This is for a social psychological experiment about ecologically sustainable behavior, so it's completely legitimate; it's approved by an ethical board, and the participants will be …

Member Avatar for jlm699
0
106
Member Avatar for lewashby

I the following program, can someone please explain these two lines. "def __init__(self, master):, & Frame.__init__(self, master)" One other thing. Shouldn't the method "update_count" use a return to return the new count? thanks. [CODE]# Click Counter # Demonstrates binding an event with an event handler from Tkinter import * class …

Member Avatar for vegaseat
0
199
Member Avatar for Mensa180

Hi all, I can convert my .py or .pyw files into EXE no problem. The thing is they only display a console for about a tenth of a second if they have a GUI made with tkinter. If it is a console only program then the exe works fine. Any …

Member Avatar for Stefano Mtangoo
0
127
Member Avatar for pygirl

Hello, I would really appreciate some help with tkinter. Does anyone know how to change border colour of a widget and if it is possible to display border on just one side of the widget (so for example only the left or bottom border)? I tried to find the answer …

Member Avatar for pygirl
0
1K
Member Avatar for masterofpuppets

hi currently I am developing a game in python called TankWar, it is basically 1vs1 game style and each player has its own turn. Both players control their respective tanks using the control keys and WASD and they can specify the missile's angle, velocity, tank position. I am using an …

Member Avatar for masterofpuppets
0
195
Member Avatar for AutoPython

As the title suggests, there are some major flaws in my new program, though it still functions nonetheless. Here's the code: [CODE] POS = 1 try: import Tkinter as tk except ImportError: import tkinter as tk import os def clear(): if os.name == "nt": os.system("cls") else: print ("\n"*40) def key(event): …

Member Avatar for masterofpuppets
0
121
Member Avatar for paulo3k

I have just started getting into python and Tkinter and so far it's all been very interesting and the help good to, but now i have ran into a problem. I'm sure it's very easy to solve but i just can't seem to figure it out or find anything on …

Member Avatar for masterofpuppets
0
89
Member Avatar for marshall31415

Hi, There is a lot of code - so I have attached the entire thing as a zip file. This is for a function plotter. Basically, I need to track the changes in the root window size so I can resize the canvas and redraw all the plots. I'm very …

Member Avatar for marshall31415
0
3K
Member Avatar for Mensa180

Hello! I've been messing with tkinter and now have tried to make a MPG calculator using sliders. My problem is that no matter how I move the sliders it does not update the mpg, I'm not sure what to tell the label to do for it to update. I know …

Member Avatar for Mensa180
0
117
Member Avatar for marshall31415

I am working with classes for the first time in Tkinter. I have no experience working with classes before this, although I have had experience with basic coding syntax before. I am trying to make a function plotter. If I have a class PlotApp. This is my the class that …

Member Avatar for woooee
0
189
Member Avatar for pelupelu

I am trying to build a histogram. So far I have coded the following: from Tkinter import * def plot(data): numberOfBins = len(data) root = Tk() width, height = 200, 630 #taille de la fenetre die = Canvas(root, width = width, height = height) die.pack() numberOfStripes = 2 * numberOfBins …

Member Avatar for woooee
0
2K
Member Avatar for The-IT

Hello all, I have been doing some work on my HTML editor lately, and I have come to a (what seams like a) dead end. The file its self is about 3.7kb smaller than my text editor, ProssesIT, and yet it fails to run any where near as smoothly. When …

Member Avatar for jlm699
0
3K

The End.