How can I use geodjango to search by city and state or zip code in my django application? I am very new to geodjango and just trying to wrap my head around what would be involved in this.
Also, does anyone know of an app that already implements this functionality?
...
Hi,
I am seeing some weird behavior while parsing shared paths (shared paths on server, e.g. \storage\Builds)
I am reading text file which contains directory paths which I want to process further. In order to do so I do as below:
def toWin(path):
return path.replace("\\", "\\\\")
for line in open(fileName):
l = toWin(line).st...
I am willing to devlop a anonymus chat website.The website pairs 2 random people who are logged into the website and then allows them to chat to each other.Now if any one of them gets disconnected then the other will get connected to any other person who is single.
Now i have some doubts regarding archicture.
Each time there is a messa...
I am trying to write a program that monitors an IMAP mailbox and automatically copies every new incoming message into an "Archive" folder. I'm using imaplib2 which implements the IDLE command. Here's my basic program:
M = imaplib2.IMAP4("mail.me.com")
M.login(username,password)
lst = M.list()
assert lst[0]=='OK'
for mbx in lst[1]:
p...
Background
I'm trying to learn to program a little & python seems like a good choice for my purpose. I have no ambition of ever being a serious programmer.I already know bits and pieces of html, css, javascript (mostly how to cut & paste without understanding what I'm doing). The last time I actually "learned programming" was about ten y...
The Java Collections Framework is like the C++ Standard Template Library: "a unified architecture for representing and manipulating collections (objects that group multiple elements into a single unit)."
http://java.sun.com/docs/books/tutorial/collections/intro/index.html
...
Hi,
I need to get a list of all people in the company who have local admin rights on their computers. We have a group on each machine called "Administrators." I can get a list of all computers from active directory with:
import active_directory
for computer in active_directory.search ("objectCategory='Computer'"):
print computer.dis...
I am writing a wrapper for the ConfigParser in Python to provide an easy interface for storing and retrieving application settings.
The wrapper has two methods, read and write, and a set of properties for the different application settings.
The write method is just a wrapper for the ConfigParser's write method with the addition of also...
Consider the following code:
from PIL import Image, ImageDraw, ImageFont
def addText(img, lTxt):
FONT_SIZE = 10
INTERLINE_DISTANCE = FONT_SIZE + 1
font = ImageFont.truetype('arial.ttf', FONT_SIZE)
lTxtImageHeight = INTERLINE_DISTANCE * len(lTxt)
# create text image
lTxtImg = Image.new('RGBA', (img.size[1], l...
I would like to store Python objects into a SQLite database. Is that possible?
If so what would be some links / examples for it?
...
I am new to python. I have installed Matplotlib. I have created 2 lists x and y.
I want X axis to have values from 0 to 100 in steps of 10 and Y axis to have values from 0 to 1 in steps of 0.1. How do I plot this graph?
...
I got the tutorial
http://www.rmunn.com/sqlalchemy-tutorial/tutorial.html
When I compile got the error message
The debugged program raised the exception unhandled NameError
"name 'BoundMetaData' is not defined"
I am use the latest sqlAlchemy .
How Could I fixed this?
After read this I modified to my own for latest version sqlA...
Hello,
I am writing my first Python app with PyQt4. I have a MainWindow and a Dialog class, which is a part of MainWindow class:
self.loginDialog = LoginDialog();
I use slots and signals. Here's a connection made in MainWindow:
QtCore.QObject.connect(self.loginDialog, QtCore.SIGNAL("aa(str)"), self.login)
And I try to emit signal ...
in python ,if
a.py
from b import bb
bb()
b.py
from c import cc
def bb():
do someting else
cc()
c.py
from d import dd
def cc():
do someting else
dd()
d.py
from e import ee
def dd():
do someting else
ee()
e.py
from f import ff
def ee():
do someting else
ff()
to Understood bb function,i must open 5 file,i was very f...
I'm running python2.5 and trying to use the astLib library to analyse WCS information in astronomical images. I try and get the object instanciated with the following skeleton code:
from astLib import astWCS
w = astWCS.WCS('file.fits') # error here
where file.fits is a string pointing to a valid fits file.
I have tried using the al...
How to setup a Linux/Unix machine for python development? Which Linux/Unix version should I use? What IDE should be used? What development plugins should I have? What code style should would be THE BEST? All above, a great development machine for open source (python developers) development?
Can i ask for screenshot of some great persona...
class a(str):
def b(self,*x,**y):
print str.decode(self,*x,**y)
b=a()
b.b('utf-8','aaa') # This prints nothing, why?
...
Hi,
I'm new to OpenCV, and I would like to compare the results of a python program with my calculations in OpenCV. My matrix contains complex numbers since its the result of a cvDFT. Python handles complex numbers well and displays it with scientific notation. My C++ program is not effective when trying to use std::cout.
I tried to sto...
Hi,
I have a set of 1000 text files with names in_s1.txt, in_s2.txt and so. Each file contains millions of rows and each row has 7 columns like:
ccc245 1 4 5 5 3 -12.3
For me the most important is the values from the first and seventh columns; the pairs ccc245 , -12.3
What I need to do is to find between all the in_sXXXX.txt files, ...
What is the standard way of writing "copyright information" in python code? Should it be inside docstring or in block comments? Sorry to bother if it is trivial, as I could not find it in PEPs.
...