python

hope for php to become as secure and fast as python and ruby in the future?

i know that php is not as good as python and ruby compared from a view of security and performance. i wonder however, is there a chance for php to reach that level in the future and no one will say..."php is a ugly and slow language"? a more professional language? ...

python win32com EXCEL data input error

Welcome, I'm exporting results of my script into Excel spreadsheet. Everything works fine, I put big sets of data into SpreadSheet, but sometimes an error occurs: File "C:\Python26\lib\site-packages\win32com\client\dynamic.py", line 550, in __setattr__ self._oleobj_.Invoke(entry.dispid, 0, invoke_type, 0, v...

Using Elixir, how can I get the table object of a self-referential relationship to perform inserts on?

I'm using Elixir with SQLite and I'd like to perform multiple inserts as per the docs: http://www.sqlalchemy.org/docs/05/sqlexpression.html#executing-multiple-statements However, my ManyToMany relationship is self-referential and I can't figure out where to get the insert() object from. Can anyone help? Thanks! ...

ruby or python more suitable for scripting in all OSes?

if i want to script a mini-application (in the Terminal) in mac and windows, which one is preferred: ruby or python? or is there no major difference just a matter of taste? cause i know python definetely is a good scripting language. thanks ...

Is there a way to use a substring function on variables in .vimrc?

I have gVim and portable python stored in a DropBox folder on several machines. The location of the DropBox folder is different on each computer. However, I'd like to be able to setup the .vimrc so that it automatically references the correct python folder no matter what computer it's on. For example, I have gVim in C:\DropBox\gVimPor...

Launching browser within CherryPy

I have a html page displayed using... cherrypy.quickstart(ShowHTML(htmlfile), config=configfile) Once the page is loaded (eg. initiated via. the command 'python mypage.py'), I would like to automatically launch the browser to display the page (eg. via. http://localhost/8000). Is there any way I can achieve this (eg. via. a hook withi...

WTFroms error:TypeError: formdata should be a multidict-type wrapper

from wtforms import Form, BooleanField, TextField, validators,PasswordField class LoginForm(Form): username = TextField('Username', [validators.Length(min=4, max=25)]) password = PasswordField('Password') when i use LoginForm on webapp(gae) like this : def post(self): form=LoginForm(self.request) but it show error : ...

why doesnt netbeans support python and django?

i wonder why sun doesnt support python and django in netbeans? cause i am choosing between learning ruby/rails or python/django. does this mean that i should use ruby/rails cause then support comes out of the box? seems that other applications favor support for ruby over python. ...

Map vs list comprehension in Python

Possible Duplicate: Python List Comprehension Vs. Map When should you use map/filter instead of a list comprehension or generator expression? ...

DatabaseError: current transaction is aborted, commands ignored until end of transaction block

I got a lot of "DatabaseError: current transaction is aborted, commands ignored until end of transaction block" errors after changed from python-psycopg to python-psycopg2 as Django project's database engine. The code remains the same, just dont know where those errors are from. ...

Matplotlib and pylab doesn't work in python cgi

Hi all, Matplotlib and pylab doesn't work in python cgi. but it's working properly in python shell.. Any one can help me....... Plz....... Thanks in advance...... #!C:/Python26/python import cgi import cgitb import sys import os cgitb.enable() # set HOME environment variable to a directory the httpd server can write to os.environ[ 'H...

easy way to change a dict data to url Parameter ..

(1) a={'b':'bbbb','c':'ccc',....} (2) self.redirect('/tribes/view?b=' + a['b'] + '&c=' + a['c']) so i want to get b=' + a['b'] + '&c=' + a['c'] ... from dict a hae any easy way to do this ? thanks ...

ImageChops.duplicate - python

Hi I am tring to use the function ImageChops.dulpicate from the PIL module and I get an error I don't understand: this is the code import PIL import Image import ImageChops import os PathDemo4a='C:/Documents and Settings/Ariel/My Documents/My Dropbox/lecture/demo4a' PathDemo4b='C:/Documents and Settings/Ariel/My Documents/My Dropbox...

how to make the username and email is Unique .. using WTFroms

wtforms is a forms validation and rendering library for python web development but i can't find how to handle the username and email Unique , thanks ...

Coloring close points

I have a dense set of points in the plane. I want them colored so that points that are close to each other have the same color, and a different color if they're far away. For simplicity assume that there are, say, 5 different colors to choose from. Turns out I've not the slightest idea how to do that .. I'm using Tkinter with Python, by...

Parsing a context-free grammar in Python

What tools are available in Python to assist in parsing a context-free grammar? Of course it is possible to roll my own, but I am looking for a generic tool that can generate a parser for a given CFG. ...

Time Calculation in Python

Hi everyone, I have two python cgi pages (index, display), what i need to do is calculate time frame between the execution. Work flow: Index.py (submit) After submit it redirect to display.py page display.py page has got class with execute(),display() &init_main() functions In init_main() i have created class object which access to a...

In-document schema declarations and lxml

As per the official documentation of lxml, if one wants to validate a xml document against a xml schema document, one has to construct the XMLSchema object (basically, parse the schema document) construct the XMLParser, passing the XMLSchema object as its schema argument parse the actual xml document (instance document) using the const...

how to show all method and data when the object not has "__iter__" function in python..

i find a way : (1):the dir(object) is : a="['__class__', '__contains__', '__delattr__', '__delitem__', '__dict__', '__doc__', '__getattribute__', '__getitem__', '__hash__', '__init__', '__iter__', '__metaclass__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setitem__', '__str__', '__weakref__',...

how to get all 'username' from my model 'MyUser' on google-app-engine ..

my model is : class MyUser(db.Model): username = db.StringProperty() password = db.StringProperty(default=UNUSABLE_PASSWORD) email = db.StringProperty() nickname = db.StringProperty(indexed=False) and my method which want to get all username is : s=[] a=MyUser.all() for i in a: s.append(i.username) and i wa...