unsupported operand type(s) for %: 'NoneType' and 'tuple'

Victor Subervi victorsubervi at gmail.com
Mon Dec 7 12:06:20 EST 2009


On Mon, Dec 7, 2009 at 12:40 PM, Rami Chowdhury <rami.chowdhury at gmail.com>wrote:

> Coming from PHP,
>

Wash your mouth out with soap, Rami! I might not be a good programmer, but
I'm loyal to the Flying Circus. I only did one job, my first one, in PHP
before I became "enlightened" :))


> I can see why you might be confused. Python is not
> PHP -- Python has namespaces and uses them, unlike PHP which IIRC
> shoves nearly everything into the default namespace. So you need to
> start by figuring out where the 'expand' function came from -- I'm
> pretty sure it's not a builtin. Look at the import statements in the
> file to see if the function has been specifically imported from
> somewhere, or if there's a statement of the form "from [module] import
> *". You will then know the module it came from, and be able to either
> look at the code or the documentation for that module, which should
> tell you more.
>

No, it's not imported. These are the only imports:

import sys,os
sys.path.append(os.getcwd())
import MySQLdb
from login import login
import re, string

TIA,
V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20091207/a2528425/attachment-0001.html>


More information about the Python-list mailing list