Well, i've walking around this for a couples of days now... I think is time to ask for some help, i think my installation is ok...
Server OS: Centos 5
Python -v 2.6.5
Django -v (1, 1, 1, 'final', 0)
my apache conf:
<VirtualHost *:80>
DocumentRoot /opt/workshop
ServerName taller.antell.com.py
WSGIScriptAlias / /opt/workshop/...
Hey,
Im wondering, how can i get a SUM of a rating entity i get from the datastore (python)?
should i:
ratingsum = 0
for rating in ratings:
ratingsum + rating
print ratingsum
?
...
I'm working on a an PythonCE application, using the PocketPyGUI toolkit.
I'm using the gui.Table control to display a large list of choices
(addresses, codes and data associated), and I want to assign
a different color to the rows that have been completed.
Is there any way to colorize the rows given certain conditions?
TIA,
Pablo
...
Hi,
I need to download and parse webpage with lxml and build UTF-8 xml output. I thing schema in pseudocode is more illustrative:
from lxml import etree
webfile = urllib2.urlopen(url)
root = etree.parse(webfile.read(), parser=etree.HTMLParser(recover=True))
txt = my_process_text(etree.tostring(root.xpath('/html/body'), encoding=utf8)...
Google App Engine says "Must authenticate first." while trying to deploy any app:
me@myhost /opt/google_appengine $ python appcfg.py update ~/sda2/workspace/lyapapam/
Application: lyapapam; version: 1.
Server: appengine.google.com.
Scanning files on local disk.
Scanned 500 files.
Scanned 1000 files.
Initiating update.
Email: <email_her...
I wish to get a list of connections to a manager. I can get last_accepted from the servers' listener, but I want all connections. There HAS to be a method I am missing somewhere to return all connections to a server or manager
Please help!!
...
whats a clean way to use different templates depending on an object class? other than buncha if statements
...
Suppose my template has in it something like {% block subject %}my subject{% endblock %} and I load this template with tmpl = loader.get_template('mytemplate.html'), how can I extract "my subject"?
...
my apologies in advance for a python and json nubie question. json seems to be hiccuping on the following statements:
{"delete":{"status":{"id":12600579001,"user_id":55389449}}}
code snippet:
temp = json.loads(line)
text = temp['text']
I get the following error output when the above code snippet encounters lines similar to the abov...
I have a python code something like this
file_out.write(str(i).strip()+"\t"+str(dict1[i]).strip()+"\n")
But when i try to recognize this with vim by saying on the file that was written.
:%s/\t/|/g
But it does not recognize the \t
...
I'm trying to write a dead-simple interface for an IRC library, like so:
import simpleirc
connection = simpleirc.Connect('irc.freenode.net', 6667)
channel = connection.join('foo')
find_command = re.compile(r'google ([a-z]+)').findall
for msg in channel:
for t in find_command(msg):
channel.say("http://google.com/search?q=%s...
I'm having trouble getting django-admin.py to work... it's in this first location:
/Users/mycomp/bin/ but I think I need it in another location for the terminal to recognize it, no?
Noob, Please help. Thanks!!
my-computer:~/Django-1.1.1 mycomp$ sudo ln -s /Users/mycomp/bin/django-admin.py /Users/mycomp/django-1.1.1/django-admin.py
Pas...
In a Python Google App Engine app I'm writing, I have an entity stored in the datastore that I need to retrieve, make an exact copy of it (with the exception of the key), and then put this entity back in.
How should I do this? In particular, are there any caveats or tricks I need to be aware of when doing this so that I get a copy of t...
I defined a class:
class A:
''' hash test class
>>> a = A(9, 1196833379, 1, 1773396906)
>>> hash(a)
-340004569
This is weird, 12544897317L expected.
'''
def __init__(self, a, b, c, d):
self.a = a
self.b = b
self.c = c
self.d = d
def __hash__(self):
return self.a ...
I just created my first django app, initialized variables DATABASE_ENGINE and DATABASE_NAME in settings.py, but now when I run python manage.py syncdb, I get the following error Can somebody help? Does this have to do with having two python versions installed?
I'm a django/python noob, please help. thanks!!
my-computer:~/Django-1.1.1 m...
So I of course know that serving static files through Django will send you straight to hell but I am confused on how to use a custom url to mask the true location of the file using Django. http://stackoverflow.com/questions/2681338/django-serving-a-download-in-a-generic-view but the answer I accepted seems to be the "wrong" way of doing...
this is my code:
print '哈哈'.decode('gb2312').encode('utf-8')
and it print :
SyntaxError: Non-ASCII character '\xe5' in file D:\zjm_code\a.py on line 2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details
how to print '哈哈'
thanks
updated
when i use this:
#!/usr/bin/python
# -*- coding: utf-8 -*-
...
Hello I'm stuck at this: How to implement a multi-colored textbox without using a WebView Obj? I want the textcolor updated in each key event and if I use a WebView The app will surely lag a little(touch 1g).
I'm finishing up a app that teaches basic english, everything is up and running perfectly, but then I realized that a multi-color...
Say I want I've got a list and I want to iterate over the first n of them. What's the most concise way to write this in Python?
...
Hello, I wanted to know if python had any service like Java's JNDI.
More specifically, I want a service where providers can register themselves and then consumers can ask fro where certain provider end-points are.
For example, assume that I want to implement a mailbox for all my friends. Each of them have their own end-point, so friend...