Hi,
Python is 'hanging' when I try to import a c++ shared library into the windows version of python 2.5 and I have no clue why.
On Linux, everything works fine. We can compile all of our C++ code, generate swig wrapper classes. They compile and can be imported and used in either python 2.5 or 2.6. Now, we are trying to port the cod...
In my test document I have a few classes labeled "item", currently I'm using the following to parse everything in the html file with this class with
Selection = html.cssselect(".item")
I'd like it to select all the odd items, like this in javascript using JQuery
Selection = $(".item:odd");
Trying that verbatim I get the following e...
Earlier today I needed to iterate over a string 2 characters at a time for parsing a string formatted like "+c-R+D-E" (there are a few extra letters).
I ended up with this, which works, but it looks ugly. I ended up commenting what it was doing because it felt non-obvious. It almost seems pythonic, but not quite.
# Might not be exact...
Ok, you guys were quick and helpful last time so I'm going back to the well ;)
Disclaimer: I'm new to python and very new to App Engine. What I'm trying to do is a simple modification of the example from the AppEngine tutorial.
I've got my date value being stored in my Memory class:
class Memory(db.Model):
author = db.UserProperty...
I'm modeling a database relationship in django, and I'd like to have other opinions. The relationship is kind of a two-to-many relationship. For example, a patient can have two physicians: an attending and a primary. A physician obviously has many patients.
The application does need to know which one is which; further, there are cases w...
I guess this question has been asked a lot around. I know Rails can scale because I have worked on it and it's awesome. And there is not much doubt about that as far as PHP frameworks are concerned.
I don't want to know which frameworks are better.
How much is difference in cost of scaling Rails vs other frameworks (PHP, Python) assum...
(Now that Django 1.1 is in release candidate status, it could be a good time to ask this.)
I've been searing everywhere for ways to extend Django's comments app to support authenticated comments. After reading through the comments model a few times, I found that a ForeignKey to User already exists.
From django.contrib.comments.models:
...
How can you detect the country of origin of the users accessing your site?
I'm using Google Analytics on my site and can see that I have users coming from different regions of the world.
But within my application I would like to provide some additional customization based on the country and perhaps the city.
Is it possible to detect ...
Is there a way to perform the following in a non-recursive fashion:
my_list = [
"level 1-1",
"level 1-2",
"level 1-3",
[
"level 2-1",
"level 2-2",
"level 2-3",
[
"level 3-1",
"level 3-2"
]
],
"level 1-4",
"leve...
Hi there... I don't know if the question title is correctly set.
I'm trying to read a BMP file in python. I know the first two bytes
indicate the bmp firm. Next 4 bytes are the file size. When I excecute:
fin = open("hi.bmp", "rb")
firm = fin.read(2)
file_size = int(fin.read(4))
I get
ValueError: invalid literal for int() wit...
Can install python plugin in netbeans 6.7 manually (without Tools/Plugin) ?
if yes (with .nbi package ) which url can use ?
...
All I want to do is make some RPC calls over sockets. I have a server that does backendish stuff running jython 2.5. I need to make some calls from a frontend server running Django on CPython. I've been beating my head against a wall getting any form of IPC going.
The list of things I've tried:
Apache Thrift doesn't have any actual re...
This code works fine:
import MySQLdb
db = MySQLdb.connect("localhost", "root", "","bullsorbit")
cursor = db.cursor()
cursor.execute("Select * from table where conditions'")
numrows = int(cursor.rowcount)
print 'Total number of Pages : %d ' % numrows
but if I give my IP address
db = MySQLdb.connect("192.168.*.*", "root", "","...
Hello,
I am pretty new to Python world and trying to learn it.
This is what I am trying to achieve: I want to create a Car class, its constructor checks for the input to set the object carName as the input. I try to do this by using the java logic but I seem to fail :)
class Car():
carName = "" #how can I define a non assigned vari...
After I've added my own code to models.py, views.py and other files generated by django, can I protect them using the GPL? Or is there a clash given there is code in there that has been auto generated by django which is not licensed under GPL?
...
Possible Duplicate:
Java Python Integration
I have a large existing codebase written in 100% Java, but I would like to use Python for some new sections of it. I need to do some text and language processing, and I'd much rather use Python and a library like NLTK to do this.
I'm aware of the Jython project, but it looks like thi...
I'm new to Django (and Python) and I have been trying to work out a few things myself, before jumping into using other people's apps. I'm having trouble understanding where things 'fit' in the Django (or Python's) way of doing things. What I'm trying to work out is how to resize an image, once it's been uploaded. I have my model setup ni...
How close can I get to defining a model in SQLAlchemy like:
class Person(Base):
pass
And just have it dynamically pick up the field names? anyway to get naming conventions to control the relationships between tables? I guess I'm looking for something similar to RoR's ActiveRecord but in Python.
Not sure if this matters but I'll...
I am using Python 3.0 in Windows and trying to automate the testing of a commandline application. The user can type commands in Application Under Test and it returns the output as 2 XML packets. One is a packet and the other one is an packet. By analyzing these packets I can verifyt he result. I ahev the code as below
p = subprocess.P...
Hello Folks,
Say i have two Python dictionaries - dictA and dictB. I need to find out if there are any keys which are present in dictB but not in dictA. Which is the fastest way to go about it.
Should i convert the dictionary keys into a set and then go about..
Interested in knowing your thoughts...
Thanks!
...