15,175 Topics
| |
Hi I get a littel problem to read,sort,count and remove punctuation marks from text file. data="""I love the python programming How love the python programming? We love the python programming Do you like python for kids? I like Hello World Computer Programming for Kids and Other Beginners.""" ##f = open … | |
Hi, it's been a while since I have used Python and I am very rusty. I have a problem with a piece of code and I can't for the life of me figure out what is wrong. Basically I need a piece of code that prints 'to cold' if the … | |
Hi, I am looking to write a internet scraper, and have considered the following languages: Python C++ Java The scraper will need to: - Retrieve HTML code from a page - Select a link, name and description from a section of the page - Ask for user confirmation (non gui … | |
Hi, I'm having trouble trying to figure out a code that converts negative decimal numbers to binary, as well as specifying the number of bits. For example. convert -18 using 8 bits. This should come out as 10010010 doing it manually, I think. I'd appreciate the help, thanks. | |
Hi - I have a project I am going to be working on which will be a python gui. After meeting with the user yesterday I have found out that the computer this application will run on will not have internet access always. Which brings me to my question, how … | |
Hello everyone, I'm a beginner in programming languages and in Python. I came across this error and I don't khow if it is a logical error or a design error. The problem is with class_average a = {1:[1, 2, 3], 2:[3,4,5], 3:[6,7,8] } b = {1:[3,7,4], 2:[8,2,9], 3:[3,6,3] } c … | |
Hello, I am wondering what I am missing. Keep getting a syntax error at the chara on Line 8..... def main(): print('WELL! Hello. Thank you for choosing your path to'\ 'righteousness! bahahaha!') chara = raw_input(str('Please input your character name: ')) #print the welcome for user print('Ok,'chara,'This is just protype son … | |
Hi i am trying to parse a *large xml* file and printing the tags to a output file. I am using *minidom*, my code is working fine for 30Mb files but more than that its getting memory error.So i used buffer reading the file but unable to get the desired … | |
Hi, I have downloaded a code for Speech Recognition using Windows API (SAPI 5.1). In this part of code: `class ContextEvents(win32com.client.getevents("SAPI.SpSharedRecoContext")):` I get this error: class ContextEvents(win32com.client.getevents("SAPI.SpSharedRecoContext")): TypeError: Error when calling the metaclass bases cannot create 'NoneType' instances I checked and found that `win32com.client.getevents("SAPI.SpSharedRecoContext")` returns `None` I did search all … | |
file_name = raw_input('Name of the file you will use to encode the your data \n') file_name = file_name+'.txt' fp = open(file_name, 'r') text = fp.read() #create a string that is just the first letter of every word in the sentence then close file output = "" for i in text.split(): … | |
Hi again I’m working with the text file and I need suggestions about 2,4,5? and mybe about 1 and 3 also. For example I have this text. “I love the python programming How love the python programming? We love the python programming Do you like python for kids? I like … | |
I have been working with numbers in tkinter using operators but I'm unsure on how to process the input and using maths on them. I also wouldn't mind knowing how to use words either for future reference. Reply if you know anything. | |
Here is my line of code: class Rectangle(object): def __init__(self,x,y): self.x=x self.y=y def Area(self): return self.x*self.y def Perimeter(self): return self.x*2+self.y*2 def main(): print "Rectangle a:" a = Rectangle(5, 7) print "area: %d" % a.area print "perimeter: %d" % a.perimeter #print "" #print "Rectangle b:" #b = Rectangle() #b.width = 10 … | |
well basically i have to draw a stick figure for which is my first question... i cant figure out how to draw a horizontal line and also a line at a angle for the legs... here is the code for the first one def drawStickFigure(): from graphics import * win … | |
I'm currently working on an assignment for my intro python class in school. The program is a "guess my number" variant, but its focus is on global variables and the try/except operation. I've managed to figure out most of it, but I'm having trouble calling my function that gives a … | |
I have NO IDEA how to use Python. Best answer if you write the full program! Please help me! I will be forever grateful! Accept / Reject Monte Carlo Part I: Goal: Write a python program that will: 1. define a function for a specific probability density function f(x), 2. … | |
Assuming that every person has a National ID number, I am trying to check if the Entered number is a valid ID number, under these conditions: 1. ID number must be of 10 digits length. 2. If ID length is greater than/equal to 8 and less than 10 digits, add … | |
on linux i have been using pwd to get the file owner, but how do i do for Windows in python 2.6 since pwd module is supported in linux only..? | |
i have downloaded and installed from this [page](http://sourceforge.net/projects/pywin32/) but still when I import any of the modules[win32api, win32security, win32con] i get import error, please help me if I am not downloading the right version | |
I installed the new **pillow 2.0** on windows 7 python 3.3 using one of the installers with no problems. Apparently that installer provides the jpeg support necessary for Vegaseat's program (link below). However, I am having some kind of trouble getting the jpeg support to work on Ubuntu. After my … | |
Hello all...this is stumping me...it keeps returning a repetition of num ten times rather than multplying by 10...Which way can I fix this? def main(): num = input('Please enter a number: ') print(times_ten(num)) def times_ten(num): return 10 * num main() Thanks!!! | |
Hey, please how can i logically sort for numbers in a list list = [10, 5, 2, 7, 20] without the sort() using only if statements and for loops and no while loop. | |
Simple code to show you how to display an image from a Web URL using the Tkinter Python GUI toolkit, the Python Image Library (PIL) and the data_stream created with io.BytesIO(). | |
Hello , the problem i'm facing is how to insert a cliquable image in a frame , i show the code : def InterfaceDeps(): global interf0 interf0 = Toplevel() interf0.geometry("500x400") interf0.title(' Test Data') f1 = Frame(interf0, bg="blue", width=500, height=500) f1.pack( fill=X, expand=0) ####### Image ############# imageinfo = Image.open("C:/Documents and Settings/Administrateur/Bureau/Python_tests/nvprojet/Info1.jpg") … | |
Hi Im working with the old exercise in python and I need help please. The goal of this exercise is to extract information and statistical data from a log file. You can use the logfile generated by the linux kernel. You should write a python code which gives the following … | |
I am trying to remove a column from PyQt4 implementation of table model , however I am not able to figure it out what I am doing wrong def removeColumns(self, position, columns, parent = QtCore.QModelIndex()): self.beginRemoveColumns(parent, position, position + columns - 1) #Do removing here rowCount = len(self.__colors) for i … | |
given an audio signal x, there are a number of simple effects that can be implemented on such a file. we are to implement base dumps and treble dumps given piecewise functions relating to each | |
http://pastebin.com/4eCJUP8d The comment "zipCode, city and state variables are of type string, declare them to be lists if you want to use the append() method on them. Do not use where which is a reserved word in Python. I don't see a loop in the readRecord() method that iterates through … | |
A newb programmer here I have a project involving pedestrian simulation I'm planning to use libpedsim.dll in python with Ctypes but so far I cannot make the functions working Can anyone point out how to make use of this DLL? This is the class documentation: http://pedsim.silmaril.org/documentation/libpedsim/latest/classPed_1_1Tscene.html This is the link … | |
Guys how do I install WxPython in Ubuntu? I tried following the directions here: But to no avail.... [URL="http://wiki.wxpython.org/InstallingOnUbuntuOrDebian"]http://wiki.wxpython.org/InstallingOnUbuntuOrDebian[/URL] Is there an easier way to do this? |
The End.