15,185 Topics

Member Avatar for
Member Avatar for vegaseat

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.

3
529
Member Avatar for lewashby

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 …

Member Avatar for woooee
0
224
Member Avatar for tizzqman

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 …

Member Avatar for woooee
0
108
Member Avatar for slasel

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* …

Member Avatar for vegaseat
0
2K
Member Avatar for vegaseat

A closer look at the Tkinter GUI toolkit Toplevel Window and how to lift and lower it respective to other windows.

0
6K
Member Avatar for slasel

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 …

Member Avatar for slasel
0
588
Member Avatar for elbert.leach

# 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 …

Member Avatar for Ene Uran
0
328
Member Avatar for silversonicaxel

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 …

Member Avatar for Ene Uran
0
338
Member Avatar for slasel

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 …

Member Avatar for Ene Uran
0
431
Member Avatar for krystosan

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 …

Member Avatar for krystosan
0
956
Member Avatar for slasel

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 …

Member Avatar for slasel
0
280
Member Avatar for slasel

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

Member Avatar for slasel
-1
76
Member Avatar for pinbustersrule

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 …

Member Avatar for noonecares
0
886
Member Avatar for giancan

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 …

Member Avatar for ZZucker
0
322
Member Avatar for vegaseat

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.

Member Avatar for Lardmeister
5
746
Member Avatar for biancairis93

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 …

Member Avatar for Lardmeister
0
125
Member Avatar for elvis1

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 …

Member Avatar for noonecares
1
3K
Member Avatar for rmbrown09

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. …

Member Avatar for rubberman
0
231
Member Avatar for jecelone

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 …

Member Avatar for TrustyTony
0
99
Member Avatar for andy_piles

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.

0
58
Member Avatar for _Fletcher

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 …

Member Avatar for andrewie101
0
231
Member Avatar for inaxassan

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 …

Member Avatar for TrustyTony
0
294
Member Avatar for vegaseat

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 …

Member Avatar for Ene Uran
0
1K
Member Avatar for vegaseat

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.

Member Avatar for Ene Uran
2
481
Member Avatar for krystosan

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

Member Avatar for krystosan
0
165
Member Avatar for JohnnyBoy324

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 …

Member Avatar for Lardmeister
0
25
Member Avatar for ailen.samson

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() …

Member Avatar for woooee
0
895
Member Avatar for Carlsn

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 …

Member Avatar for woooee
0
654
Member Avatar for MissAuditore

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 …

Member Avatar for rrashkin
0
203
Member Avatar for thakkarpranav

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 …

0
81

The End.