15,181 Topics
| |
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 … | |
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 … | |
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 | |
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 … | |
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 … | |
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 … | |
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 … | |
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, … | |
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 - … | |
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] … | |
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 … | |
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 … | |
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 ## … | |
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 … | |
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! ' … | |
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 … | |
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 … | |
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 … | |
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 … | |
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. … | |
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 … | |
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 … | |
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] … | |
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 … | |
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 | |
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. | |
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 … | |
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 … | |
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 … | |
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] |
The End.