attribute error
Steven D'Aprano
steve at REMOVETHIScyber.com.au
Mon Sep 26 19:14:51 EDT 2005
On Mon, 26 Sep 2005 18:28:56 -0400, M.N.A.Smadi wrote:
> HI;
>
> I am having the following error. I am using someone else's code and
> all they are doing is pass an argv to a function then
>
> def execute_action(manager, argv):
> method_name = argv.pop(0).lower()
>
>
> and am getting this strange error.
> AttributeError: 'str' object has no attribute 'pop'
Since you haven't told us what you have passed as argv, I will look into
my crystal ball and use my psychic powers...
Things are unclear... no, wait, I see a glimmer of light... are you using
a single string, something like "this is a list of arguments"? The
function is expecting a list of strings ["this", "is", "a", "list", "of",
"arguments"].
You may find the split() method useful for breaking up a single string
into a list of strings.
--
Steven.
More information about the Python-list
mailing list