14,945 Topics

Member Avatar for
Member Avatar for jrcagle

Hi all, I know there have been several threads about getting card images into a GUI, but I'm flustered trying to understand why some things work and some things don't. Here's the code: [php] import random from Tkinter import * import Image, ImageTk class Card(object): suits = ["C","D","H","S"] values = …

Member Avatar for vegaseat
0
2K
Member Avatar for babutche

Help! I am trying to enter characters (for classroom grades) into my program and convert them to numeric values so I can get gradepoint averages. I can't figure out how to convert A-, A+, B-, B+, etc... Can someone help? This is what I have: [code]class Student: def __init__(self, name, …

Member Avatar for babutche
0
124
Member Avatar for trihaitran

Hi I'm a completely new to computer programming and am looking to make an application that can search through 3 dictionaries using one input. The dictionaries are Chinese-English, Chinese-Vietnamese and another Chinese-English. The first one is taken from CEDICT, an open source dictionary in Unicode. I'm going to try to …

Member Avatar for vegaseat
0
147
Member Avatar for babutche

HI, I HAVE BEEN TRYING TO FIGURE THIS PROBLEM OUT ALL DAY LONG. CAN SOMEONE PLEASE HELP ME ALONG? I WILL TELL YOU THE PROBLEM AND THEN SHOW YOU WHAT I HAVE SO FAR. I AM TRYING TO MODIFY THIS RECURSIVE PROGRAM: [code=python] def fib(n): if n < 3: return …

Member Avatar for jrcagle
0
108
Member Avatar for chris99

Just trying to make pickle work, but when I load the file the dictiionary is still empty. It's an addressbook, with the dictionary keys being names, and values being numbers {N:NUM} I've programmed pickle to save it to a file with a user specified name, and it does so. I …

Member Avatar for vegaseat
0
128
Member Avatar for lockettpots

Hi all My first time with this forum:). I'm running python 2.4.4 and unicode enabled wxPython on Windows XP. I'm writing a gui application which requires users to be able to type accented characters easily into a TextCtr. To this end I have built a set of tools on a …

Member Avatar for lockettpots
0
97
Member Avatar for seasou
Member Avatar for seasou
0
2K
Member Avatar for babutche

O.K. This is what I have changed in my [URL="http://www.daniweb.com/techtalkforums/thread65045.html#"]program[/URL]: import string import math class Student: def __init__(self, name, hours, qpoints): self.name = name self.hours = float(hours) self.qpoints = float(qpoints) def getName(self): return self.name def getHours(self): return self.hours def getQpoints(self): return self.qpoints def gpa(self): return self.qpoints/self.hours def addLetterGrade(self, LetterGrade, credits): …

Member Avatar for babutche
0
171
Member Avatar for jrcagle

Hi all, In the never-ending quest to master Tkinter, I wrote a small version of Notepad. Here is my "SaveAs" function: [php] def save_as(): if not mainw.filename: mainw.filename = tkFileDialog.asksaveasfilename(title="Save As...", filetypes=[("All Files","*.*"),("Text Files","*.txt")]) if not mainw.filename: return f = open(mainw.filename, "w") s = mainw.frame.edit.get("1.0",END) f.write(s) f.close() [/php] As you …

Member Avatar for Ene Uran
0
88
Member Avatar for babutche

Hi, I need help please. At first I was understanding the Python language but I got lost somewhere along the line. Can someone please guide me through implementing an addLetterGrade method? I am not very good with computers and I am having a very hard time. This is my first …

Member Avatar for babutche
0
199
Member Avatar for Matt Tacular

[php] import random availableCountries = [0, 1, 2, 3, 4, 5, 6, 7] firstTurnsCountries = [] secondTurnsCountries = [] def countryDivider(countryNum): counter = 0 while True: if counter == 8: break num = 7 if num > 0: countryToAdd = random.randint(0,num) if num == 0: countryToAdd = 0 if counter …

Member Avatar for Matt Tacular
0
109
Member Avatar for sneekula

I like to create a database of common chemicals with Python. How would I go about that? Any help welcome!

Member Avatar for Ene Uran
0
114
Member Avatar for sneekula

This came up on Chris99's bus ticket program thread. Would like to see any simple examples on how to pass variables between classes without using global variables.

Member Avatar for vegaseat
0
19K
Member Avatar for chupacabra

python 2.4.1 mySQLdb 1.2.0 kernel 2.6.12 Hi, How can I make the following statement so I can search for any string? Right now I need to input at runtime %whatever I'm looking for% between % signs to get all records matching that query. I want to have this statement set …

