Hi,
I am trying to get raw data sent as post to Google App engine, using self.request.get('content'), but in vain. It returns empty. I am sure the data is being sent from the client, coz I checked with another simple server code.
Any idea what I am doing wrong? I am using the following code on the client side generating the POST call (...
Greetings,
I am currently working on a long term project that uses Django 1.1.1, and we are planning to release it around march of 2010.
Now while surfing I came upon to this article which says the planned release date of Django 1.2.0 is March 9, 2010.
Now I am a bit confused. If I should continue developing under 1.1.1 or start develo...
Hello
How would you go about testing to see if 2 folders contain the same files, and then to be able to manipulate ONLY the file which is new.
A = listdir('C:/')
B = listdir('D:/')
If A==B
...
I know this could be used to test if directories are different but is there a better way?
And if A and B are the same, except B has one more ...
I hava a GSM modem that disconnect after a while, maybe because of low signal. Am just wondering is there an AT command that can detect the disconnection and re-establish a reconnection.
Is there a way in code (preferably python) i can detect the disconnection and re-establish a reconnection?
Gath
...
I have a python script that has to fetch unseen messages, process it, and mark as seen (or read)
I do this after login in:
typ, data = self.server.imap_server.search(None, '(UNSEEN)')
for num in data[0].split():
print "Mensage " + str(num) + " mark"
self.server.imap_server.store(num, '+FLAGS', '(SEEN)')
The f...
I'm embedding Python into an application. MyClass.name is a property of str type:
>>> foo = MyClass()
>>> foo.name
'Default Name'
Should I allow users to do this:
>>> foo.name = 123
>>> foo.name
'123'
or not?
>>> foo.name = 123
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: name must be a strin...
Hay, i have a model which saves 2 images
class Picture(models.Model):
picture = models.ImageField(upload_to=make_filename)
thumbnail = models.ImageField(upload_to=make_thumb_filename)
car = models.ForeignKey('Car')
created_on = models.DateField(auto_now_add=True)
updated_on = models.DateField(auto_now=True)
def ...
Is there a more efficent way for doing this?
for item in item_list:
e, new = Entry.objects.get_or_create(
field1 = item.field1,
field2 = item.field2,
)
...
I'm having an issue where a call to the url template tag in Django is appending the site name (I don't want it in there.)
Let's say that the site name is 'mysite'.
So for example:
<a href="{% url myapp.views.myview "myparam" %}">Link text</a>
is producing:
<a href="/mysite/foo/bar">Link text</a>
when I want it to produce:
<a hre...
Hello,
I am trying to get completely to grips with class inheritence in Python. I have created program's with classes but they are all in one file. I have also created scripts with multiple files containing just functions. I have started using class inheritence in scripts with multiple files and I am hitting problems. I have 2 basic sc...
Hi all,
I've developed an application for Windows that use wxPython and twisted.
The issue is that if I run the app using the Python interpreter everything is OK (I could receive and transmit UDP packets).
If I build a py2exe app I can only receive UDP packets. I have no error, the app is responsive but tx packets are not transmitted ...
Hi,
I'm working on a project which takes some images from user and then creates a PDF file which contains all of these images.
Is there any way or any tool to do this in Python? E.g. to create a PDF file (or eps, ps) from image1 + image 2 + image 3 -> PDF file?
...
I have a .py file that a php file runs like this:
$link = exec(dirname(__FILE__) . /xxx.py ' .excapeshellarg($url) . '2>&1', $output, $exit_code);
I want to run the xxx.py in my django view and asign the output to a variable. The xxx.py file has a def main(url) function and if __name__ == '__main__': at the bottom. Is there a way I c...
I need to create graphs on the fly about specific process, with some informative texts and colors.
In the Unix world there's Graphviz including 'dot' for layout generation, is there something similar which could be used with Delphi?
I'm using Delphi 2007.
Also Python alternative could be considered, but I'd prefer pure Delphi in this ...
Regardless of ease of use, which is more computationally efficient? Constantly slicing lists and appending to them? Or taking substrings and doing the same?
As an example, let's say I have two binary strings "11011" and "01001". If I represent these as lists, I'll be choosing a random "slice" point. Let's say I get 3. I'll Take the...
With Python's DB API spec you can pass an argument of parameters to the execute() method. Part of my statement is a WHERE IN clause and I've been using a tuple to populate the IN. For example:
params = ((3, 2, 1), )
stmt = "SELECT * FROM table WHERE id IN %s"
db.execute(stmt, params)
But when I run into a situation where the parameter...
I have virtualenv and virtualenvwrapper installed on a shared Linux server with default settings (virtualenvs are in ~/.virtualenvs). I have several Python scripts that can only be run when the correct virtualenv is activated.
Now I want to share those scripts with other users on the server, but without requiring them to know anything ...
Via django iam launching a thread (via middle ware the moment the first request comes) which continously fetches the twitter public steam and puts it down into the database.Assume the thread name is twitterthread.
I also have have several cron jobs which periodically interacts with other third party api services.
Observed the following...
Let me start by saying, I also get the same error whey defining __init__ and running super()'s __init__. I only simplified it down to this custom method to see if the error still happened.
import HTMLParser
class Spider(HTMLParser):
def spamfoo(self):
print('some random non-overriding method')
This alone in a module rais...
I get this error:
Traceback (most recent call last):
File "D:/Python26/PYTHON-PROGRAMME/049 bam", line 9, in <module>
ball[i][j]=sphere()
NameError: name 'ball' is not defined
when I run this code. But the ball is defined ( ball[i][j]=sphere() ). Isn`t it?
#2D-wave
#VPython
from visual import *
#ball array #ready
for i in ran...