Hi :) ,
I use Djnago a few weeks ago
I started a django app and wrote these lines in model.py
from django.db import models
class Publisher(models.Model):
name = models.CharField(max_length=30)
address = models.CharField(max_lenght=50)
city = models.CharField(max_length=60)
state_province = models.CharField(max_lengt...
Hi,
I'm working on an application that lets users interact with their account by sending emails to a specific address. The app is on GAE and I'm writing it in python. Here's my question:
When I receive an email from a user the sender field is text. I want to run a datastore query and match the userID to the sender's email address, b...
I have never handled reverse operators before, so please no flaming! Just finished learning about them so wanted to try them out. But for some reason, it is not working. Here is the code:
>>> class Subtract(object):
def __init__(self, number):
self.number = number
def __rsub__(self, other):
return self.number - ...
Hi,
I am interested in programming for Mobile Devices.
Now I have a phone which runs Symbian S60 3rd, which is one of my motivations for programming for mobile devices.
Now, my question is, which one is better to go for?
Python or C++?
I have a good background in C++ (ANSI), Java and C#.
Thanks.
...
hi friends,
i have desktop interface in python which uses drag and drop and where users can login. right now if i drop a file it will be stored in local directory. now what i want is, i want to upload user dropeed file to remote web server. can anybody help me in direction ? i have been exploring python's ftp library's and everything i ...
Following up on,
http://stackoverflow.com/questions/3553340/with-python-intervals-at-x00-repeat
Using threading, How can I get a script to run starting at 8:00 am stop running at 5:00 pm
The solution should be coded within python, and be portable
tiA
...
I'm working with a sqlite database, using python/django. I would need to have my results, which contain german umlauts (ä,ö,ü) to be correctly sorted (not with the umlauts at the end). Reading different articles on the web I'm not even sure if it is possible or not.
So any advise/instructions on that are appreciated. I already studied th...
Hi
Is it possible to call Tcl procedures that have function pointers (or callback functions) from Python?
I am using Tkinter to call Tcl procedures from Python.
Python Snippet :
proc callbackFunc():
print "I am in callbackFunc"
cb = callbackFunc
Tkinter.Tk.call('tclproc::RetrieveInfo', cb)
Tcl Snippet :
proc tclproc::RetrieveI...
I want to see if I can access an online API, but for that I need to have Internet access.
How can I see if there's a connection available and active using Python?
...
My problem is that I want to retrieve both a list of measurements along with a moving average of those measurements. I can do that with this SQL statement (postgresql interval syntax):
SELECT time, value,
(
SELECT AVG(t2.value)
FROM measurements t2
WHERE t2.time BETWEEN t1.time - interval '5 days...
print OBJECT calls OBJECT.__str__(), then when OBJECT.__repr__() is called? I see that print OBJECT calls OBJECT.__repr__() when OBJECT.__str__() doesn't exist, but I expect that's not the only way to call __repr__().
...
Hello,
I have a Python application and I decided to do a .exe to execute it.
This is the code that I use to do the .exe:
# -*- coding: cp1252 -*-
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'bundle_files': 1}},
windows = [{'script': "SoundLog.py"}],
zipf...
Hello,
I'm trying to use python to launch a command in multiple seperate instances of terminal simultaneously. What is the best way to do this? Right now I am trying to use the subprocess module with popen which works for one command but not multiple.
Thanks in advanced.
Edit:
Here is what I am doing:
from subprocess import*
Popen(...
Has anyone used Pydbgr with Emacs and if so would they mind sharing their .emacs configuration plus any associated elisp sources required.
The installation instructions can be found at:
http://code.google.com/p/pydbgr/wiki/Tutorial#Installation
Pydbgr looks like a really useful extension to the capabilities of pdb, especially its su...
I recently upgraded to Ubuntu 10.04 LTS and refreshed my Python environment. I installed Python 2.7 from source. Unfortunately, I didn't notice that Setup.dist has the readline line commented out by default - by default, there is no readline support installed. I'm now using the Python interpreter as a REPL enough that the constant ^[[...
Hi all,
I'm working on a poker analysis tool with the following use case:
User create Strategy class with one method: input GameState, output PokerAction
User runs Analysis script, which launches a PokerGame between various Strategy subclasses (i.e. various strategies)
PokerGame generates random deck
PokerGame sends GameState to Strat...
What is the difference in these two statements in python?
var = foo.bar
and
var = [foo.bar]
I think it is making var into a list containing foo.bar but I am unsure. Also if this is the behavior and foo.bar is already a list what do you get in each case?
For example: if foo.bar = [1, 2] would I get this?
var = foo.bar #[1, 2]
a...
I'm writing a function to traverse the user's file system and create a tree representing that directory (the tree is really a TreeView widget in Tkinter, but that's functionally a tree).
The best way I can think of doing this is recursion. However, one of my cases in the function requires me to know if it is the "original" function call...
Hello,
I am using the following code:
CARRIS_REGEX=r'<th>(\d+)</th><th>([\s\w\.\-]+)</th><th>(\d+:\d+)</th><th>(\d+m)</th>'
pattern = re.compile(CARRIS_REGEX, re.UNICODE)
matches = pattern.finditer(mailbody)
findall = pattern.findall(mailbody)
But finditer and findall are finding different things. Findall indeed finds all the matches...
Hi: I have a plot which has timestamps on the x-axis and some signal data on the y-axis. As a documentation I want to put timestamped pictures in relation to specific points in the plot. Is it possible to draw a line in a plot to a picture in a sequence of pictures below the plot?
...