- Strength to Increase Rep
- +0
- Strength to Decrease Rep
- -0
- Upvotes Received
- 1
- Posts with Upvotes
- 1
- Upvoting Members
- 1
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
5 Posted Topics
I am having some problems with python. If I use IE to POST data to a page using a simple form, I get the following [code] POST /automa/auth.php HTTP/1.1 Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/x-ms-application, application/x-ms-xbap, application/vnd.ms-xpsdocument, application/xaml+xml, */* Referer: http://maroon5/automa/login.php Accept-Language: en-us Content-Type: application/x-www-form-urlencoded UA-CPU: x86 Accept-Encoding: gzip, …
[code=python] #!/usr/bin/python2 """Connect and dump web page """ import urllib2 HOST = 'hostname' PATH = 'index.html' URL = 'http://' + HOST + '/' + PATH F = urllib2.urlopen(URL) print F.read() [/code] The code above will read a web page.
Look at [URL="http://en.wikipedia.org/wiki/Adder_(electronics)"]http://en.wikipedia.org/wiki/Adder_(electronics)[/URL], what you are trying to code is two inputs, generally labelled A and B, and two outputs, the sum S and carry C. S is the two-bit XOR of A and B, and C is the AND of A and B.
I fixed it this way. [code=python]import math kills=int(raw_input("Please input the amount of kills: ")) deaths=int(raw_input("Please input the amount of deaths: ")) kills = int(kills) deaths = int(deaths) print "You're K/D is", float(kills)/float(deaths)[/code] In C code we had only one divide, so if you wanted float out you had too divide …
rajasekhar1242 try this. [code]import MySQLdb import _mysql_exceptions as DB_EXC try: cxn = MySQLdb.connect(host='10.0.2.2') if(cxn != 0): tkMessageBox.showinfo("Text", "you can update ur local database to server") else: tkMessageBox.showinfo("Text", "there is no connection please try again") cxn.close() except ImportError , e: return None[/code] What I found was imports after the try: and …
The End.
chaney44145