15,181 Topics
| |
Sorry, I posted this in software development not python. How do i make an auto-incrementing column? Heres my pseudocode/sql attempt c.execute('''CREATE TABLE <tableName> ( <columnName> <auto incrementing??!!>, <columnName2> text, <columnName3> text, <columnName4> text ) ''') | |
I have the following web crawler code and would like to add a limit as to the depth of the search but unsure how to implement this. import urllib2 def getAllNewLinksOnPage(page,prevLinks): response = urllib2.urlopen(page) html = response.read() links,pos,allFound=[],0,False while not allFound: aTag=html.find("<a href=",pos) if aTag>-1: href=html.find('"',aTag+1) endHref=html.find('"',href+1) url=html[href+1:endHref] if url[:7]=="http://": … | |
Why is this stacking ontop of each other, as far as the index should get each of them to next row. data1 = {'PHOTOSHOP': '6.5', 'NUKE': '7.0v9', 'MAYA': '2014', 'TESTING': '1.28', 'KATANA': '1.7', 'MARI': '4.0'} data2 = {'PHOTOSHOP': '10.5', 'NUKE': '6.3v6', 'MAYA': '2012', 'TESTING': '1.28', 'KATANA': '1.0', 'MARI': '1.0'} class … | |
Write an algorithm and draw a flowchart to print the square of all numbers from LOW to HIGH. Test with LOW=1 and HIGH=10. | |
How do i make an auto-incrementing column? Heres my pseudocode/sql attempt How do you make an auto-incrementing ID for a record c.execute('''CREATE TABLE <tableName> ( <columnName> <aut incrementing??!!>, <columnName2> text, <columnName3> text, <columnName4> text ) ''') | |
not working. I am using python 3.3.2. please and thank you. import urllib u = urllib.request('http://www.ctabustracker.com/bustime/map/getBusesForRoute.jsp?route=22') info = u.read() f = open('rt22.xml', 'wb') f.write(info) f.close() | |
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 = … |
The End.