15,175 Topics

Member Avatar for
Member Avatar for tony75

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 …

Member Avatar for tony75
0
491
Member Avatar for PSB92

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 …

Member Avatar for Schol-R-LEA
0
159
Member Avatar for John Linux

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 …

0
76
Member Avatar for ALJ

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.

Member Avatar for klickagent
0
9K
Member Avatar for lancevo3

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 …

Member Avatar for slate
0
156
Member Avatar for gmorcan

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 …

Member Avatar for woooee
0
262
Member Avatar for mkweska

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 …

Member Avatar for Schol-R-LEA
0
218
Member Avatar for vivsshake

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 …

Member Avatar for vivsshake
0
347
Member Avatar for molisoft

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 …

0
55
Member Avatar for Rick345

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

Member Avatar for Rick345
0
225
Member Avatar for tony75

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 …

Member Avatar for tony75
0
498
Member Avatar for entropic3105

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.

Member Avatar for bumsfeld
0
314
Member Avatar for lewisrs89

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 …

Member Avatar for bumsfeld
0
1K
Member Avatar for jaison2

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 …

Member Avatar for bumsfeld
0
10K
Member Avatar for cobaltbravo

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 …

Member Avatar for cobaltbravo
0
300
Member Avatar for alexamicaa

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

Member Avatar for sepp2k
-2
664
Member Avatar for M.S.

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 …

Member Avatar for M.S.
0
2K
Member Avatar for krystosan

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..?

Member Avatar for krystosan
0
114
Member Avatar for krystosan

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

Member Avatar for krystosan
0
823
Member Avatar for rwe0

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 …

Member Avatar for vegaseat
0
844
Member Avatar for mkweska

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

Member Avatar for vegaseat
0
263
Member Avatar for Subomi

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.

Member Avatar for vegaseat
0
290
Member Avatar for vegaseat

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

Member Avatar for vegaseat
3
4K
Member Avatar for Ismatus3

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

Member Avatar for Ismatus3
0
6K
Member Avatar for tony75

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 …

Member Avatar for tony75
0
136
Member Avatar for krystosan

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 …

0
122
Member Avatar for bogc

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

Member Avatar for bogc
0
116
Member Avatar for Fernando_1

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 …

Member Avatar for vegaseat
-2
79
Member Avatar for LostStranger

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 …

Member Avatar for vegaseat
0
462
Member Avatar for HoneyBadger

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?

Member Avatar for vegaseat
0
329

The End.