162 Posted Topics

Member Avatar for MUFC4life

predator78 is right. Also, I don't know if it's the website, your IDE, or format errors from copying and pasting; most of your object methods are spaced which will throw exceptions. I.E.: [code] #your code pygame . display . flip() #should be pygame.display.flip() [/code] That goes for most all of …

Member Avatar for Tech B
0
163
Member Avatar for almoj4ever

No one here is going to do your homework for you, well I will but for $40. This forum is for helping you with your code; as in write it yourself, and if you get stuck at some point, show us what you have so far and we will help.

Member Avatar for predator78
0
168
Member Avatar for Krstevski
Member Avatar for NewOrder

You can find all you need [URL="http://lmgtfy.com/?q=android+game+animation"]here.[/URL]

Member Avatar for NewOrder
0
144
Member Avatar for loungeowl
Member Avatar for Tech B

[CODE] #include "windows.h" #include "loadbmp.h" // from http://gpwiki.org/index.php/LoadBMPCpp #include "fdlib.h" void main(int argc, char *argv[]) { int i, n, x[256], y[256], size[256], w, h, threshold; BMPImg *bi; unsigned char *bgrdata, *graydata; if (argc==1) { printf("usage: fdtest bmpfilename [threshold]n"); exit(0); } bi = new BMPImg(); printf("nloading %sn", argv[1]); bi->Load(argv[1]); w = …

Member Avatar for Mahnaum
0
187
Member Avatar for Tech B

This is a facial recognition system. Supports one face so far. This is an example ported from C++ to python. To see the original and to obtain the dll used visit [URL="http://www.kyb.mpg.de/bs/people/kienzle/facedemo/facedemo.htm"]this site.[/URL] I do not take credit of the dll, only the ported python code. The comments in the …

Member Avatar for Tstrv
1
657
Member Avatar for Ene Uran

Maybe you guys didn't install the pylab the correct way. I've never used pylab, but usually when its an import error python can't find the lib's you installed. Try installing pylab with the setup.py instead of the installer .exe (assuming you used the installer .exe) for thoese of you who …

Member Avatar for Flintstone_
2
2K
Member Avatar for dark3lf

You could write a web scrapper and avoid the API's all together. Some sites will let you by-pass "user" status by useing googles spiders user agent.

Member Avatar for Tech B
0
115
Member Avatar for slfisher

How about facebook adopt a obituary database. There has to be something out there keeping track of dead people, partner with said company or hopefully there databases are already open and free.

Member Avatar for slfisher
0
527
Member Avatar for ch1zra
Member Avatar for Gribouillis
0
144
Member Avatar for jyothics23

maybe try adding two "\": [CODE]data = '\\x02' + '1T025.0F00R1000000000000000' + '\\x8B' + '\\x03'[/CODE] I've also noticed some serial communications require a new line char after each [I]command[/I] try adding "\n" at the end.

Member Avatar for Tech B
0
2K
Member Avatar for Deeplop

Pyinstaller is also a binary compiling package for python. It may be easier to use than Py2Exe, but I would highly recommend using py2Exe.

Member Avatar for snippsat
0
193
Member Avatar for frankinaround

[CODE] from ctypes import * user = windll.user32 user.SetCursorPos(50,50)[/CODE] search for more of my code, I give examples on how to click

Member Avatar for vegaseat
0
100
Member Avatar for Tech B

Been a while since I posted anything here, so I decided to post what I've currently been working on. I use ImageChops to get a difference between two consecutive frames from my webcam. I would like to replace the pixel values > rgb 50, 50, 50 with 255, 0, 0. …

Member Avatar for Beat_Slayer
0
123
Member Avatar for Tech B

I'm going to start learning web development useing Django. I'm following the tutorials on their site and when I run "python manage.py runserver" i get a traceback saying: [code] Traceback (most recent call last): File "manage.py", line 11, in <module> execute_manager(settings) File "C:\Python26\lib\site-packages\django\core\management\__init__.py", line 362, in execute_manager utility.execute() File "C:\Python26\lib\site-packages\django\core\management\__init__.py", …

Member Avatar for tls-005
0
219
Member Avatar for darknessamman

The body variable should have a third entry that looks something like: [code] body = {'user':user, 'pswd': passo, 'submit':'Submit'}[/code] or something like that. You will need to find it in the source of the page you want to log into.

Member Avatar for darknessamman
0
135
Member Avatar for airsoft

You don't need a book. Google is the best teacher I've ever had the pleasure of learning from. And if your going 3D game venue; Panda3D is really simple and well supported. You can model everything in Blender and export to .egg.

Member Avatar for n.cramp
0
213
Member Avatar for Tech B

This bot has some common functions, along with some not so common. I've been using this code to text my wife from work when my phone dies. Requirements: [LIST] [*]Gmail account (for texting) [*]xgoogle (for lang translation) [/LIST] I know it is messy, and the variables are named poorly; sorry. …

