15,190 Topics
![]() | |
In the following program I don't understand why 'mixer' is given as an argument to the function 'create_gui'. Please explain. File 1 [CODE]# imports from Tkinter import * from sound_panel import * import pygame.mixer # create gui app = Tk() app.title("Head First Mix") # create mixder mixer = pygame.mixer mixer.init() … | |
how do you get it in pygame so that when you click on a rect it will reset the window but only when you click on that certain rect | |
Hi. Im new to Python and I need help upgrading the python version 2.6.5 to version 3.1.2. I'm running x64 Ubuntu. After I download and install the 3 version it does not overwrite or default itself as the new thing. I can't uninstall the 2 version because of dependencies on … | |
I want to make an array (using the built-in array module), to create an array made up of classes. All the objects in the array will be the same class, but I want to be able to append new classes on the end and read the values. Thanks in advance. | |
Hi. I'm getting the hang of tkinter now, thanks for help in my first thread on this. Now, I've happily using the simpledialog module, but it's not using the themed widgets (ttk). I think it's a good exercise for me as a python beginner to fix this myself, but I … | |
Hello This is my first post on this forum. I have found that this place seems to have lot of knowledgeable people when it comes to Python. Anyway I'm quite new to GUI programming and I'm not exactly having a huge problem but I'm more interested about how to make … | |
I can't seem to understand why I cannot run this. Please explain. Thank you in advance. [code] #07/22/2010 #Write a program that will calculate a 20% tip and a 6% #sales tax on a meal price. The user will enter the meal price #and the program will calculate tip, tax, … | |
Hey guys, Im trying to learn python and i decided to try and make a text based tic tac toe game. I dont have the matching up yet (where the rows say there are 3 in a row they win). But I have this so far and as you can … | |
Wirte a regular expression pattern to match all words ending in s. This is what I got but seems like im thinking to hard on it, plus of course its not working lol Please help! :) [CODE]import re str = "Subs are everwhere" print (str) matchObj = re.match(".*?s ",str,re.L|re.I) if … | |
I need to write a function that takes a string as an argument and outputs the letters backward, one per line.so far I have this: [code] def wordReverse(word): acum = "" for ch in word: acum = ch + acum return acum [/code] I tried adding \n to acum but … | |
Hi all its me needing help again :P My exercise says: Write a function wordPop that accepts a text and a length N and returns the list of all the words that are N letters long, sorted by their length. okay so what I have is 2 fuctions first: [CODE]def … | |
hi, im trying to do something like the following: text_area = wx.TextCtrl(self.panel, -1, style=wx.MULTILINE) a = (all the text in the text control window) I can't get my head around how to define the text with wxpython, how should I go about this? | |
Hello. I am just starting to learn Python, but I have some basic programming and web coding background. As my first real Python project, I want to come up with something that manages some basic content on HTML pages. Specifically, I want to come up with a way that I … | |
I use windows-xp python 2.6 Could I have your help. I need to hide and then show a Tkinter root window. And also "remove" the exit, minimize and maximize options. I can't do it like this! root.hide() #do some stuff root.show() Root.hide works but root.show doesn't. No Exception thrown. :( | |
I am trying to square each number in the list under [I]nums[/I]. But I don't know how to do it. I got this so far: [code] def squareEach(nums): for i in nums: y=i*i return y [/code] What is happening here is it's counting how many numbers are in the list … | |
For my intro to programming class i have to design a game where a ball is shot at an angle and hits squares that are worth points. I have two questions 1.How do you get the ball to move. I was given this code but I don't know if I … | |
I have a script where I want to use a message box for the occasional interactive question [code] # python 3.1 from tkinter import * from tkinter import ttk from tkinter import messagebox answer = messagebox.askyesno(message="Are you thinking of the " + "data " + "?" ,icon='question' ,title="My guess" [/code] … | |
Hi Everyone, I need to create a quiz game similar to “Who Wants to be a Millionaire?” in PYTHON by using a graphical user interface (GUI), but I am not sure how to do it. Can anybody please help me?Any help would be greatly appreciated!!!!Thanks a lot!!!!! | |
I'd like to post some code of an app I wrote to spit out large files, and sort them, and finally reassemble them. I'm new to Python, and the 'object' way in general. If you feel like it, would you please tell me how it should have been written 'properly'. … | |
I have the statement [CODE]fn = sys.argv[1] [/CODE] catching the filename at the command line when the user starts my program. The problem comes when a user uses a path with a space in it such as; 'C:\Documents and Settings\user\My Documents'. The argument parser sees ''C:\Documents' as the first paramenter, … | |
Okay, now that I consider myself to have decently mastered Python/Tkinter (or at least I'm no longer a complete noob), I'm turning my attention to the web. I'd love to be able to program applications that can be run easily via web sites (especially quick experiments). The easiest thing for … | |
I am trying to implement the game of life in a Tkinter GUI with python. Here is an example of what I am trying to achieve: [url]http://www.math.com/students/wonders/life/life.html[/url] (the java applet in particular) The question is quite basic, just as my background in python and programming in general. The effect that … | |
I have python 3.0 and im trying to get this code to work but I don't believe it is recognizing all the attributes it's supposed to. [CODE]import pygame, sys, random from pygame.locals import * #*******************************************SETUPVAR************************************************** BLACK = (0, 0, 0) WHITE = (255, 255, 255) RED = (255, 0, 0) … | |
I have 2 separate databases and I need to synchronize them (combine). One database is permanent the second one is updated every day. First I need to check the for a new entrances and print them out then I need to combine those two databases based on 1 key . … | |
I'm trying to print a (or many) large aerial photos converted from tiff's to jpeg's and cannot seem to get it done without a MemoryError message. These files are between 6 and 15 mb is size. These images are 9x9 photos with these dimensions: Width = 11705 Height = 11712 … | |
If I want to find the X coordinate of an image that's already on a canvas, how would I do that with tkinter? | |
Hello! I have created a database named Ornithobase, which contains a Users table with Name, FamilyName, eMail and Username columns. I have already connected to the database with MySQLdb module. How can I print this table in the console from the Python script? Furthermore, how can I perform a search … | |
I have a script here that takes a bunch of diff .txt files and plugs&chugs what's in one file into a master "template.txt" list. It basically replaces what's in the [BRACKETS] in the master template list with the other data files. Here's my code: [CODE] import re, sys class Template: … | |
This code worked fine under 2.6: [CODE]f = open("v20100515.csv",'rt') r = csv.reader(f) try: r.next() # skip the header record for row in r: n = 1 for col in row: print str(n) + ": " + col n += 1 ......[/CODE] But since I upgraded to 3.1, I modified it … | |
Hello all I am very very new to programming & Python. My problem is I cannot figure out how to create a line consisting of random colored pixels. I know how to create a white or red line but how to make the colors random is beyond me. This is … |
The End.