import _mysql as mysql
db=mysql.connect('localhost','username','password','database')
db.query("""select * from news""")
result = db.store_result()
print result.num_rows()#two records
#how to loop? without cursor
print result.fetch_row()
...
Hi,
I am trying to launch a python script with the NativeProcess API from Javascript.
On the Adobe AIR API Reference for HTML Developers I found a good example for that task, but it does not work. I looked up tons of other examples but still can not find the answer.
Here is the example code for the html file:
<html>
<head>
<title...
For a project i need a python webserver (can use C modules if necessary).
The basic http server from the runtime is way to simple - at least i need FCGI compatibility for some legacy modules.
Is there any other standalone server which is not totally connected to a certain framework like the Zope Webserver?
Performance is not really im...
Is it possible to do something like using the trac module in Python in order to get a listing of all of the projects in a given directory? If possible it would be nice to get things like the description, too. I can't seem to figure out how to do it.
Thanks for any help you can provide.
...
hi i have xml file whitch i want to parse, it looks something like this
<?xml version="1.0" encoding="utf-8"?>
<SHOP xmlns="http://www.w3.org/1999/xhtml" xmlns:php="http://php.net/xsl">
<SHOPITEM>
<ID>2332</ID>
...
</SHOPITEM>
<SHOPITEM>
<ID>4433</ID>
...
</SHOPITEM>
</SHOP>
my parsin...
Hi all,
I have to integrate paypal with my application which is built on app engine patch with python.
I searched over the web and found some issues reported in paypal integration with google application engine like here:
http://groups.google.com/group/google-appengine/browse_thread/thread/9059b0750c45703b/b1d0611dd4b04273
There is ...
Hey SO'ers,
My app connects to multiple databases using a technique similar to this. It works so long as I don't try to access different databases in the same request. Having looked back to the above script I see they have written a comment to this end:
SQLAlchemy integration for CherryPy,
such that you can access multiple databases,
b...
I am sending list to a template using render_to_response. I am using django shortcuts. Hoe to do that? How to set context instance with a variable?
...
How i can make sftp transport throught SSHClient on the remote server? I have local host and two remote. Remotes hosts are backup server and web server. I need find on backup server necessary backup file and put it on web server over sftp. Plz help me, i dont understand how i can make paramiko's sftp transport throught paramiko's SSHCli...
I am trying to fill a treeview with data and checkbuttons. When the treeview is displayed, checkbuttons appear but the text doesn't.
I get the following error:
/home/astrob/programação/pyparty/groups.py:81: GtkWarning: gtk_tree_view_column_cell_layout_add_attribute: assertion `info != NULL' failed
username_treeviewcolumn.add_attribu...
Hi folks,
I have a model such as the following:
class Item(models.Model):
name = models.CharField(max_length=150)
created = models.DateTimeField(auto_now_add=True)
the admin class is the following:
class ItemAdmin(admin.ModelAdmin):
list_display = ('name', 'created')
the created field does not seem to exist
Is there...
poem = '''\
me:hello dear
me:hyyy
asha:edaaaa
'''
f=open('poem.txt','r')
arr=[]
arr1=[]
varr=[]
darr=[]
i=0
j=1
for line in f.read().split('\n'):
arr.append(line)
i+=1
f.close()
#print arr[0]
#print arr[1]
#print arr[2]
text=arr[0].split(':')
#print text
line=text[0]
#print line
arr1.append(text[1])
for i in range(1,len(arr)):...
Could you all please suggest me a good books\tutorial on XML-based APIs, REST, SOAP with using Python
Thanks in advance
...
It is my understanding that a module docstring should just provide a general description of what a module does and details such as author and version should only be contained in the module's comments.
However, I have seen the following in comments and docstrings:
__author__ = "..."
__version__ = "..."
__date__ = "..."
Where is the co...
Hi ,
Is there any way that I can find out using webbrowser or anyother package in Python if a browser window that I've opened has loaded completely or not? Once it's loaded completely I want to take a screenshot of it and save it.
...
Hi there I have downloaded the mac installer here, http://www.python.org/download/releases/3.1.2/ , & installed it. But when I run terminal & type python it says:
Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29)
[GCC 4.2.1 (Apple Inc. build 5646)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
...
Hi
i need to create multiple TCP connections simultaneously to some custom TCP-server application for its performance testing. I know a lot of such for Web (i.e. curl-loader based on libcurl), but I didn't found some general one.
Scenario for client is the simplest: create connection, send special data, read the answer and close connecti...
I'm using Ubuntu 10, python 2.6.5
I'm following this tutorial: http://www.djangobook.com/en/2.0/chapter02
I followed all of the steps using cut-and-paste.
The following directory structure was automatically created:
bill@ed-desktop:~/projects$ ls -l mysite
total 36
-rw-r--r-- 1 bill bill 0 2010-09-01 08:18 __init__.py
-rw-r--...
I'm going to be storing a few sensitive pieces of information (SSN, Bank Accounts, etc) so they'll obviously need to be encrypted. What strategies do you recommend?
Should I do all the encryption/decryption in the web app itself? Should I use something like pgcrypto and have the conversions done on the DB side? Something else entirel...
I have a list of numbers that represent the flattened output of a matrix or array produced by another program, I know the dimensions of the original array and want to read the numbers back into either a list of lists or a NumPy matrix. There could be more than 2 dimensions in the original array.
e.g.
data = [0, 2, 7, 6, 3, 1, 4, 5]
sha...