When trying to use libxml2 as myself I get an error saying the package cannot be found. If I run as as super user I am able to import fine.
I have installed python25 and all libxml2 and libxml2-py25 related libraries via fink and own the entire path including the library. Any ideas why I'd still need to sudo?
...
Is there any performance difference between tuples and lists when it comes to instantiation and retrieval of elements?
...
Is it possible to have static class variables or methods in python? What syntax is required to do this?
...
I want to open a TCP client socket in Python. Do I have to go through all the low-level BSD create-socket-handle / connect-socket stuff or is there a simpler one-line way ?
What I'm looking for is something similar to fsockopen in PHP.
...
I know there are a ton of Python frameworks out there. Can you guys point me in the right direction? My primary concern is simplicity, I don't need a lot of extraneous features.
Here are a couple of other things that I'd want (or don't want):
don't care for ORM, just want it to work with MySQL
has configurable routes
has support for la...
I want to take a screenshot via a python script and unobtrusively save it.
I'm only interested in the Linux solution, and should support any X based environment.
...
The question pertains to starting new projects using Python. Furthermore, I am referring to developing for the final releases of Python 2.6 and 3.0 (as oppose to Betas and RCs) which I imagine will be out in a few months.
...
My university doesn't support the POST cgi method (I know, it's crazy), and I was hoping to be able to have a system where a user can have a username and password and log in securely. Is this even possible?
If it's not, how would you do it with POST? Just out of curiosity.
Cheers!
...
Python gives us the ability to create 'private' methods and variables within a class by prepending double underscores to the name, like so: *__myPrivateMethod()*. How, then, can one explain this
>>> class MyClass:
... def myPublicMethod(self):
... print 'public method'
... def __myPrivateMethod(self):
... ...
I am new to any scripting language. But, Still I worked on scripting a bit like tailoring other scripts to work for my purpose. For me, What is the best online resource to learn Python?
Some Online Resources:
http://docs.python.org/tut/tut.html - Beginners
http://diveintopython.org/ - Intermediate
http://www.pythonchallenge....
I'm looking for a python library that will help me to create an authentication method for a desktop app I'm writing.
I have found several method in web framework such as django or turbogears.
I just want a kind of username-password association stored into a local file.
I can write it by myself, but I'm really it already exists and will ...
Another crack at this: I have a frequent problem with python's psycopg2, perhaps in 2 parts. First, I consistently screw up string assignment, if anyone can lobotomize line 5 below for me, much appreciated (The first answer does work with 1 value.) Second, when I try to add a long sequence to a table, something like string-number pair i...
How do I have a Python script that can accept user input (assuming this is possible) and how do I make it read in arguments if run from the command line?
...
Which python framework is best for web development in google app engine?
...
Using the Python Documentation I found the HTML parser but I have no idea which library to import to use it, how do I find this out (bearing in mind it doesn't say on the page).
...
Hi!
Does anybody know of a tool to test OCSP responses? Preferably, something that can be used from a Windows Command-line and/or can be included (easily) in a Java/python program
...
The problem: I have a class which contains a template method "execute" which calls another method "_execute". Subclasses are supposed to overwrite "_execute" to implement some specific functionality. This functionality should naturally be documented in the docstring of "_execute".
I also expect users to create their own subclasses to ex...
A tutorial I have on Regex in python explains how to use the re module in python, I wanted to grab the URL out of an A tag so knowing Regex I wrote the correct expression and tested it in my regex testing app of choice and ensured it worked. When placed into python it failed.
After much head scratching I found out the issue, it automati...
Can someone explain this result to me. The first test succeeds but the second fails, although the variable tested is changed in the first test.
>>> class MyTest(unittest.TestCase):
def setUp(self):
self.i = 1
def testA(self):
self.i = 3
self.assertEqual(self.i, 3)
def testB(self):
self.assertEqual(self.i,...
Imagine this directory structure:
app/
__init__.py
sub1/
__init__.py
mod1.py
sub2/
__init__.py
mod2.py
I'm coding mod1, and I need to import something from mod2. How should I do it?
I tried from ..sub2 import mod2 but I'm getting an "Attempted relative import in non-package".
I googled around but f...