- Strength to Increase Rep
- +5
- Strength to Decrease Rep
- -1
- Upvotes Received
- 6
- Posts with Upvotes
- 6
- Upvoting Members
- 4
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re:
I tried out one of the "Projects for the Beginner" ideas: the [URL="http://www.daniweb.com/forums/post223885-54.html"]change calculator[/URL]. Basically, you tell it how much the purchased item was, and how much the customer paid. Then it tells you the change due, and the most efficient combination of bills and coins to pay it. However, … |
|
Re:
Okay, I need to write a maze solver for the maze in the text file (yes it is an assignment). I am not asking for a direct answer, I just want someone to propose ways of solving the maze( I also have to mark the paths taken in the maze). … |
|
Is it possible to have a function run at the beginning of every function of a class without explicitly writing it? I'm going to have a class with 20 or so methods, and though I can just copy and paste, I was wondering if there was an easier way to … |
|
Re:
Hello, I have been working on a very simple Python Game so far (Not using pygame atm) and I ran into a problem that is very simple but I just do not know what to use to get it to work. Basically what I have right now is that the … |
|
I'm working on a game in pygame, and I decided I wanted to make it load flash files for the characters in battle so I could animate them in flash. Is there a module that will allow for easy displaying of multiple flash files, and also for skipping to certain … |
|
Re:
Hi, I am using Linux, and I was looking for free source code ( Python) for speech recognition, I found "Speech" for Windows. I have tried to run it on Linux, I got errors of missing modules, I found most of them online but when I got this error: [COLOR="Red"]No … |
|
Re:
Hello. I am stuck on a simple piece of code. For some reason it keeps saying it can't call the Str object. Im also unsure on how to float the data to 2 decimal points (i don't know where the 2.f% should go.) The task is to make a taxi … |
|
Re:
How could i index the program to output e.g. displayDate(10, 2, 2009) gives "10 Feb 2009" as the output. [code] def displayDate(day, month, year): Months = ['Jan', 'Feb', 'March', 'April', 'May', 'June', 'July', 'August', 'Sept', 'October', 'December'] [/code] |
|
Re:
I have been teaching myself python for several months and have started working on an rpg project. Right now I am trying to code an armor class for a basic character. I am not sure if my approach is even a correct way to go about implementing this class. The … |
|
Re:
My teacher gives a review sheet which is a lot like the exam if not the exam but with some minor changes. I'm stuck with these fill in the blanks. [CODE]Fill-In-The-Blank Word Frequency The following program gets the name of a file as a command-line argument, opens that file, reads … |
|
Re:
Hi, I am a newbie here and a python newbie as well :) I am having trouble implementing a program in which you must use only recursive functions and no built-in python functions other than the len function in order to determine if there are duplicates of an item in … |
|
Re:
Hello, I'm having a slight problem with my code. The task is to create an indexing program, similar to the ones the google uses. The problem i'm having is that we have to remove the common ending from the words left after the removal of stop_words(which is a list variable … |
|
Re:
Hi, I am still very new to python and programming so could anyone help me on how to input lines from a user, one line at a time until they type "." on a separate line. I also wanted to count how many lines they entered. What I tried was … |
|
Re:
Hi, I am trying to write a snippet of code that checks if the user entered a valid color from an imported file called graphics.py. [code] # Get a valid color value from the user. color = raw_input("Enter a color: ")[/code] graphics.py contains a huge list of built in color … |
|
Re:
Hi, there! I'm pretty new to the programing world and I have a question. How can I write this code so it returns to surv1.set_sex = raw_input? after the "not in sex statement"? It's really confusing maybe I should try and write it in someother way? I don't quite understand … |
|
Re:
Hi all! I want to make a subclass of dict and I have read about subclassing and the super method. The problem that I do not get is how I override the following method: [CODE]dict[key] = value[/CODE] This creates a new key with the specified value. I want to override … |
|
Re:
I was trying to create a 3x3 list of lists, and came up with this surprising behaviour: [code]# creating a 2D list with an overloaded * operator mlist3 = [[0]*3]*3 print mlist3 # [[0, 0, 0], [0, 0, 0], [0, 0, 0]] mlist3[0][0] = 1 print mlist3 # [[1, 0, … |
|
Re:
I understand the basic principle of recursion, but I'm having trouble implementing it in practice. I understand this first case perfectly fine. It works because n is constantly getting closer to 0. [CODE]def faculty(n): # Base case if n == 0: return 1 # Recursive call else: return n * … |
|
Re:
I'm making a macro in python and I need some help. Basically, it just loads up 4 line entries from a text file and just attaches those 4 things to the end of a URL, and opens firefox to that URL. It then waits a random time between 3min-8min and … |
|
Re:
The function has to show the population for year 1, 2 and so on until the population reaches 1 million. The population increases by 8% every year? [code] def population(): current=input("please enter the current population of the city: ") increase=current/100*8+current year 1=increase while increase>1000000? [/code] |
|
Re:
What is the command for starting files? Something like this im guessing [CODE] start.file(C:\test.txt)[/CODE] |
|
Re:
How do I get my python code to compile one line at a time so I can see exactly how the code works. If anyone knows how to do this with Wing IDE that would also be helpful. Thanks. |
|
Re:
I am just starting with python and I am trying to write a program that interfaces with flickr. I am using the interface flickr.py found at the following link: [url]http://code.google.com/p/flickrpy/[/url] I am calling the following function: [CODE]myPhotos = myPhotoSets[0].getPhotos()[/CODE] The shell is telling me there is an error in this … |
|
Re:
Trying to make a file that tests how many seconds it takes for python to use a while loop to count how many seconds 1000 loops takes. Not working, I don't know why. Every time I run this it outputs "('It took 0,0')"...The while loop didn't start. [CODE]import time import … |
|
Re:
I've been thinking recently about how cool it would be to make a rpg/text adventure game where you could fight monsters- in my case fallout3 inspired mutant hicks from the game point lookout. I have the room classes. (I can give code later in the day). how would i make … |
|
Re:
[CODE]area = ((length ** 2) * numSides) / (4 * (math.tan(FULL_ROTATION / (2 * numSides)\ )))[/CODE] this is my thought but I can't figure it out, I always get the wrong value. I need to get my answer in degrees. but even when i use [CODE]return math.degrees(area)[/CODE] at the end … |
|
Re:
[CODE=Python] def Myfunc(): print "Stuff" #Title: "CrashLanding" #By: Python User #November 16, 2009 #Features improved coding style, or at least I think so #note:code based on J.G.S'S code-I really learned alot from his code Some credit goes to him #note:I dont think that is his actual username so keep that … |
|
Re:
The function below is supposed to ask the user to enter a choice of rock paper or sciessors and output an error mesage if the user enters an invalid choice and then ouput a message if they won, drew or lost against the computer. [code] def rockPaperScissors(): import random choice=raw_input("please … |
|
Re:
Hello. This time it might be a bit more complicated. [CODE] def start_game(): global no_winner no_winner = True rows_cols() global board board = make_board() print_board() player_select() def rows_cols(): global rows global columns rows = int(raw_input('Height: ')) columns = int(raw_input('Width: ')) if rows < 4: rows = 4 if columns < … |