15,192 Topics
![]() | |
So for my intro to programming class our final project is designing a simple game in Python. i picked Lingo but I'm running into a huge problem. Lingo is played by the computer picking a random 5 letter word (from a .txt file) then the user guessing 5 times until … | |
I want to build a script that does the following: The script should do make an arry from the directory where the script is with os.listdir(). Then the script has to test if the value in the array already excists in the outcome file, if not the name in the … | |
Hello, I have been working on learning Python and I have been writing a game(CLUI not GUI) that has gone through a few phases. It started out as a 3-4-5 variant assuming 3 rows with 3 objects in the first row, 4 in the second, and 5 in the third … | |
Hi guys, First post so please don't be too harsh :D. I'm trying to open a .txt file, search for a specific line starting with (" Performance Summary"), copying the first and third numbers in the columns of the 4th line below it and every line below that until there … | |
I need help with two things.... 1. I would like to lower the speed of the snake. 2. I want to make the screen, snake, and food bigger. I really need to change the speed. The 2nd thing is just something extra. But, I've tried a bunch of little things … | |
Hi. i am trying to create deck of cards for uno game. i need to create draw and undraw functions for each card class. i dont know how to do this.. Thanks ! | |
[B]Edit2: I realized the title of the thread was misleading after the post was made..it's more like There's 6 lines per student..I need to make a list for each student. So it's 6X..where X is the number of students.[/B] Hi all.. I have a text file that looks like so: … | |
I've created a game , somewhat like space invaders, and it looks pretty cool , very proud of what ive done. But I'm stuck on finding a way of unit testing the collision of 2 sprites and the collision between the borders and a sprite. If anyone could point me … | |
Hi, I need to concatanate lines based on regex. Lines to be concatanated are scattered. All lines begin with number$number$number$number$sentences. There is nothing to mark the end of sentence, only the beginning. Here is an example. I want to rewrite this one [CODE]2 $5$233$ check big cat if it have … | |
Hey so Im a beginner, and I need some help. My professor gave us this code: [CODE] def average(list): total = 0.0 for number in list: total += number return total / len(list) [/CODE] Then, he asked us to rewrite that program so that it uses a while loop instead. … | |
Hello currently I have started a project for my school. The project is a program that can factor a trinomial. So far I have it set up to take the users inputs. then it multiplies two of the inputs to get a new number. My problem is that i need … | |
Hey so Im a beginner, and I need some help. My professor gave us this code: def average(list): total = 0.0 for number in list: total += number return total / len(list) Then, he asked us to rewrite that program so that it uses a while loop instead. So far … | |
Hi Everyone, I am trying to call a function after every T secs . When i use time.wait() , the app hangs, i do not have control over the app. For now , this programs will do the process once , and then after T secs . But i do … | |
I seem to be having a problem importing functions from a file whenever I use the wildcard "*". [code]from text import *[/code] Raises this error: NameError: global name '_Star' is not defined However, if I ask it to import the Function names' manually like so: [code]from text import _Star, _Zero, … | |
Hi everyone i'm very new to python , only have been working with it for about a week, and I have the following question.I'm making a Lingo game in which you guess a needed word, but the first letter is always given when started I have 3 lists in which … | |
I need to insert some rows into Excel. I know it can be done via xlApp.ActiveWorkbook.ActiveSheet.Rows("10:10").Insert() But what I need to know, is if I can use variables in place of the 10's. I need to insert rows at various places throughout an excel document, and input data into those … | |
How would you write this program in Python IDLE? Write a program with a function that accepts a string as an argument and returns (some type of return value) a copy of the string with the first character of each sentence capitalized. For instance, if the argument is "hello. my … | |
print "Aloha World" [CODE][/CODE] print "I'm currently living in Hawaii and gaining my AS @ Honolulu Community College" print " Also happily married with four lovely daughters and my boy due in mid-February 2012" print "really enjoy Basketball, and working hands on-with technology" print "work part-time at the Geek Sqaud, … | |
I have to create a dictionary using only capital letters and I need to store the bit value too. The capital letters however are in groupings of 3 and 2 letters (i.e., AA or ZZZ). Now, my code works fine but I would like to neaten it up (because I'm … | |
I'm creating a game and I want to incorporate a gif of a running man when the user uses the arrow keys etc. I'm currently trying to use wxpython and I have code that allows it to be played in a small separate window, but I need to know how … | |
I have an array [x,y] where the values of x is ascending and the y values are random. I would like to sum all of the y values together when the x values are within a certain range. I can't show you any code as i dont even know where … | |
I made a program to find primes, but it can't find any prime less that 7(e.g. 2, 3, 5) any ideas? [CODE]import math from math import sqrt x = 1 y = raw_input("What number do you wish to find all the primes below? ") y = int(y) while x < … | |
If I have class variables that are changed as a program runs, and at a certain point I want them all back to default without restarting the whole program, how would I go about it? | |
i have list. [CODE]Here is list 1 http://example.com/link1.html http://example.com/link2.html http://example.com/link3.html http://example.com/link4.html +++++++ Funny and Funny Sad and Sad [/CODE] [CODE]Here Is list 2 http://candy.com/link1.html http://candy.com/link2.html http://candy.comlink3.html http://candy.com/link4.html[/CODE] Append list2 into list1 we have result: [CODE]Here is list 1 http://example.com/link1.html http://example.com/link2.html http://example.com/link3.html http://example.com/link4.html Here Is list 2 http://candy.com/link1.html http://candy.com/link2.html http://candy.comlink3.html http://candy.com/link4.html … | |
Hi everyone, I need to use python to read some data in my csv file, but the file I have contains 15 rows of introduction in front. all the data I need is from the row 16. I am able to read the data as the way I want it … | |
Hi trying to recover an RSA encrypted 5 character word using a forward search dictionary attack in Python but having difficulty. The word was encrypted in 2 24 bit blocks (3648141 5604637) padding last block with a space e = 5 n = 21508387 table = {} for ptext in … | |
I'm having trouble writing binary data out to a file. My end goal is to add a chunk to a PNG file; which has a format of: length (4 bytes), type (4 bytes), data (lots of bytes), crc32 (4 bytes). Collecting each of these pieces is not a problem, but … | |
Is it possible to have an optional command-line argument? For example, I want: [CODE]script.py -b[/CODE] to behave differently than [CODE]script.py -b 6[/CODE] In script.py, an enumerated -b argument specifies a behaviour, but if no argument is specified, a behaviour is randomly chosen. Here is my experimentation with getopt. With an … | |
Apologies if this is not the place for this but I am looking for a python script that will 1) prompt for csv file 2) read in said csv file 3) count # of rows in said csd 4) for each row in csv, get each column as variable row … | |
...hello... ..i'm developing a Collection Management System for Student Organizations on our campus using C#...This will be use to track their annual collection activities (cash collection)... ...1 month ago, I succeeded and finally finished this system (yet there are still some bugs that im still working on).. ..Now, I have … |
The End.