Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~17.8K People Reached
Favorite Forums
Favorite Tags
Member Avatar for adam291086

I have a file that contains a class, its called test.py. How can i call on that class within another file called xml.py?

Member Avatar for chethan_2
0
14K
Member Avatar for adam291086

I am trying to delete a cookie by reseting it but it wont delete. What am i doing wrong [CODE]#!/usr/bin/python import cgi import Cookie import os def cookie_expiry_date(numdays): from datetime import date, timedelta new = date.today() + timedelta(days = numdays) return new.strftime("%a, %d-%b-%Y 23:59:59 GMT") print 'Set-Cookie: UserID=0; expires= '+cookie_expiry_date(-100); …

Member Avatar for ret801
0
231
Member Avatar for adam291086

Hello i am new to java and playing around with some scripts. I have three java files [B]Main.java[/B] [CODE]package snake; import javax.swing.*; import java.awt.*; public class Main{ public static void main(String[] args) { new board(); } }[/CODE] [B]board.java[/B] [CODE]package snake; import javax.swing.*; import java.awt.*; public class board extends JPanel { …

Member Avatar for Stefano Mtangoo
0
158
Member Avatar for adam291086

Hello, i am trying to add a keyboard event listener to my Jpanel. But i am having no sucess. This is my [B]board.java[/B] [CODE]package snake; import java.applet.Applet; import java.awt.*; import java.awt.event.*; import java.awt.geom.*; import java.awt.image.ImageObserver; import java.util.logging.Level; import java.util.logging.Logger; import javax.swing.ImageIcon; import javax.swing.JComponent; import java.awt.Image; import javax.swing.JPanel; import java.awt.event.ActionEvent; import …

Member Avatar for thomas_naveen
0
1K
Member Avatar for adam291086

i am trying to set a cookie with TG2 like [CODE] cookie = Cookie.SimpleCookie() cookie["ADAM-TEST"] = "random.randint(1000000000)" cookie["ADAM-TEST"]["domain"] = ".jayconrod.com" cookie["ADAM-TEST"]["path"] = "/" cookie["ADAM-TEST"]["expires"] = \ expiration.strftime("%a, %d-%b-%Y %H:%M:%S PST")[/CODE] When i do the following [CODE] print "Content-type: text/plain" print cookie.output() print print "Cookie set with: " + cookie.output()[/CODE] i …

Member Avatar for ov3rcl0ck
0
101
Member Avatar for adam291086

i currently have this nested list [[u'Alice Mee', 3], [u'Alice Mee', 4], [u'adam plowman', 1], [u'james pirret', 2]] I need to remove the last number from each list so i have something like [[u'Alice Mee'], [u'Alice Mee'], [u'adam plowman'], [u'james pirret']] the list is populated dynamically and will always change …

Member Avatar for adam291086
0
113
Member Avatar for adam291086

I am trying to spilt a message in two, if the number of characters is greater that 600, so that each message has no more than 600 characters. How can i do this i know how to get the message length [CODE] Message = "sdkfhdslkfhdskfhsdlfjsdlk" print len(Message) [/CODE] but i …

Member Avatar for scru
0
113
Member Avatar for adam291086

Why wont my cookie set in firefox [CODE]#!/usr/bin/python import Cookie print "Content-type: text/html\n" C = Cookie.SimpleCookie() C["number"] = 7 C["string"] = "seven" print C["number"].value print C["string"].value print C print "Set-Cookie: string=seven; " [/CODE]

Member Avatar for adam291086
0
79
Member Avatar for adam291086

I am trying to print out some database resutls as follows [CODE] cursor.execute("SELECT * FROM User") numrows_user = int(cursor.rowcount) i_user = int(0) Results_user = cursor.fetchall() while i_user < numrows_user: print Results_user[i_user]["ID"] [/code] Put i am getting nothing i know i_user is working and i know there is information in the …

Member Avatar for adam291086
0
108
Member Avatar for adam291086

I have a third party sending me some infomaion. They say to use php $_post to recieve the information as follows [CODE]<?php //include the database handling class include("mysqlclass.php"); //Assign POSTED variables $destination = $_POST['gwNumber']; $originator = $_POST['originator']; $message = $_POST['message']; $smsTime = $_POST['smsTime']; $timeZone = $_POST['timeZone']; $network = $_POST['network']; $id …

0
86
Member Avatar for adam291086

I am trying to set a cookie but when i check my browser cookies nothing is set. What am doing wrong [CODE] #!/usr/bin/python # e begoli, python connector for mysql # import MySQL module import MySQLdb import cgi import Cookie import time cookie = Cookie.SimpleCookie() cookie["ID"] = "" print "Content-type: …

Member Avatar for adam291086
0
220
Member Avatar for adam291086

In php you can use $_GET['adam'] to get the information from adam in the url Can you do the same in python? if so how?

0
73
Member Avatar for adam291086

I am trying to write some simple information to a file and i am getting the error message "No such file or directory when i know full well it exists. If you take the url [url]http://www.adamplowman.com/uni_project/log.txt[/url] you get the file heres the code [CODE]#!/usr/bin/python print "Creating a text file with …

Member Avatar for Gribouillis
0
118
Member Avatar for adam291086

I am trying to construct a class and call upon some functions within that class, but nothing is returned, somehting should definitely be returned [CODE] #!/usr/bin/python import cElementTree as ET import urllib2 import MySQLdb print "Content-type: text/html\n" class xml: @staticmethod def find_text(element): if element.text: yield element for subelement in element: …

Member Avatar for adam291086
0
164
Member Avatar for adam291086

I have this script and it was working a couple of weeks ago. Now when i run it nothing is printed out other than white space. WHY??? [CODE]#!/usr/bin/env python from xml.etree import ElementTree as ET import os import urllib def find_text(element): if element.text is None: for subelement in element: for …

Member Avatar for adam291086
0
103
Member Avatar for adam291086

Can someone please tell me why this class wont work. [CODE]#!/usr/bin/python import MySQLdb class test: @staticmethod def wanker(): # connect db = MySQLdb.connect(host = "localhost", user = "username", passwd = "Password", db = "test") # create a database cursor cursor = db.cursor(MySQLdb.cursors.DictCursor) # execute SQL select statement cursor.execute("SELECT * FROM …

Member Avatar for adam291086
0
72
Member Avatar for adam291086

I am trying to print out a dictionary result. The dictionary is made from a database search. I have tried to print it in every possible way here is the code [CODE]#!/usr/bin/python import elementtree.ElementTree as ET import urllib import MySQLdb print "Content-type: text/html\n" info={} def find_text(element): if element.text is None: …

Member Avatar for adam291086
0
116
Member Avatar for adam291086

Ok i can send this soap request in PHP no problem. But i need to do something similar with python. The authentication happens in the SOAP headers. How can i construct a soap header with python, i am using the module SOAPpy. Any help is appreciated.

0
35
Member Avatar for adam291086

Hello, I have a group of regular expressions <Element Generation at d66238> <Element Vitals at d662b0> <Element Network at d66670> <Element Hardware at d66eb8> <Element Memory at d6ac88> <Element Swap at d6e0a8> <Element Swapdevices at d6e238> <Element FileSystem at d6e5d0> <Element Vitals at d662b0> i need to get the word …

Member Avatar for Gribouillis
0
101
Member Avatar for adam291086

Some languages like C# create an Auth object to authenticate themselves on a soap server. for example [CODE] cpLatestBrief.authValue = new auth(); cpLatestBrief.authValue.username = "username"; // your aql username cpLatestBrief.authValue.password = "password"; // your aql password [/CODE] how can you do this with python?

Member Avatar for adam291086
0
97
Member Avatar for adam291086

I am trying to read in a simple xml file and display all the child elements all i get is the error [QUOTE]Traceback (most recent call last): File "/Users/adamplowman/Documents/Uni/project/python/test_xml.py", line 10, in <module> for element in tree: TypeError: iteration over non-sequence[/QUOTE] Here is the xml file [CODE]<root><child>One</child><child>Two</child></root>[/CODE] and this is …

Member Avatar for adam291086
0
164
Member Avatar for adam291086

I have the variable Adam that contains some information. Later on i have some more information to add to the variable adam. How can this be done something like [CODE] adam = "john" adam = adam + "mike" [/CODE]

Member Avatar for paddy3118
0
88
Member Avatar for adam291086

I am trying to create an authentication script. I am trying to use the PASSWORD function within Mysql but it wont work. Any ideas [CODE] #!/usr/bin/python # e begoli, python connector for mysql # import MySQL module import MySQLdb import cgi print "Content-type: text/html\n" # connection db = MySQLdb.connect(host = …

Member Avatar for adam291086
0
120
Member Avatar for adam291086

[CODE]#!/usr/bin/python # e begoli, python connector for mysql # import MySQL module import MySQLdb # connect db = MySQLdb.connect(host = "localhost", user = "adamplo1", passwd = "U7RJM5HQ", db = "adamplo1_UniProject") # create a database cursor cursor = db.cursor() # execute SQL select statement cursor.execute("SELECT * FROM User") # get the …

Member Avatar for Stefano Mtangoo
0
113
Member Avatar for adam291086

I am trying to send a message using SOAP. Everything seems to work but no message comes through. I get no error message at all here is my code [CODE]#!/usr/bin/python from SOAPpy import WSDL print "Content-type: text/html\n" wsdlFile = 'http://www.adamplowman.com/sendservice.wsdl' server = WSDL.Proxy(wsdlFile) username = 'adamplowman' password = 'DreamOn' destination …

Member Avatar for adam291086
0
140
Member Avatar for adam291086

Hello, I am reading this turorial [url]http://diveintopython.org/soap_web_services/introspection.html[/url] and i am trying to echo out all my wsdl method. I am trying to do this on my external web hosting server. I have got the modules installed but i am getting an internal server error [url]http://adamplowman.com/cgi-bin/test_xml.py[/url] here is the code [CODE] …

0
84