Member Avatar for locosway
0
133
Member Avatar for mruane

I am horribly (obssesed?) with writing a visually appealing game (simple) in python. My text adventures didn't appeal to my aufience (family), so I was looking at a tut on making a pac man clone, supposed to be line by line, it seemes choppy. Any ways, here is the code. …

Member Avatar for vegaseat
0
625
Member Avatar for mruane

I was wondering, if I wanted to attempt an ANSII dos game in Python, what would be the best way to do it? I would like to know how I would run it, i.e., would it run in the Python Interactive shell or could a make it run in dos? …

Member Avatar for mruane
0
246
Member Avatar for mattyd

I have been working on a GUI-based program using Tkinter; it is coming along nicely and I am very pleased with the results. I am at a point where I am trying to attempt a graphic manipulation of the GUI canvas. I have researched this but I am unsure what …

Member Avatar for jrcagle
0
2K
Member Avatar for sneekula

As you can see, I am playing around with the Tkinter GUI toolkit. How can I keep a number of widgets fixed in a location even when the user expands the window?

Member Avatar for sneekula
0
182
Member Avatar for sneekula

I am writing a small Python program for the use in our departments stockroom. This is what I have come up with (just starting): [php]# table of chemicals in stockroom # order --> stock number, chemical name, quantity (grams) # short version of the table table = [ ['ud-99137', 'm-chlorobenzoic …

Member Avatar for sneekula
0
150
Member Avatar for coder_gus

Hello! I am working nowadays at a little script that reads mail (gmail).Nothing fancy here.The only problem is that i want to check if pop is enabled and if not to enable it from my python script. Do you know some way[s] to do that?I've tried googling but all i …

Member Avatar for coder_gus
0
72
Member Avatar for mattyd

**[I]Note: This may not be the correct forum for this post; I posted here as I thought it may be related in at least an indirect way. Please move if necessary.[/I] I have never knowingly worked on any projects where I had to attempt to extend a language. I hear …

Member Avatar for Narue
0
122
Member Avatar for linux

Hello! In Visual Basic, there is a piece of code that can be used to see if a command starts with a certain text. For example, if I had a textbox, and I wanted to see if the user had started it with an "A" then I would use (not …

Member Avatar for vegaseat
0
206
Member Avatar for sneekula

Is there a way to make a Tkinter GUI window that the user can not change the size of?

Member Avatar for sneekula
0
154
Member Avatar for Haze

when i say basic i mean basic it doesnt store the encrypted string in a file or anything it just prints out what it would be and all i intend it to do is swap a for b, b for c and so on then turn the string round backwards …

Member Avatar for jrcagle
0
2K
Member Avatar for mattyd

Concerning Python Indentation Syntax: I have researched this and read some reasoning behind indentation-level enforcement. My question is: does this exist simply to ensure consistency when dealing with nested statements, a precaution against sloppy composition of code? I am not complaining about this, and actually I somewhat like this, but …

Member Avatar for jrcagle
0
237
Member Avatar for mattyd

I have been working on a somewhat small Python GUI for a few weeks now primarily focusing on the GUI and not giving much in-depth thought to the logic of what is to be a simple card game. I assumed the logic to be in my head and in general …

Member Avatar for jrcagle
0
288
Member Avatar for chris99

So the Text Adventure is lost. ;-;. I am working on a GUI to take a starting point and a destination input by the user, and scan a file to find a match for both. If it finds a match for Variable A + B then it will assign variable …

Member Avatar for Ene Uran
0
135
Member Avatar for shr2408

I am writing a small tkinter-app involving user keyboard-input, and want to control the range of acceptable input-characters. I'm currently using an Entry-widget, but haven't been able to access the individual characters AS THEY ARE ENTERED. What I (think I:confused:) need is somthing like the 'command=' option (as in the …

Member Avatar for shr2408
0
1K
Member Avatar for mattyd

I am trying code a single button that will fire two commands, that is, it will open two image files with one button selection. I have researched this and have not found much directly related to this question; what I found was to use a def within a def, thus …

Member Avatar for Mouche
0
4K
Member Avatar for William Connery

Hi, I have a small python program with e-mail capabilities that I have pieced together from code snippets found on the internet. The program uses the smtplib module to successfully send an e-mail with an attachment. I want to give users an indication of the percentage of the e-mail that …

Member Avatar for William Connery
0
175

The End.