15,181 Topics

Member Avatar for
Member Avatar for dynaflex

I need to modify this code to promt the user for a word and display how many times the word appeared in the input file. class HashTable( object ): """A data structure that contains a collection of values where each value is located by a hashable key. No two values …

Member Avatar for TrustyTony
0
172
Member Avatar for jordan0420

I am currently working on my first serious GUI application in python using Tkinter. I currently have a toplevel window that opens from the root window. when i envoke the window from the root i can see all 7 of my other widgets, but the widget: btncancel = Tkinter.Button(addboard, text …

Member Avatar for jordan0420
0
6K
Member Avatar for CharlieNewey

Hi, I was pondering this earlier and wasn't sure if it was possible. Say, for example you had 2 objects; [B]spam[/B] and [B]eggs[/B], and you wanted to create a function to change attributes - e.g. colour. So spam.colour = 'Blue' and eggs.colour = 'Green'. How would you change that attribute …

Member Avatar for griswolf
0
381
Member Avatar for Masood_786

Hi All i have downloaded following code from web that inputs sound samples and displays spectrum, i want to print frequencies present in each second in the spectrum.i.e when ever the spectrum is displayed i want to print those frequencies as well on the console. Below is the code i …

Member Avatar for ssharish2005
0
340
Member Avatar for saransh60

hello friends i have just completed the python reading from book called "how to think like a computer scientist Python" ..Now i want to dive for Django framework for web development is that book(how to think....)is enough or should i polish my python skills first.....Please note that i have no …

Member Avatar for ssharish2005
0
125
Member Avatar for lewashby

I was told that there are four python string delimiters but I can only think of three, ', ", & """. What is that last one? I searched google but with no luck.

Member Avatar for richieking
0
168
Member Avatar for hema dhevi.N

hi friends i am a beginner in python programming. I have written code to download 16 pdf files. I am getting the pdf file but I am unable to open the file it is showing error. please help me. [CODE]import re,urllib url="http://www.ncbi.nlm.nih.gov/books/NBK16" id1=[30,24,25,28,22,23,14,33,21,29,16,27,18,20,17,26] j=1; for i in id1: address= url+str(i)+'/pdf/ch'+str(j)+'.pdf' …

Member Avatar for hema dhevi.N
-3
104
Member Avatar for Ghostenshell

Trying to call the gcd from the constructor but I keep getting either a global error or gcd is not defined error. Any suggestions? The program is supposed to reduce fractions immediately. So I got rid of the add. [CODE]class Fraction: def __init__(self,m,n): self.num = m self.den = n gcd() …

Member Avatar for -ordi-
0
104
Member Avatar for Masood_786

Hi All i have downloaded following code from web that inputs sound samples and displays spectrum, i want to print frequencies present in each second in the spectrum.i.e when ever the spectrum is displayed i want to print those frequencies as well on the console. Below is the code i …

Member Avatar for Masood_786
0
683
Member Avatar for mbox_96

Hello python experts! I have a simple script that sends an email with no problem, in order to interface with vb6 I'm tried to modify the entire code into COM service...but I'm having trouble with this error..global name 'MIMEMultipart' is not defined which is on the send_email method. any help …

Member Avatar for mbox_96
0
4K
Member Avatar for rubik-pypol

Hi, I am a new user and I want to show you my Python library. [B][I][U][COLOR="Red"]pypol[/COLOR][/U][/I][/B] pypol is a Python library that allows you to manipulate monomials, polynomials and algebraic fractions. An example: [CODE]>>> import pypol >>> a = pypol.polynomial('3xy - 3a^2 + 2b') >>> a - 3a² + 3xy …

Member Avatar for rubik-pypol
0
398
Member Avatar for -ordi-

Hei, I tried to find "dynamic programming" algorithms in Python. If anyone has examples of what it means a dynamic programming, it's would be nice. (Please not post Wikipedia links). Google -> c++, java and other, not Python. Thanks!

Member Avatar for richieking
0
174
Member Avatar for tcl76

hi, i'm new to python. i want to read from a text file (as attached) and i want to plot a scatterplot. i want to plot lane as X-axis, EyVt and EyHt as Y-axis. i have a sample code but i need help on how to get python start reading …

Member Avatar for tcl76
0
5K
Member Avatar for Enorym

Hi, I'm new to Python and having difficulty opening my .py file (ex1.py). In the command prompt I cd to the folder containing the file and when I try to open it nothing happens. The prompt just gives me a new line. It looks like this... 1. I open the …

Member Avatar for Enorym
0
144
Member Avatar for zizuno

I have this IRC bot that I am hard coding from scratch just for kicks. In it I pasted all of my functions to a separate file so that it saves spaces on my eyes when I code the mainframe. So on my imports I have: [code] import socket, re, …

Member Avatar for zizuno
0
172
Member Avatar for CharlieNewey

