15,190 Topics
![]() | |
I'm assigned a project in which i have to write a program that simulates the game of hangman using classes and GUIs. I'm really stumped on how to organized it into classes. I know that i want the word that is to be guesses to come from a list and … | |
Hi everyone. I am having a hard time modifying this code, I'm really new to python and I am trying to find the closest pair among the 10 input integers from a user. Here's my code so far and there is a syntax error... a = [0,1,2,3,4,5,6,7,8,9] a[0]=input() a[1]=input() a[2]=input() … | |
I need help with creating a program that produces a daily report for a store. I'm really bad at computer science so I'm not even sure where to start on this! Here are the instructions: Write a Python program to accomplish the following. Use modular design. Include at least 3 … | |
Hi, Have a csv-file with time as heading for each column and first column with depth and temperature inbetween. n*m table, or plot. I'm having problems reading the csv file: fname = r'C:\Users\Desktop\Temperature.csv' T1 = '15.08.2012 16:09:10' T2 = '15.08.2012 19:22:57' initial = time.mktime(time.strptime(T1, "%d.%m.%Y %H:%M:%S")) final = time.mktime(time.strptime(T2, "%d.%m.%Y … | |
Hi, I have a Python code that uses google app engine to get data via a html page. I need to modify the Python code and write a PHP code, so that the PHP code is able to pass on the required data, which is two numeric values, directly to … | |
Hi all, I am fairly confident with Python, and am now turning my focus from learning how to program the language to learning to program it well. I am wondering what the best way to approch classes which have too many variables in them. I an writing a platformer game, … | |
I'm writting a program that will take a file as input and go through the list of numbers in the file and return the max number uing recusions. I'm not very good with recursions here is what I have so far. Also I'm not allowed to use the max command. … | |
Is there a way to read in a two-columned CSV file, and based on the fields in 1st column, output many different files? The input/output looks something like: input.csv call Call Mom. call Call T-Mobile. go Go home. go Go to school. go Go to gas station. play Play music. … | |
Hello All!! I have an assignement that I am working on and for some reason I cannot for the life of me recall how to do something so simple lol. The directions are too "Write a function named Exam, which takes one argument n where n>2. Your function creates a … | |
i am in need of help with this homework. The instructions are as followed: Package Newton's method for approximating square roots in a function named newton. This function expects the input number as an argument and returns the estimate of its square root. The script should also include a main … | |
#Guess the number game by Johnathan Millsap import random guessesTaken = 0 print('Hello! What is your name?') myName = input() number = random.randint(1, 100) print('Well, ' + myName + ', I am thinking of a number between 1 and 100.') print('Try to guess it!.') while guessesTaken <= 3: print('Take a … | |
Hello everyone im pretty new to python and im having some trouble creating a program that takes a file containing numbers and imports it into python and makes it look like a table. the table is supposed to look something like this when the program is run. basically i figure … | |
I need help with my code. Im kind of new to program and i need to do a final project for my class. I decided to do a converter program because i thought it would be sort of easy and challenging at the same time. but i wrote the program … | |
Thw following piece of code generates 1 file for each row in csvData. I want to generate only 1 file and have already adapted the rest of the code. But not this main-loop. Is there an easy way to do this ? index = 0 # Generate the Scribus Files … | |
I have a piece of code where I fill variables with data and would like to add the first column of each row into the variable: So each variable in a row should contain: %VAR_ + 'value of column[0]' + headerRow[i] + % Now it looks like this which makes … | |
hi experts, I have a new quesiton following what I asked before: http://www.daniweb.com/software-development/python/threads/436159/python-remove-lines-when-two-specified-words-in-the-same-line I am still new python user, and hope and get your help again. my task is to do the following Python Remove current and following 3 lines when two specified words in the same line I have … | |
trying to impleament a checkWin function that checks all possible wins for a player, but I'm notreally sure how to do it. from connect4cell2 import Connect4Cells from Tkinter import * class Connect4Frame(object): COLORS = ["White", "Red", "Yellow"] def __init__(self,rows = 6, columns = 7): self.cells = Connect4Cells(rows, columns, 3) self.rows … | |
I'm in my first AND LAST computer science class and I really need help with our final project. Up to this point all of my assignments have been completed from my teacher and TA standing over my shoulder telling me exactly what to do. I'm pretty sure they're just as … | |
Hello everyone; I am new to Python. How can we explain this code step by step. I couldn't understand some parts. myList=[43,21,12,80,3,2,35] end=len(myList)-1 while (end!=-1): swapped=-1 for i in range(0,end): if myList[i]>myList[i+1]: temp=myList[i] myList[i]=myList[i+1] myList[i+1]=temp swapped=i end=swapped print(myList) | |
Consider a hospital scenario. Design classes for: Patients. The class might have fields like unique ID for the patient, name, male or female, age, address, phone number, date of birth, height, and weight. I need help with this problem | |
Design a schedule class for classes that a student takes during a semester? This is not a homework `class schedule: def classes(self, course, points, level,): self.course= course self.points = points self.level = level def get_course(self): return course.name` I am stock here | |
Can I change the font size in only one widget and keep it the same in the root window? if yes then how please? | |
Design a class called "sentence" that have a constructor that takes a string representing the sentence as input. The class should have the following methods: get_first_word get_all_words replace(index, new_word) Change a word at a particular index to "new_word." E.g. If the sentence is " I'm going back." and set_word_at_index (2, … | |
class airlineTicket: def __init__(self, start, destination, dateoftravel, firstClass,\ economy, business, price): self.start = start self.destination = destination self.dateoftravel = dateoftravel self.firstClass = firstClass self.economy = economy self.business = business self.price = price Design a class for an airline ticket. Some of the fields of an airline ticket are start, destination, … | |
This is my code for creating a url list and Im getting an index out of range error? Please help! #! /usr/bin/env python import re TOTAL_PAGES = 619 idFile = open("listOfURLs2", "r") outFile = open("output", "w") idList = [] urlList = [] temp = "" tempStr = "" currentList = … | |
I'm trying to process a list contained within a separate text file. I am able to read the file, and generate an output containing the contents of the file, but the output generated is the unprocessed version, identical to the input. I do not encounter this problem when the list … | |
Using print in a python script gives the following result: 10.25, 9.23, 8.97, 8.71, 8.40, 8.36, 8.30, 8.21 10.25, 9.23, 8.97, 8.71, 8.40, 8.36, 8.30, 8.61 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15 0.60, 0.60, 0.60, 0.60, 0.50, 0.50, 0.50, 0.15 4.85, 2.85, 1.85, 1.25, 0.95, 0.85, 0.80, 0.45 … | |
yesterday one of my friend tell me to make RTS engine in pygame......I know basic things which is used to make RTS Like 1. Unit selection 2. Unit moving 3. Resource management But only 1 thing i still cant figure out....Which is path finding.....I read all articles which is on … ![]() | |
Hi all, could anyone please provide me a simple example of python threads? I tried looking at the python cookbook, but I find it quite confusing with its mentioning of thread, threading etc (I am familiar with threads in C only) All I want is: From my machine I need … |
The End.