15,175 Topics

Member Avatar for
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
672
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
396
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
942
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
405
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
Member Avatar for gunneronaspooky

Hey guys...Need some help with a program for class...here's the assignment If your program detects an error condition, you can make it raise an exception. Here is an example that gets input from the user and checks for the value 17. Assuming that 17 is not valid input for some …

Member Avatar for gunneronaspooky
0
177
Member Avatar for danholding

hey guys and girls i am having a bit of a problem with my code [CODE] import os,string,sys,pprint,time,glob from datetime import datetime, timedelta fileList = os.walk('.')#if i use glob.glob it does not show any files now = datetime.now() TWA = now + timedelta(days=-1) #print(TWA) files=str() for files in fileList: fileStats …

Member Avatar for griswolf
0
353
Member Avatar for rhuffman8

I am relatively new to Python and just have a couple quick questions about using file paths in Python code. 1) As I was recently playing around with the command line, I could not get a file path to work correctly unless I used forward slashes in the path...for example: …

Member Avatar for richieking
0
396
Member Avatar for sohel807

Why I have not seen any underline with the menu items although I have put "&" within the menu names. My code is as follows: [CODE]import wx import os class MainWindow(wx.Frame): def __init__(self, parent): self.dirname='' # A "-1" in the size parameter instructs wxWidgets to use the default size. # …

Member Avatar for richieking
0
276
Member Avatar for vbx_wx

[code] a = 10 def foo(x = a): print x a = 5 foo() [/code] Can someone explain why it prints 10 ?

Member Avatar for vbx_wx
0
98
Member Avatar for python3

Hey Guys, I have a minor problem with pytesser for the internet!!! I want to create a program that calculates equation from the internet. I need pytesser to recognize the equation and python to calculate it. Example: 5 + 5 = [ ] Then Sendkeys will type the answer in …

0
58

The End.