0
482
Member Avatar for pracks

If your wanting to do image processing, make a program that counts how many blue pixels are in an image, or how many other colors are in an image. Or a find and replace pixels based on their RGB value.

Member Avatar for onlyvidya
-1
139
Member Avatar for Tech B

I am trying to access some functions with in a dll I downloaded. I know I need to use ctypes, but all the examples and tutorials use windll.kernel or windll.user32 respectively. How would I go about calling a function with in xyz.dll? EDIT: Never mind, with a bit more digging …

Member Avatar for Member 785599
1
197
Member Avatar for Mkaveli

Panda3D is the way to go. You just need to find an .egg exporter for 3Dmax; [URL="http://www.panda3d.org/manual/index.php/Converting_from_3D_Studio_Max"]This[/URL] will help you get started. Then just load your exported models into panda3D. If you haven't checked out panda3D yet look [URL="http://www.panda3d.org/manual/index.php/Main_Page"]here.[/URL] I used to work with panda3d, but have moved on to …

Member Avatar for Tech B
0
338
Member Avatar for gsingh2011

I think the problem in the original code is you didn't handle any cookies, or change your useragent. Take a look at [URL="http://www.daniweb.com/code/snippet278635.html"]this.[/URL] Facebook really doesn't like datamining on there servers. I'm not saying that's what your doing; just giving a heads up.

Member Avatar for Beat_Slayer
0
251
Member Avatar for mehdi0016

This place doesn't like web frameworks period. I posted a question on django several months ago, and is still unanswered.

Member Avatar for Tech B
0
75
Member Avatar for tiddster

If its a site that doesn't allow programs or scripts to access them, you'll need to change your user-agent, and possibly be able to handle cookies. [code] import urllib, urllib2, cookielib cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) opener.addheaders.append(('User-agent', 'Mozilla/4.0')) opener.addheaders.append( ('Referer', 'http://www.daniweb.com') ) resp = opener.open('http://www.daniweb.com') source_of_index = resp.read() #write …

Member Avatar for Tech B
0
152
Member Avatar for Tech B

I've always loved games and decided to pick up dev as a new hobby. I'm aiming to do something like Johnny Lee and track head position for a VR display. I've heard it called frustum correction or the "portal effect". [URL="http://www.youtube.com/watch?v=Jd3-eiid-Uw"]Here is a link to see what I'm talking about.[/URL] …

Member Avatar for Tech B
0
170
Member Avatar for aframe
Member Avatar for Syphilis

Converting to Twisted would be the best option in my opinion. But using threads might help solve this problem.

Member Avatar for Tech B
0
98
Member Avatar for j23

He did say decimal, so I'm assuming he wants floats. If it is a float, use the examples given, but instead of [code]int()[/code] use [code]float()[/code] Warning.... Python doesn't handle floats too well, so you might have to check out the decimal module in the standard library.

Member Avatar for ultimatebuster
0
2K
Member Avatar for pixeldroid

[code] cmndList = ['cmds.sphere(n = "aBall", r = 1)', 'cmds.sphere(n = "aBall", r = 2)', 'cmds.sphere(n = "aBall", r = 3)', 'cmds.sphere(n = "aBall", r = 4)', 'cmds.sphere(n = "aBall", r = 5)', 'cmds.sphere(n = "aBall", r = 6)'] cmndString = '' for i in cmndList: cmndString += '~~' + …

Member Avatar for pixeldroid
0
175
Member Avatar for G_S

If the strings have newline charecters \n, try splitting the text. [code] s = """this is some text this is some more text yet some more text""" sList = s.split()[/code] Play around with splitting.

Member Avatar for G_S
0
107
Member Avatar for jinjonBoo

The cmd is quite handy. I made a simple batch file to open a cmd in the directory its in, that way I just copy the batch file to the folder I'm scripting in and can open it from there; instead of having to cd to the directory I want. …

Member Avatar for Tech B
0
349
Member Avatar for Tech B

I want to improve my programming skill and decided to build python wrappers over other library's. I've done this with the face recognition and think it would be real world code for me to work on. I want to code as a career and I want to code stuff programmers …

Member Avatar for woooee
0
130
Member Avatar for dbphydb

