15,194 Topics

Member Avatar for
Member Avatar for dany12

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.

Member Avatar for dany12
0
748
Member Avatar for Somee

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!!!!

Member Avatar for Schol-R-LEA
0
1K
Member Avatar for glez_b

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 …

Member Avatar for vegaseat
0
9K
Member Avatar for laura301019

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): …

0
84
Member Avatar for tinku.cater

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 …

Member Avatar for vegaseat
0
335
Member Avatar for james.lu.75491856

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: …

Member Avatar for vegaseat
0
259
Member Avatar for Vinolia

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 …

Member Avatar for vegaseat
0
416
Member Avatar for Badgeking

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 …

Member Avatar for vegaseat
0
523
Member Avatar for krystosan

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

0
87
Member Avatar for BlackPhoenix

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, …

Member Avatar for vegaseat
0
235
Member Avatar for krystosan

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() …

0
112
Member Avatar for ptim123

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 = …

Member Avatar for Gribouillis
-1
163
Member Avatar for krystosan

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 …

Member Avatar for Gribouillis
0
210
Member Avatar for ptim123

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 …

Member Avatar for Schol-R-LEA
0
328
Member Avatar for Vusumuzi

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: …

Member Avatar for fonzali
0
244
Member Avatar for ant1vanden

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 …

Member Avatar for vegaseat
0
170
Member Avatar for vegaseat

A Python sort with a helper function to allow for mixed order sort like age descending and weight ascending.

3
495
Member Avatar for bradley1234

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 …

Member Avatar for vegaseat
0
188
Member Avatar for j.rf

No idea how to get my scatter plot to talk to my colorbar. I have taken endless approaches and consulted every forum all to no avail. I am either very close or nowhere near, surly this should only be a one or two liner?? Please help. import matplotlib.colors as cols …

Member Avatar for j.rf
0
414
Member Avatar for dany12

What will be the language of the feature web PHP or Python? What framework will be the future a php one or a python one? I would like to add that Laravel for php is still young and the development is not made by a corporation so I don't think …

Member Avatar for profmuluka
1
459
Member Avatar for bradley1234

We have a list of numbers, for example, [1,1,1,1,2,2,3,4,5,3,3,3,11,12]. Because we have four 1's, two 2's, etc. The new list would be as followed: [1,4,2,2,3,1,4,1,5,1,3,3,11,1,12,1]. I have the following code, but I am stuck. Can anyone give me advice? def rlEncode(data): for i in range(len(data)): n = data[0] if n …

Member Avatar for Schol-R-LEA
0
105
Member Avatar for bradley1234

I want to make two polynomials and then add them. We have two lists, [1,2,0,3] and [2,3,0,0,1]. The polynomials are as followed: 3x^3+2x+1 and x^4+3x+2. I have the following code, but I'm getting stuck. Any advice? I'm new to python. def polyAdd(poly1,poly2): for i in range(len(poly1)): z = poly1[i] return …

Member Avatar for vegaseat
0
200
Member Avatar for Alexander_2

I am creating a basic hangman game using tkinter. The last thing that I need to do is to add a widget that has an image to show the actual hangman. However, I keep getting this error whenever I try anything: File "C:\Program Files (x86)\Python\lib\tkinter\__init__.py", line 3287, in __init__ Image.__init__(self, …

Member Avatar for vegaseat
0
8K
Member Avatar for marethamogale

write a program in python that gets the word from the user and tells them if it is a parindrome or not.your program should not care about capitalization

Member Avatar for vegaseat
-1
133
Member Avatar for ksekwamote

improve the word jumble game so that each word is paired with a **hint** ,then the program should display the corresponding hint.use nested sequence to store the words and hint

Member Avatar for vegaseat
0
954
Member Avatar for Lone Ramoupo

PHow do we improve the word jumble game so that each word is paired with a hint. if the player enters hint then the program should display the corresponding hint using a nested sequence to store the words and hint.

Member Avatar for vegaseat
0
952
Member Avatar for krystosan

if i try to dump from shell like this `python -c 'help("modules")' > ~/Desktop/modules.txt` but if I try to execute from within the python like this `>>os.system("python -c 'help("modules")' > ~/Desktop/modules.txt")` i get error File "<stdin>", line 1 os.system("python -c 'help("modules")' > ~/Desktop/modules.txt") ^ SyntaxError: invalid syntax once i get …

Member Avatar for krystosan
0
204
Member Avatar for krystosan

in the designer when i right click a widget, and i click promote to i get this window? see attached screenshot what is it for ? does that mean i can create a new class in this case inherit QLineEdit and add more methos to it ? how can i …

0
147
Member Avatar for dreking6

i recently took up a project on openvpn when i got the source code of an openvpn application written in python by ivanzoid http://code.google.com/p/pyopenvpnman/ but after laying my hands on many things and reshaping the application i couldnt go any further because of some errors detected 1.writing to a config …

0
150
Member Avatar for dreking6

i am working on a project but this parts seems to stall me i want to be able to write to a text file to change just two lines of d file say line 1 and 3 using wxwidgets i will appreciate helps nd suggestions thanks

Member Avatar for dreking6
0
621

The End.