15,185 Topics
| |
You can alternately show one of two lines drawn on the Tkinter canvas by simply moving them on and off the canvas screen. This beats a cumbersome create and delete cycle. | |
Below is a short program I'M working of from udacity.com but I can't figure out why I'M getting the value 6 from the first call to the function. # Define a procedure, biggest, that takes three # numbers as inputs and returns the largest of # those three numbers. def … | |
I need help with a program i am doing. it is a cryptography program. i am given a regular alphabet and a key. i need to use the user input and use the regular alphabet and use the corresponding letter in the key and that becomes the new letter. i … | |
I am using turtle graphics with Tkinter however the problem is that the turtle graphics window comes over my root window and covers it! Is there a way to solve this? Note: i am using turtle inside functions if that makes any difference... import ImageTk import tkMessageBox from Tkinter import* … | |
A closer look at the Tkinter GUI toolkit Toplevel Window and how to lift and lower it respective to other windows. | |
If u run this code then click on the button helicase, u'd notice that there is a space btw radiobutton 1 and the rest! why? how can i fix this? I am sorry i know my code is too long but i don't know which section of it was causing … | |
# This program reads numbers from a file into a list. def main(): # Open a file for reading. infile = open('text.txt', 'r') sentences = infile.readlines() # Read the contents of the file into a list. infile.close() # Close the file. index = 0 # Convert each element to an … | |
hi, just a simple question on a wx.TextCtrl element. i have this text field where on an application, where the user can add a string on it. i want a text field with a red text on it. so i've generated this code: self.hRepositoryTextfield = wx.TextCtrl(self.hPanel) self.hRepositoryTextfield.SetDefaultStyle(wx.TextAttr(wx.RED)) if the user … | |
I want one picture to be displayed in the canvas then the another to be displayed in the canvasafter 2 seconds. i used time.speed(2) and canvas.delay(2000) but nothing works! Any help please?! import ImageTk import tkMessageBox from Tkinter import* from turtle import * import time root = Tk()#main window canvas … | |
I implemented whole UI and logic into one py file now I thing it would be good if I separate the UI file from the logic, and to run the UI I shoud run the file that contains logic that inturn loads the UI... I have `RenderUI.py` module that contains … | |
Hello, I need help with creating 6 buttons can I do that using some loop and how can that be done? each button has a different image and different text...their bg, and dimensions are the same Also after creating all the buttons I want to make a callback function for … | |
I have a problem...how can i arrange widgets inside a frame using grid? I get all sorts of weird results with widgets coming over each othe | |
I've just started using python in my computer technology class. One thing I can't figure out is how to have python put the lists inside a string into alphabetical order. If anyone has any easy answer, it will be much appreciated. Also, my teacher told me he would give extra … | |
Dear friends, sorry for my ignorance about python containers but I have the need to store (and access) 4 different values per file in folder, namely the filename (with its path) and 3 other values (string or None). When I access the database, I will need to know the 3 … | |
Comparing a number of different approaches to finding the closest pair of numeric elements in a list. The timing is done with the mpmath module, but you can also use Python module timeit. | |
I have to create a class of Persons that will hold information about their name,age,NI number.These details are read from a file that would look like : 55512 Bart Simpson 45 45622 John Smith 58 46231 Alicia Sands 27 My duty is to read each line from this file and … | |
Hi I am a Pyth noob and wanted to import a text file .To each line of the text file , assign a (fixed) name and sum a number (in increments of 1 from the first line to the last)using the while command for an assigned name. Lets say I … | |
I'll keep the story short here but to sum things up: I have always liked computers. Hardware has always been my thing. I have my own custom built desktop and love changing and messing with it every day. I also work (part time) as an IT guy for small business. … | |
There are websites such as http://www.cars.com that provide information about secondhand vehicles. Design a base class for vehicle with fields such as model, year, total mileage, vehicle identification number (VIN), EPA class, EPA mileage, engine, transmission, and options. Design subclasses for car, truck, SUV, and minivan. Think about the specific … | |
I want to write a client-side code that makes a HTTP Request using urllib2 functions. The server side code should make an appropriate respone to the HTTP Request. | |
I'm having some trouble with vpython for my first-year programming project. The code below is a solar system simulator and I'm having issues with pausing animations and restarting them. I also tried to add a feature where if you click on a planet it will refocus the camera on the … | |
The human body has many organs (heart, lungs, brain, and kidney, to name a few). We could think of the human body as complex object made up of simpler objects (organ). a) Create classes for heart and brain. Think about what the functions of the heart and brain are in … | |
Python is entirely object oriented and using classes is made relatively simple. Beginners have a certain angst when it comes to using classes. There is a hump in the learning curve, which I like to overcome with this example. Inheritance really makes sense and saves you a lot of extra … | |
An approach to create multiple GUI buttons (or other widgets) using list comprehension. In this case I used the Tkinter GUI toolkit that comes with the Python installation. | |
how do i make use of seticon inherited by QCheckBox to display icon with exclusive checkboxes i found a link here but doesnt have any example how to do so http://riverbankcomputing.co.uk/static/Docs/PyQt4/html/qabstractbutton.html#setIcon | |
I'm assigned a project in which i have to write a program that simulates the game of hangman using classes and GUIs. I'm really stumped on how to organized it into classes. I know that i want the word that is to be guesses to come from a list and … | |
Hi everyone. I am having a hard time modifying this code, I'm really new to python and I am trying to find the closest pair among the 10 input integers from a user. Here's my code so far and there is a syntax error... a = [0,1,2,3,4,5,6,7,8,9] a[0]=input() a[1]=input() a[2]=input() … | |
I need help with creating a program that produces a daily report for a store. I'm really bad at computer science so I'm not even sure where to start on this! Here are the instructions: Write a Python program to accomplish the following. Use modular design. Include at least 3 … | |
Hi, Have a csv-file with time as heading for each column and first column with depth and temperature inbetween. n*m table, or plot. I'm having problems reading the csv file: fname = r'C:\Users\Desktop\Temperature.csv' T1 = '15.08.2012 16:09:10' T2 = '15.08.2012 19:22:57' initial = time.mktime(time.strptime(T1, "%d.%m.%Y %H:%M:%S")) final = time.mktime(time.strptime(T2, "%d.%m.%Y … | |
Hi, I have a Python code that uses google app engine to get data via a html page. I need to modify the Python code and write a PHP code, so that the PHP code is able to pass on the required data, which is two numeric values, directly to … |
The End.