15,190 Topics
![]() | |
Hi, I need two functions one that checks if the inputed number is a prime number and second one that splits the given number in to prafactors. I have the first function done but the second one is a bit annoying. The function has to take the given number and … | |
Hi everyone I have been given a python code to add some functionality in it. The problem am facing is that the original developer has hard coded 3 variables a,b,c in the code and these variables are before class definition in files: hers is the code snippet: [code] a = … | |
I know this is probably overly simple but I am terrible with math. This is a section from a game I'm attempting with PyGame. Instead of using pixels for coordinates I have my own render function that uses blocks(actually just cnverts block value to pixels), which are 32x32 pixels, so … | |
[CODE] bif="bg.jpg" mif="ball.png" import pygame, sys from pygame import * pygame.init() screen=pygame.display.set_mode((420,300),0,32) background=pygame.image.load(bif).convert() mouse_c=pygame.image.load(mif).convert_alpha() while True: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit() screen.blit(background, (0,0))[/CODE] [quote=error] Traceback (most recent call last): File "C:/Documents and Settings//Desktop/Programming/PYGAME TEST/pygame.py", line 4, in <module> import pygame, sys File "C:/Documents and Settings//Desktop/Programming/PYGAME … | |
Hi everyone, I am trying to get Python working on XAMPP. I'm running Windows Vista, XAMPP version 1.7.1., PHP is working without any problems. I followed the instructions from here: [url]http://www.macouno.com/2010/03/17/getti[/url] ... -on-xampp/ I did everything the same, restarted Apache service, rebooted the PC but still I get the following … | |
I was wondering how to make a sound play repeatedly in python. I'm making a simple alarm clock program, and at a certain time (6:30 for example) it will play a recorded sound over and over again until the user presses enter. I think I have that figured out, but … | |
Hey all. So I'm attempting to include mouse gestures as a part of a GUI I'm designing. I'm using the following code, and it works great HOWEVER only when the gesture is draw away from widgets/controls (such as buttons, statictext's, etc). If I start a gesture and cross the path … | |
Sorry for this post... Problem solved... had nothing to do with classes | |
What is the best way to terminate ReadFile once the data is done being read? I just sits there an hangs! I'm kinda new to Python so be easy on me! :) The other way i was able to read info from my pipe was blah = open(pipe) then blah.read() … | |
[CODE]dict = {'ENSTRUT00000047813': '1680', 'ENSTRUT00000047812': '2067', 'ENSTRUT00000047811': '2067', 'ENSTRUT00000047810': '2088', 'ENSTRUT00000047814': '738', 'ENSTRUT00000047808': '2208', 'ENSTRUT00000047809': '2001'}[/CODE] I want to find out the key with max value from the dict I am using the [CODE] protein = max(dict.iteritems(),key=operator.itemgetter(1))[0][/CODE] but it will give me results as [CODE]'ENSTRUT00000047814'[/CODE] though i know that it … | |
Can anyone please help me as i am new to python, i have a requirement for a cascaded menu(which should be dynamically built). The cascaded menu should have new at all levels and when the user clicks on new it should ask for keyword and when done it should add … | |
hi i need help to write two different functions the first one is to displaysquareroots that asks the user for a number n, and displays the square roots of the number from 1 to n and to 3dp so if the user enters 3 it displays the square root of … | |
Hi, I have been ask to do this: Write a function wallOfEyes that takes three parameters (radius, width and height) and displays, in a window of exactly the right size, a “wall” of brown eyes of the given radius and dimensions. E.g., the function call wallOfEyes(50, 4, 2) should give … | |
I have recently made a guessing game code and I am now trying to make it so when you enter a number above 3, it will give a print command that i will write. I don't need help on the print command, I just need to know what the string … | |
So im putting together a program that decompositions numbers on prefactors. Example: 252=2^2 3^2 7^1 and 1944=2^3 3^5 Put this into tuples: (wont use split, just for example) >>> split(252) [(2, 2), (3, 2), (7, 1)] >>> split(1944) [(2, 3), (3, 5)] This is the code that determines whether a … | |
Hello everyone, I'm new to this website and to prgramming in general. Taking a class and we're starting with python. Doin a programming project in which I need to do Data mining for a company. I'm stuck trying to get the company's monthly average for each month. I can A … | |
Greetings, I'm working my way through Michael Dawson's Python Programming for the Absolute Beginner book. At the end of chapter 4: "for Loops, Strings and Tuples", there is a challenge that asks so "improve Word Jumble so that each word is paired with a hint. The player should be able … | |
Hi there, I am in a first year programming class at Dalhousie University (Halifax, Nova Socita, Canada), and I need a little help with an assignment. The exercise is as follows: "[10 Points] Create a number guessing game. First, ask the user for some positive integer, n. Ask the user … | |
Hi, I have a date with the String like "20091128' and we have to check this date with current date ("20101118"). if that date is old then we need to do some rules. I've checked in google whether there any existance but there have different formats. Can anyone give me … | |
Hi, im newish to python and have been stuck on this coding for a few days I have managed to code so I take input from user of a string which I then list the string depending on how many strings are entered after a space so if the input … | |
This is basically what I have. I've commented out all the places where I know what to do, but not how to do it. PEG_HOLE = 10 PEGGED = "X" ##################### # Functions you need to fill out def roll_die(): # This function will simulate rolling two six sided dice … | |
I'm writing a program for a class that's a game. It has ten places to put a peg, numbered 1-10. You have to roll 2 die and the summation is the number you have to work with to try and fill in the board. So far, my program is as … | |
I need help converting this problem into a python program. I've been at it for days and its due tomorrow. Someone please help! In a locker room there are 1,000 lockers in a row numbered from 1 to 1,000. They are all closed. A monkey comes in and starting at … | |
Hi Droopy doesn't work on my Linux's distro with python 3.1 (with python 2.x everything was ok). (here you can find droopy [url]http://stackp.online.fr/?p=28[/url]) I've used this command 2to3 -w droopy and changed alot u" in " , in Translations section But now there is another problem [CODE] Traceback (most recent … | |
I just started to learn gui with wxpython I can see many objects have a style attribute, for example TextCtrl, self.inputArea = wx.TextCtrl(self.background, style=wx.TE_PROCESS_ENTER) Where can I see a list of available style for each object? Thanks | |
Hi all, I am in the process of automating functional tests. I have the following requirement. 1. The python script should invoke the Lauterbach automatically 2. The cmm file mentioned in the python script, should be loaded in to the Lauterbach automatically. Is there any commands to do it? Please … | |
Hi all, I am having problem printing chinese character in a text file. Some point to know: 1. I do not know the codec of the text file, but I know it is writting in traditional chinese. 2. I tried some approach from google, no one work I don't remember … | |
[code]> can't invoke "event" command: application has been destroyed while executing "event generate $w <<ThemeChanged>>" (procedure "ttk::ThemeChanged" line 6) invoked from within "ttk::ThemeChanged"[/code] Has anyone ever seen this error before? It keeps appearing when I load a toolkit I need for my project. I've been working to find out where … | |
Hi guys, I'm new to forum and to Python. I need some help with the python - MySQL interaction. I'm creating a program for my conclusion project in College and it's not working. I gotta present it on Wed, 11/24, and I'm really desperate for some help. It's suposed to … | |
Hey all, Hopefully this will help someone with a problem I encountered. For a few days now I was looking for a way to concisely set the attributes to numerous controls without duplicating attribute code again and again. For example, let's say I have 3 static text controls and I … |
The End.