Forum: Python Sep 30th, 2009 |
| Replies: 1 Views: 178 i am trying to set a cookie with TG2 like
cookie = Cookie.SimpleCookie()
cookie["ADAM-TEST"] = "random.randint(1000000000)"
cookie["ADAM-TEST"]["domain"] =... |
Forum: Python Jul 12th, 2009 |
| Replies: 2 Views: 134 |
Forum: Python Jul 12th, 2009 |
| Replies: 2 Views: 134 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... |
Forum: Python Feb 25th, 2009 |
| Replies: 1 Views: 218 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... |
Forum: Python Feb 10th, 2009 |
| Replies: 1 Views: 331 |
Forum: Python Feb 8th, 2009 |
| Replies: 1 Views: 331 Why wont my cookie set in firefox
#!/usr/bin/python
import Cookie
print "Content-type: text/html\n"
C = Cookie.SimpleCookie()
C["number"] = 7
C["string"] = "seven"
print C["number"].value... |
Forum: Python Jan 29th, 2009 |
| Replies: 3 Views: 512 ok i have re writtent the code and its now working but the code is sloppy and there must be a better way of doing this
#!/usr/bin/python
import MySQLdb
import os
import Cookie
import time ... |
Forum: Python Jan 29th, 2009 |
| Replies: 3 Views: 512 its not an infinite loop as numrows_user is part of a database search earlier on and when i print it out it = 4.
Whats supposed to happen when i run the code is the 4 ID from a data base table is... |
Forum: Python Jan 28th, 2009 |
| Replies: 3 Views: 512 I am trying to print out some database resutls as follows
cursor.execute("SELECT * FROM User")
numrows_user = int(cursor.rowcount)
i_user = int(0)
Results_user =... |
Forum: Python Jan 28th, 2009 |
| Replies: 0 Views: 269 I have a third party sending me some infomaion. They say to use php $_post to recieve the information as follows
<?php
//include the database handling class
include("mysqlclass.php");
... |
Forum: Python Jan 27th, 2009 |
| Replies: 0 Views: 462 I am trying to delete a cookie by reseting it but it wont delete. What am i doing wrong
#!/usr/bin/python
import cgi
import Cookie
import os
def cookie_expiry_date(numdays):
from... |
Forum: Python Jan 26th, 2009 |
| Replies: 1 Views: 498 solved it by just using this line
print 'Set-Cookie: lastvisit=' + str(time.time());
instead of using the cookiee module |
Forum: Python Jan 26th, 2009 |
| Replies: 1 Views: 498 I am trying to set a cookie but when i check my browser cookies nothing is set. What am doing wrong
#!/usr/bin/python
# e begoli, python connector for mysql
# import MySQL module
import... |
Forum: Python Jan 25th, 2009 |
| Replies: 0 Views: 263 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? |
Forum: Python Jan 23rd, 2009 |
| Replies: 6 Views: 314 i am struggling with this
so if the file i want to write to is located here
http://www.adamplowman.com/uni_project/log.txt
and my code to write to the file is running from here... |
Forum: Python Jan 23rd, 2009 |
| Replies: 6 Views: 314 mmm i am running this from a website and that file in question is stored within another folder will it work then? |
Forum: Python Jan 23rd, 2009 |
| Replies: 6 Views: 314 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... |
Forum: Python Jan 23rd, 2009 |
| Replies: 4 Views: 459 ok i was being really dumb. Solved it |
Forum: Python Jan 23rd, 2009 |
| Replies: 4 Views: 459 ok i have partially solved the problem and added static method bit above each function. But i am not getting the error message find_text is not defined.
How can i have class with two function in... |
Forum: Python Jan 22nd, 2009 |
| Replies: 4 Views: 459 I am trying to construct a class and call upon some functions within that class, but nothing is returned, somehting should definitely be returned
#!/usr/bin/python
import cElementTree as ET... |
Forum: Python Jan 21st, 2009 |
| Replies: 11 Views: 534 It was the hosting company change the version of element tree module so i had to change the import to import cElementTree as ET
Thanks for all the help
Adam |
Forum: Python Jan 21st, 2009 |
| Replies: 11 Views: 534 i have contacted the hosting company and they said they got the following
but i dont get that error. What is causing this problem? |
Forum: Python Jan 21st, 2009 |
| Replies: 11 Views: 534 I have done that and still the sodding same |
Forum: Python Jan 21st, 2009 |
| Replies: 11 Views: 534 even if i remover the if statment all together nothing will be printed out. anything below the line of
wont print out |
Forum: Python Jan 21st, 2009 |
| Replies: 11 Views: 534 ??? that should make a difference |
Forum: Python Jan 21st, 2009 |
| Replies: 11 Views: 534 |
Forum: Python Jan 20th, 2009 |
| Replies: 11 Views: 534 that works, thanks
just one problem it will work in my python shell but it wont work in my cgi bin on my website what have i missed
#!/usr/bin/env python
import elementtree.ElementTree as... |
Forum: Python Jan 20th, 2009 |
| Replies: 11 Views: 534 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???
#!/usr/bin/env python
from xml.etree import ElementTree... |
Forum: Python Dec 14th, 2008 |
| Replies: 4 Views: 355 i have tried a normal name as well and still nothing. I have no idea and its rather annoying |
Forum: Python Dec 14th, 2008 |
| Replies: 4 Views: 355 they are not ***** its because the function is a naught word that has been blocked out by the forum |
Forum: Python Dec 14th, 2008 |
| Replies: 4 Views: 355 Can someone please tell me why this class wont work.
#!/usr/bin/python
import MySQLdb
class test:
@staticmethod
def ******():
# connect
db =... |
Forum: Python Dec 10th, 2008 |
| Replies: 3 Views: 1,739 ok i got that working but now how do i call the class a function
here is the class file
#!/usr/bin/python
import urllib2
class sendmessage:
def send_SMS(message):
user =... |
Forum: Python Dec 10th, 2008 |
| Replies: 3 Views: 1,739 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? |
Forum: Python Dec 10th, 2008 |
| Replies: 5 Views: 914 turns out there was a space in the element.tag. Once i remove that everything works ok. |
Forum: Python Dec 10th, 2008 |
| Replies: 5 Views: 914 ok that work well, but i am tring to print out the value from the database that corresponds to the name in the XML for example
XML tag name
Free
Used
Database
({'Used': 1L,... |
Forum: Python Dec 9th, 2008 |
| Replies: 5 Views: 914 it prints
({'Used': 1L, 'BuffersPercent': 1L, 'Cached': 1L, 'App': 1L, 'Percent': 1L, 'Free': 1L, 'AppPercent': 1L, 'CachedPercent': 1L, 'Total': 1L, 'Buffers': 1L},)
you can see here
... |
Forum: Python Dec 9th, 2008 |
| Replies: 5 Views: 914 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
#!/usr/bin/python
import... |
Forum: Python Dec 7th, 2008 |
| Replies: 0 Views: 433 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... |
Forum: Python Dec 2nd, 2008 |
| Replies: 6 Views: 648 Thanks guys really helpful.
The method wont work on the following script and i get the error
#!/usr/bin/env python |
Forum: Python Dec 1st, 2008 |
| Replies: 6 Views: 648 Can you explain that to me? I want to understant it |