162 Posted Topics
Re: 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 … | |
Re: 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. | |
| |
Re: You can find all you need [URL="http://lmgtfy.com/?q=android+game+animation"]here.[/URL] | |
Re: I would charge enough to pay a months bills for something this simple. | |
[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 = … | |
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 … ![]() | |
Re: 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 … | |
Re: 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. | |
Re: 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. | |
Re: try [URL="http://www.daniweb.com/code/snippet269617.html"]this.[/URL] | |
Re: 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. | |
Re: Pyinstaller is also a binary compiling package for python. It may be easier to use than Py2Exe, but I would highly recommend using py2Exe. | |
Re: [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 | |
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. … | |
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", … | |
Re: 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. | |
Re: 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. | |
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. … | |
Re: 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. | |
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 … | |
Re: 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 … | |
Re: 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. | |
Re: This place doesn't like web frameworks period. I posted a question on django several months ago, and is still unanswered. | |
Re: 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 … | |
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] … | |
Re: I think what you need is the re module. | |
Re: Converting to Twisted would be the best option in my opinion. But using threads might help solve this problem. | |
Re: 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. | |
Re: [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 += '~~' + … | |
Re: 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. | |
Re: 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. … | |
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 … | |
Re: 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 … | |
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 … | |
Re: Well, Google has Chuck Norris on their side. If anything is going to happen; Apple will be roundhoused to oblivion. | |
Re: [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 - … | |
Re: 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] | |
Re: 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] | |
Re: 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 … | |
Re: 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. | |
Re: 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] | |
Re: 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 … | |
Re: 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] | |
Re: 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 … | |
Re: [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 … | |
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 … | |
Re: 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 … | |
Re: 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 "." … | |
Re: 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 … |
The End.