15,175 Topics

Member Avatar for
Member Avatar for baskar007

hi friends, I am building a small web application for linux in python lang. I am using httplib for the web interface. and currently i using the following exceptions in httplib. [QUOTE] httplib.HTTPException socket.error socket.herror socket.gaierror socket.timeout [/QUOTE] so i need error codes and descriptions for the exceptions. I have …

Member Avatar for baskar007
0
148
Member Avatar for germ

Sorry guys had to change threads name seeing that NO1 showed an interest in the beginner thread. Hope someone out there has some material that will be helpful. I just went through some python coding and tutorials lately. For me I am going to use python in a database environment, …

Member Avatar for jlm699
-2
90
Member Avatar for RogerI

Hi there, I would be very appreciative if someone could help me get my plots to work. I am plotting a y-variable against time, but on the x-axis the time tickmarks labels overlap. I have tried using the autofmt_xdate but it does not solve this problem in this case - …

0
61
Member Avatar for Moonrise_state

Hi guys, this is probably a very basic question so excuse me for that. In java you can say: [CODE]Instance instance[] = new Instance[6] for (int i =0;i<6;i++){ instancei[i]=new Instance(...) [/CODE] Or basically declare lots of instances very quickly. In python is there an equivalent where I could write: [CODE] …

Member Avatar for vegaseat
0
123
Member Avatar for donnyv

Hi, I am a total noob... I'm looking for a way to search a directory for config files and search each file for an entry that includes '1-' (bug apparently prepends this randomly) and delete that pesky 1- and save the file (on ubuntu). Any help or suggestions would be …

Member Avatar for donnyv
0
109
Member Avatar for lrh9

I'm using the code module to add an interactive interpreter to an object. This object has an interact method that when called creates an interactive interpreter with the object's dictionary as the namespace for the interpreter. When done interacting with the object, I want the "exit" function to return execution …

Member Avatar for lrh9
0
115
Member Avatar for J_IV

I'm new to python, and have just recently started using it as a means to circumvent my lack of calculus knowledge when performing physics equations. The problem I'm working on now is fairly simple, but I'm getting a bizarre syntax error I don't understand. Here's my code: [CODE]## Introduction ## …

Member Avatar for jlm699
0
87
Member Avatar for hondros

Okay, all I want to do for now, is create a rather simple python interpreter. I have already created a simple command prompt for windows, utilizing the os module, the script's code is here: [CODE]import os os.system("title Command Prompt") while True: osc = raw_input(os.getcwd()+">> ") if osc == "exit" or …

Member Avatar for lrh9
0
140
Member Avatar for eva yang

class Toy(object): def play(self, toy): ''''Print squeak''' print 'Squeak!' class Dog(object): def __int__(self, name): '''Name a dog''' self.name = name def call(self, shout): '''Return true if shout is exactly 'Here, n!', otherwise return False''' return shout == 'Here, ' + str(self.name) + '!' def play(self, toy, n): '''Print 'Yip! ' …

Member Avatar for eva yang
0
90
Member Avatar for fuston05

im asking w input() for user to input "spelling words" for a kids homework, and i want it to append or add the words entered into a list. i got it to ask for user input for the words, but not sure how to make it add them into a …

Member Avatar for fuston05
0
107
Member Avatar for hondros

Okay, I'm creating a game where you are a red circle on a black background, and you can move it around the screen, and you have to pick up the other dots. It's more complex than that, but I seem to be having an issue. Some dots will go away …

0
82
Member Avatar for Dan08

Well, couple days ago I've red in some thread in daniweb, which I was thinking in a solution for it. So the problem is Linux has got the speech recognition, El Duke was trying to find something like windows speech recognition for Linux. As Mathhax0r and vagaseat said, there isn't …

Member Avatar for Dan08
0
132
Member Avatar for zrin

Hi! I have a problem. How can I inport, numbers from a txt document and make a math operation with them. I have to transform the cotent of the document into a lists? Lets say this is the content of the file: 44 36 11 66 24 92 3 8 …

Member Avatar for Lardmeister
0
90
Member Avatar for kadvar

Hi, I'm trying to match patterns of the types sentence1 = "keywords=walter&keywords=scott" sentence2 = "keywords=john&" sentence3 = "keywords=james&keywords=john&keywords=brian&" so basically the keywords=somestring& part can be repeated once or multiple times. I am trying to extract the string(s) between '=' and '&'. I have come up with the following so far. …

Member Avatar for woooee
0
86
Member Avatar for gunbuster363

I am a linux newbie and I am wondering why some software developed for python is usually installed by doing "python setup.py install". What is it doing? what is the different of this comparing to "compile from source"? For instance, a package in this form: numpy-1.3.0.tar.gz I was told by …

Member Avatar for gunbuster363
0
137
Member Avatar for voolvif

Hi, I'm trying to use regular expressions on a log file and am trying to extract search terms. Each line in the file is of the form: [CODE]mystring = "00:00:11 192.168.21.44 GET /images/help.gif - 200 Mozilla/4.0+(compatible;+MSIE+5.0;+Windows+98;+DigExt) ASPSESSIONIDGGGGGQEG=CLDIHIJBJAPFAGBFIOMCFGGA;+PRO%5FOnline=SEARCHQUERY=%09%3Cinput+type%3Dhidden+name%3D%27HrowColumns%27+ID%3D%27HrowColumns%27++value%3D%271%3B6%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData10%27+ID%3D%27txtScopeData10%27++value%3D%27[COLOR="Red"]catherine[/COLOR]%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData30%27+ID%3D%27txtScopeData30%27++value%3D%27[COLOR="Red"]porter[/COLOR]%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData50%27+ID%3D%27txtScopeData50%27++value%3D%27%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData11%27+ID%3D%27txtScopeData11%27++value%3D%27%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData31%27+ID%3D%27txtScopeData31%27++value%3D%27%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27txtScopeData51%27+ID%3D%27txtScopeData51%27++value%3D%27%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27HCollection%5Fid%27+ID%3D%27HCollection%5Fid%27++value%3D%271%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27Submit1%2Ex%27+ID%3D%27Submit1%2Ex%27++value%3D%2736%27%3E%0D%0A%09%3Cinput+type%3Dhidden+name%3D%27Submit1%2Ey%27+ID%3D%27Submit1%2Ey%27++value%3D%2718%27%3E%0D%0A http://www.foo-bar.com/SearchResult.asp"[/CODE] I have put the search terms that I'm trying to extract above …

Member Avatar for bvdet
0
188
Member Avatar for lllllIllIlllI

Regex is one of the more complicated modules that you can use in python. Once you have learnt it though you can use it many different programming languages, so its a useful tool for using with strings. So first to use regex you must import it [code] import re [/code] …

Member Avatar for bunkus
3
2K
Member Avatar for lifeworks

im new to python, been working in php largely in the past, but wanted to learn something new and different. as such, i want to use python to create webpages, but have been tinkering in the IDLE until now... when using php, I use a local install of WAMP... is …

Member Avatar for Pupo
0
111
Member Avatar for prankyrules

Hey guys, I have a already written package in python2.5.1 for windows,it includes wxpython biopython1.44 modules and now i want to transfer it to unix server,is there any way i can do that or i have to write that functions again...\ Thanks in advance Prankyrules

Member Avatar for jlm699
0
113
Member Avatar for iamai

Hi there i am new at OOP and i want learn about it. I start with the book how to think like a computer scientist but at the ending chapters i get lost .... Can some one advice me a good book that covers OOP ?with good examples,diagrams e.t.c.

Member Avatar for vegaseat
0
112
Member Avatar for dorivalmartinez

Hello. I would like to open and read OO Writer. I used the script: [file = open('myfile.odt', 'r'] [lines = file.readlines()] [file.close()] [for i in lines: print i] I get some strange characters. I had write 'rb', instead 'r', but it did not work. I have copied a ODT file …

Member Avatar for vegaseat
0
4K
Member Avatar for Zetlin

Alright guys so I have a little problem with a nested list. so here is my list: [code=python] a = [[1,2,3], [4,5,6], [7,8,9]] #I know that I can do for example a[0][0] and that will return the first value in the first nested list but I don't know how to …

Member Avatar for vegaseat
0
113
Member Avatar for ketkig

Hi, My code requires to send an email to list of people that satisfy certain conditions. This email will in turn have a hyperlink to open another email,with subject and body pre populated. When I try creating this hyperlink, i want the code to be hidden ie. i want to …

Member Avatar for jlm699
0
3K
Member Avatar for mahimahi42

Hey, I'm trying to make a program restart if a function (in this case playAgain) is true. Is there a simple way to do this? Here's the end of my program: [CODE=python]theGame() if playAgain() == True: else: quit()[/CODE]

Member Avatar for dorivalmartinez
0
86
Member Avatar for TheNational22

I have a little program that goes to news aggregater's, gets the hrefs, and returns in a window. I want to have multiple windows open if multiple sites are choosen, right now, it will only go to the first one in a list, and completes perfectly. I assume I am …

Member Avatar for woooee
0
173
Member Avatar for gangster88

how could I make the function count?.. its a test marked out of 5, so if the user enters 1,1,2,2,4,5, then the output= 2 people got 1 mark, 2 people got 2 marks and 0 got 3 marks and so on?... i dnt knw if my code is even right.. …

Member Avatar for gangster88
0
81
Member Avatar for vitvn

response = urlopen("https://www.lingq.com/accounts/login/") #response = urlopen("http://www.google.com.vn") window = ParseResponse(response) window.document # HTML DOM Level 2 HTMLDocument interface forms = window._htmlforms # list of objects supporting ClientForm.HTMLForm i/face form = forms[1] print form #print form control = form.find_control("password") form["password"] = 'password' control = form.find_control("username") form["username"] = 'username' response2 = urlopen(form.click()) for …

0
53
Member Avatar for Godflesh

I try again in a new thread, the other went out of hand. I use this code line to create a n value. n = random.randint(0, 99), i use this n value as a lap index to my while loop. The loop is in a function called "def run(self)" in …

Member Avatar for Godflesh
0
109
Member Avatar for lrh9

I'm just wondering if it is possible to import a module as an object attribute. The basic description of what I want to accomplish is that I'm creating a software agent object. This agent will have a set of abilities (functions), but I don't know what these are ahead of …

Member Avatar for lrh9
1
335
Member Avatar for eva yang

Hi,there, assert pop == "berg", "Item removed from the stack was not \"berg\"." why using '...' can avoid syntax error ? Thank you :)

Member Avatar for eva yang
0
250

The End.