try this [code] import urllib, urllib2, cookielib cj = cookielib.CookieJar() opener = urllib2.build_opener(urllib2.HTTPCookieProcessor(cj)) opener.addheaders.append(('User-agent', 'Mozilla/4.0')) opener.addheaders.append( ('Referer', 'url to page') ) login_data = urllib.urlencode({'all_top' : 'setCheckboxes(this.checked), 'submit' : 'Deploy'}) resp = opener.open('url to page', login_data) #f = open('test.html','w') #f.write(f.read()) #f.close() resp.close() [/code] resp is the response after the button is …

Member Avatar for Tech B
0
2K
Member Avatar for Tech B

I'm revisiting an old IR tracking project, and want to use it in a blender game. I would like to know if anyone could help optimize the parsing algorithm or tell me an easier way to track multiple points with code. "im" is an instance of an image I captured …

Member Avatar for TrustyTony
0
233
Member Avatar for Techwriter10

Well, Google has Chuck Norris on their side. If anything is going to happen; Apple will be roundhoused to oblivion.

Member Avatar for Jelousmee034
0
642
Member Avatar for Roiti

[code] #!/usr/bin/env python from socket import * import sys, time from threading import Thread class Pscan(Thread): """ A simple port scanner, just returns whether a port is open, and displays the results in a semi-graphical way. Usage: %s <host> [start port] [stop port] Changelog: v0.1 - Basic scan v0.2 - …

Member Avatar for The_Kernel
0
248
Member Avatar for james27

Take a look at [URL="http://www.daniweb.com/code/snippet278635.html"]this[/URL] and [URL="http://www.daniweb.com/forums/thread282269.html"]this.[/URL]

Member Avatar for Tech B
0
176
Member Avatar for jeffjpeterson

You can use the os module to change the names as well. Assuming Windows: [code]os.system("rename longsongname.mp3 songname.mp3")[/code] or [code]os.rename("longsongname.mp3","songname.mp3")[/code] To shorten the names, you'll need slicing. [code] longName = "Thisisalongname.mp3" shortName = longName.split(".")[0][:5]+".mp3"[/code] output [code]>>> shortName 'Thisi.mp3'[/code]

Member Avatar for jeffjpeterson
0
284
Member Avatar for xleon

testzip is to check the integrity of the files within the zip. To check if a zip itself is corrupt, pass it through a try statment. [code] import os, zipfile mylist = os.listdir("C:\myzipfiles") for z in mylist: try: x = zipfile.ZipFile(z) print "%s opened ok" % z x.close() except: print …

Member Avatar for xleon
0
4K
Member Avatar for Stefano Mtangoo

You could open the page via urllib2 read the source, and look for image extensions. Regex and plan old slicing could do it. You could also parse for image tags. The html parse lib that came with the standard library could help.

Member Avatar for Tech B
0
199
Member Avatar for Hawkeye Python

You also need some error checking, it's good practice. Example: [code] rraise = raw_input("Do you really want to raise? y/n ') if rraise == 'y': bet += 1 elif rraise == 'n': pass else: print "y or n please..." return bet[/code]

Member Avatar for lllllIllIlllI
0
95
Member Avatar for AJIThopeful

I don't know about a A+ cert being discounted or free, but the CCNA and/or NET+ certs could be covered by the IT company you would be working for. My professor told me he took his Security+ free because the company he was working for at the time paid for …

Member Avatar for jwenting
0
126
Member Avatar for netvigator

I had a snippet on jut this. It may be cookie bad cookie handling, or lack there of. Check this out: [url]http://www.daniweb.com/code/snippet278635.html[/url]

Member Avatar for Tech B
0
1K
Member Avatar for captain.don

Have you tried running it from the startup folder? And I don't know the guts of windows too well, but maybe it has something to do with not being logged on. Certain process and programs don't start until logon, the program could be dependent of those processes or programs. Also …

Member Avatar for Tech B
0
196
Member Avatar for tbrambor

[QUOTE=tbrambor;1206444]I am trying to get some data off a Brazilian government website. The data is accessible through a form with some javascript. I am able to get the form and fill it out, but have trouble submitting it (a button needs to be clicked). I am using the library mechanize …

Member Avatar for tbrambor
0
4K
Member Avatar for Tech B

I would like some feed back on my code. It is an IRC bot written in Python 2.6. What I might be doing wrong/inefficient. Better ways of doing something. And anything that will help sharpen my skills. I know I probably should have wrapped it into a class, and the …

Member Avatar for snippsat
0
199
Member Avatar for camigirl4k3

So what is the program supposed to do? Are you supposed to input a number and get the word form of the number? Or input the word and get the integer it represents? And incase you didn't know the code tags they are [COD'E] [/COD'E] with out the ' in …

Member Avatar for TrustyTony
0
131
Member Avatar for Arfarf

Something like this would work if you knew what cam right before the number you need. I use re.findall all the time when scanning html. [code]import re s = 'this is a string containg stuff like 10.255/100.0 and the likes." found = re.findall('like (.*)/100.0') #Some crude error checking if "." …

Member Avatar for Arfarf
0
121
Member Avatar for joshua91

This looks similar to jcao219's solution. The difrence is the if/elif/else statments. I included this to show the importants of error handling. If the user entered "no" or "something stupid" as the input, the else statement would catch it. You could also handle errors with try/except statements also. [code] import …

Member Avatar for Hummdis
0
158

The End.