15,175 Topics
| |
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 … | |
Hi, I have just started to learn python. I have installed and set the environment variables as per documentation. And from command prompt, I execute some python script,too. But I can't execute multiple line script, if the script contains any function. For example, see the following code - >>>a,b=0,1 >>>print … | |
If this is my np array: [ [ 1 2 3 4 ] [ 5 6 7 8 ] [ 9 0 1 2 ] ] I want to turn it into: [ [ 4 3 2 1 ] [ 8 7 6 5 ] [ 2 1 9 0 … | |
Hello! I have this funtion to delete a record from a MySQL table: [CODE]def delUser(): #Delete user #Ask for user to delete Username = raw_input('Which user would you like to delete? ') #Delete user delUser = '''DELETE FROM Users WHERE Username = %s''' cursor.execute(delUser,(Username)) db.commit()[/CODE] The problem is that it … | |
I have recently tried installing cherrypy to no avail, and it got me wondering, is there a way to build websites using the wxpython toolkit? if somebody knows the answer and could point me in the right direction it would be a massive help | |
Ok, back to differences between 2.x and 3.x... I have the following code to convert the sort key to a float: [CODE]def sort_key_func(row): return float(row[76][0:5]) [/CODE] which (under 2.x) returned the value of the field in the current row in position 76 for a lengthof 5. It was called like … | |
Well i have a small code snippet which is a basic http server. Well its running fine , but i am unable to catch the feedback and store it in a log file of my own for further analysis. code snippet : [URL="http://codepad.org/MppnYU9n"]http://codepad.org/MppnYU9n[/URL] just in case wondering on how to … | |
[CODE]I want to download attachments from email and search through them for a string of characters such as http://. The attachments will be in many formats, .doc, .html, .pdf. I am unfamiliar with mime and wanted to know if there is a way i can parse through the mime to … | |
I recently tried to run some scripts in Python on my .db file, but whenever I try to establish a connection, I get the following error: [code = python] >>> conn = sqlite3.connect('C:\Users\1545User\Documents\SEETA\ShruthLaikh\dict2. db', isolation_level=None) Traceback (most recent call last): File "<stdin>", line 1, in <module> sqlite3.OperationalError: unable to open … | |
i want explore the use of PIL but my first try got me this error : ImportError: " No module named ImageGrab " i tried it in terminal by typing 'python -v', 'import Image' but im broke. please help! thanks[CODE] import ImageGrab capture=ImageGrab.grab() capture.save('screen.png')[/CODE] | |
Is there any way to get a border like this in Tkinter? Notice how it lacks the buttons on the top right. Also I don't want this program to show in the task bar. This is in windows 7, btw. | |
If I created Tkinter window with some text that filled the whole window and now wanted to replace the window with a new text, is there a way to refresh the window? For Example: a= 100 win= Tk() win.geometry("500x300") while a > 0: if a%2 == 0: lbl = Label … | |
Just a curious Question, Is there a way of putting Vpython in wxpython as we do in case of wx.MediaCtrl and other stuffs? | |
Can someone tell me how to display an image with pygame. By the way I am using python 3.x. | |
In my projet, I can't find how to determine which image and pixel coordonate at clicking image in different ScrollArea. The result was showing in statusBar() area. (See screenshot) I put a code in txt file with 2 jpg use with it. Thanks in advance. | |
Please help me with this bug. I have python 3.0 and I was using pygame and for some reason it isn't reconizing [CODE]windowSurface[/CODE] here Is the code Im having problems with and thanks in advance. [CODE]import pygame, sys, random from pygame.locals import * #*******************************************SETUPVAR************************************************** BLACK = (0, 0, 0) WHITE … |
The End.