15,181 Topics

Member Avatar for
Member Avatar for tillaart36

Hello, im trying to implement a template matching algorithm with the use of Python + PIL and I'm trying to follow the code that wikipedia gives for template matching -> [URL="http://en.wikipedia.org/wiki/Template_matching"]http://en.wikipedia.org/wiki/Template_matching[/URL] Basically it loops through all pixels of a search image, and all pixels of a template. The sum of …

Member Avatar for vegaseat
2
3K
Member Avatar for pith

So I tried making my first program but it didn't work, but I can't figure out what is wrong with it. I have added some commentary with the code: [code]#!/usr/bin/env python import sys from random import randrange, shuffle, choice, sample DOORS = ['ant','ant','ant','bee','bee','bee','car','car'] def pickdoor(picked): """Returns a number representing the …

Member Avatar for Gribouillis
0
185
Member Avatar for punter999

hello seniors, i am in need of getting some good tutorial or any helping example by which i can get an idea about how to serialize the objects in wxpython. your help will be highly appreciated. Regards Punter

Member Avatar for punter999
0
104
Member Avatar for hondros

This code should be able to get you started to design 2-D scrolling games, like Mario. I spent a few hours trying to figure this out, and firgured I'd put up my efforts. I think there might be a better way to do it, but this should help you get …

1
1K
Member Avatar for germ

I just went through some python coding and tutorials lately. For me I am going to use python in a database environment, so what I wanted to ask is doesn't anyone here have some information that will sharpen my python programming knowledge very quickly with some get straight to the …

Member Avatar for Ene Uran
0
93
Member Avatar for deonis

Hello ! I am trying to make a little program, which would go through the string content, find some keywords inside of it and return their position in the text. Unfortunately my program does not work for the duplicated words like "AFIX" or "CONF" (see example bellow). Is there simple …

Member Avatar for deonis
0
138
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
141
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
87
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

The End.