Hi, I'm a relative newb to Python and I'm starting my first major project - a logarithmic graphing system. I'm using tkinter for the GUI part of the design, but I've run into a problem. Basically, I want my graph (a tk canvas) to appear in the same (root) window …

Member Avatar for CharlieNewey
0
5K
Member Avatar for funfullson

Hello dears. I am using python 2.6 in Ubuntu 10.10. I need an interface that make me able to trace my project. for example portable python ver 1.1 has this ability. please intruduse me an interface that be compatible with my os. Thanks.

Member Avatar for funfullson
0
166
Member Avatar for GatorAlli

I'm using Python, PyQt4, and QtWebKit to load a web page into a bare-bones browser to examine the data. However, there is a small issue. I'm trying to get the contents and src of every iframe on the loaded page. I'm using [B][I]webView.page().mainFrame().childFrames()[/I][/B] to get the frames. To problem is, …

0
169
Member Avatar for rhuffman8

I don't know if anyone here is familiar with the Scala digital signage programs but hopefully this question can be answered without any knowledge of it, just in case... I am working with a Python script that checks a csv file and shares some of the info with a scala …

Member Avatar for griswolf
0
944
Member Avatar for iwanttolearnc

im trying my hand at calling c functions from python. im reading up the tutorial [URL="http://csl.sublevel3.org/C-functions-from-Python/"]http://csl.sublevel3.org/C-functions-from-Python/[/URL]. however part of the tutorial says that i should [QUOTE]Compiling dynamic libraries on Mac OS X is different from the usual gcc -shared you might be used to: gcc -dynamiclib -I/usr/include/python2.3/ -lpython2.3 -o myModule.dylib …

Member Avatar for gerard4143
0
225
Member Avatar for Ashena

Hi. I have an external file where I have the results of a dictionary: [CODE]google.com {'facebook.com': 230, 'yahoo.com': 9, 'fifa.org': 67, 'msn.com': 3} yahoo.com {'apps.facebook.com': 13, 'msn.com': 9, 'myp2p.eu': 2} [/CODE] The results show the search engines, the links have been clicked from the search engine and the number of …

Member Avatar for Ashena
0
406
Member Avatar for vbx_wx

Is there any difference between polymorphism implemented in c++ and the one implemented in python ?

Member Avatar for bumsfeld
0
72
Member Avatar for vbx_wx

[code] class A: def __init__(self): print 'A()' class B(A): def __init__(self): A.__init__(self) print 'B()' class C(B): def __init__(self): B.__init__(self) print 'C()' c = C() [/code] Cans omeone help me explaining what am I doing wrong here? I`m getting an error like: [code] B.__init__() TypeError: unbound method __init__() must be called …

Member Avatar for vbx_wx
0
129
Member Avatar for rssk

hi all........ file1 99 root S 5176 95 [B]41.2[/B] 8.3 snmpd file2 99 root S 5176 95 [B]1.0 [/B] 8.3 snmpd i want to caluculate difference between two files fifth column(i.e bolded columns as mentioned above).. thanks in advance...:'(:)

Member Avatar for snippsat
0
190
Member Avatar for _neo_

I have two codes in C and in Python. They gave me different results. Can anybody explain how they works, why I get different results? Thank you in advance!!! In C: ----------- #include <stdio.h> int main() { int a = 100; printf("%d = %02x\n", a, a); a = ~a; printf("%d …

Member Avatar for _neo_
1
214
Member Avatar for mnmo88

Hi guys, this is the first time for me to post something, i'm really a big fan of the site and so far every time i get stuck in something at uni i come to here. so thanks for helping me survive so far. anywho, i'm here because i need …

Member Avatar for mnmo88
0
143
Member Avatar for Ene Uran

You can download the matplotlib free from: [url]http://matplotlib.sourceforge.net/[/url] It has, amongst many other things, the module pylab that allows for high quality plotting of data. All you have to do is to feed it a list of x values and the corresponding list of y values calculated from the x …

Member Avatar for Flintstone_
2
2K
Member Avatar for Tommymac501

I am having a problem using the common dialog in PyQT. For some reason, when I try and import 'QFileDialog', I get a not found error, same with importing QDialog. I am on Py 2.7 (was 2.6) using 'PyQt-Py2.7-x86-gpl-4.8.2-1'. I can import QTCore and QTGui just fine. I thought PyQT4 …

Member Avatar for Tommymac501
0
2K
Member Avatar for meensatwork

Hello, Iam trying to get a table from the html page.I succeeded in getting the table values.But i have problem in getting the field names in the 1st column. [CODE]# Getting the field names.How to strip the 'b' and get only the names paramKey = table.findAll('b') print paramKey[/CODE] The above …

Member Avatar for richieking
0
211
Member Avatar for rscubelek

Hey guys, I've been lurking around these forums for a few weeks now, and this website is by far the most helpful of any site I've visited as far as honing my newfound Python skills, and I figured it's time I jump in and ask some of the more specific …

Member Avatar for rscubelek
0
595

The End.