15,175 Topics
| |
I am new programming in Python. I am trying to create a function that simply takes the lowest payment (which starts at 10) and it simply returns the remaining balance (after 12 months of payments). 2. Outside the function I am using a loop that calls the function and checks … | |
I'm starting my Computing project and am using Python linked via sqlite3 to a database. As part of my project I shall be searching for maths books in the database via name or module etc. I wish to display the results on a GUI in python so need to set … | |
I am creating a page scraper and would like to include a text file that contains the words such as 'a', 'the', 'on' etc. But not sure how to do this, i think I have created the file fin=open("ignorelist.txt","w") for line in fin: but not sure how to go about … | |
So i have a recent python project and i'm struggling a little, if anyone could be of any assistance that would be great :). The project is to make a 'Flash Cards' type quiz within which i am required to make a random generator to import one randomly chosen keyword … | |
How to extract data from xml file using xml minidom with respect to tags in xml file | |
Write a payroll program that pays time and a half for anything over 40 hours. This should have 3 functions in addition to main The first function asks the user how many total hours were worked and the pay rate and returns this information to main. These values must be … | |
Hi, I have writen a code whit some functions and the program start by launching on of those functions. The problem is that some of the variables in the functions need too be accessed by other functions. I know that I can use global "variable name" but is there a … | |
import time pause = time.sleep(3) print "Welcome to the Game of Choice!" pause print "You will be given multiple choices throughout this adventure. How you choose determines how you end. Please answer questions in all lowercase letters. On all questions that require a yes or a no, type out the … | |
I am trying to generate a program using the builtin Random and generate an algorithm that determines whether the number is odd or even. I need to write a program that generates 100 random numbers, determine if its even or odd and finally count the number of even and odd. … | |
I need a code based on this attack on hill cipher http://practicalcryptography.com/cryptanalysis/stochastic-searching/cryptanalysis-hill-cipher/ in python. As I am not maths student I am so helpless in this. Also I need to specify the charecterset of my own here.. can anyone help? | |
This example calculates timed x, y points of a projectile motion that can be used for plotting or other calculations. | |
Hello fellow programmers, Im quite new to python and im trying to create a multi question quiz. I will paste my code below and it keeps saying I have syntax errors everywhere but I try and fix it and it simply hops to the next line. Could someone please tell … | |
I have a thread in the php area but my question is from python and php world a like so I would like some input form you guys on python part. [PHP Python web future](http://www.daniweb.com/web-development/php/threads/466242/php-framework-or-python-framework) Thank you. | |
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) in Pygame, but I am not sure how to start? Any assistance would be greatly appreciated!!!!Thanks a lot!!!! | |
I have el next dataframe from pandas import * from numpy import * data=read_csv('enero.csv') data Fecha DirViento MagViento 0 2011/07/01 00:00 318 6.6 1 2011/07/01 00:15 342 5.5 2 2011/07/01 00:30 329 6.6 3 2011/07/01 00:45 279 7.5 4 2011/07/01 01:00 318 6.0 5 2011/07/01 01:15 329 7.1 6 2011/07/01 … | |
Hi I am creating a webcrawler and would like to set a limit for how many steps from the original seed can be taken, when the limit is reached the web crawler should terminate. Not sure how or where abouts to add it to my code import urllib2 def getAllNewLinksOnPage(page,prevLinks): … | |
write a program that asks the user to enter five test scores. the pogram should display a letter grade for each score and the average test score. write the following function in the program. calc_average-this function should accept five test scores as a argument and return the average of the … | |
import os import web import traceback import datetime from functools import wraps ### Url mappings urls = [ '/', 'index', ] def addfolderhandler(f,root): u = os.path.join(root,f) u=u.strip("/").strip("\\") ident=u.lstrip("C:/Users/James/Desktop/it").replace("/","SLASH").replace("\\","SLASH").replace(".","DOT").strip() #replace invalid python expressions with valid ones globals()[ident] = "<h1>Directory listing for:%s</h1><hr>"%u+''.join(["<a href="+i+">"+i.lstrip(root)+"</a><br/>" for i in os.listdir(u)])+"<i>Python Server</i>" if ident=="": return try: … | |
As you know the inventor of the game chess was quite a clever fellow. As the story goes the inventor presented the game to the king and the king was quite pleased. The king asked what the inventor wanted as paym ent. He asked for a grain of cereal for … | |
I am working on a school project to create a basic, educational game. I started with the amazing code written by cactusbin and revised by Gareth Ress found [Here](http://codereview.stackexchange.com/questions/15873/a-small-bejeweled-like-game-in-pygame/15895#15895) for the basics of a bejeweled style game. The game objective is to match letters of DNA to make correct pairs … | |
I have a list that contains some paths ['/users/sanfx/test1', '/users/sanfx/test2/', '/App/project/modules'] dirModel = QtGui.QFileSystemModel() dirModel.setRootPath(QtCore.QDir.currentPath()) dirModel.setFilter(QtCore.QDir.AllDirs | QtCore.QDir.NoDotAndDotDot | QtCore.QDir.Files) # dirModel.setNameFilters(self.filter) dirModel.setNameFilterDisables(0) completer = QtGui.QCompleter(dirModel,self) completer.setModel(dirModel) completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive) self.addPathEdit.setCompleter(completer) i want to add both these list and completer to be set to completer for self.addPathEdit | |
Hi everybody, I'm interested in creating a web crawler, but can't really settle on what I'd like the program to do. It's more of an exercise in the technology, and expanding it to achieve new, great things. I am proficient in Python, so I will naturally be using that language, … | |
How should I make an entry appended to existing entries instead of overwriting the whole file ? class ReadWriteCustomPathsToDisk(object): """docstring for ReadWriteCustomPathsToDisk""" def __init__(self, modulePath): super(ReadWriteCustomPathsToDisk, self).__init__() self.modulePath = modulePath def _xmlFileLocation(self): xmlFileLocation = os.path.join(os.path.expanduser("~"), "Documents","searchMethod","modules.xml") return xmlFileLocation if os.path.exists(xmlFileLocation): return xmlFileLocation def readXml(self): xmlFile = self._xmlFileLocation() root = etree.parse(xmlFile).getroot() … | |
i am a begginer and so far this what i have def minimum(y,l): w=[l[0],l[1],l[2],l[3],l[4]) a= min([l[0],l[1],l[2],l[3],l[4]) return a def menu(x,l): if x == 1: make_table(l) if x == 2: y= int(input("enter a row (as a number) or a column (as an uppercase letter") if y in [ "1",'2','3']: minimum = … | |
I just discovered that while doing check of the functions available in `os.path` using `dir(os.path)` is not the same as shown by `dir(__import__("os.path", globals={}, locals={}, fromlist=[], level=-1))`, in the later case it is actually showing all the modules of `OS` while I just want to look inside for the modules … | |
i need to find a min and amx of the table and so far i can do the min of row 1 but nothing after that -------------------------------------------------------------------- |Name | A | B | C | D | E | -------------------------------------------------------------------- | 1 | 1.0 | 2.0 | 3.0 | 4.0 … | |
import random Number = random.randrange(100)+1 Tryz = 1 Attempt = int(raw_input("Please enter the number of attempt you want: ")) Guess = int(raw_input("Please guess the the number: ")) while Attempt != Tryz and Guess != Number: Tryz += 1 if Guess < Number: Guess = int(raw_input("Try a higher number: ")) else: … | |
Hi, I'm learning python and I'm having a bit of a problem sorting dictionaries. I'm getting dictionaries that look something like this: {'usain': [2, 52], 'tyson': [1, 11], 'carl': [3, 110]} which follows the format {'name': [score,time]}. I want to get a list of the names sorted by the highest … | |
A Python sort with a helper function to allow for mixed order sort like age descending and weight ascending. | |
If I input an arbitrary amount of points [x1,y1].....[xn,yn] into a function I need to somehow return/print the shortest distance between all of the points. I understand how to find the distance between two points (fairly easy and straight forward), but how do I take an arbitrary amount of points … |
The End.