wilsonmo...@gmail.com writes:
> Peter Otten wrote:
> > wilsonmo...@gmail.com wrote:
> >
> > > TypeError: 'list' object is not callable
> >
> > Hint:
> >
> > > open = []
> >
> > [...]
>
> > > with open(..., &
On Thursday, February 6, 2014 11:11:13 AM UTC+2, wilso...@gmail.com wrote:
> i follow in
> http://www.dyinglovegrape.com/data_analysis/part1/1da3.php
> still have error
> what is the correct writing?
give another name to list 'open' at line 'open= []'
change it to dopen or whatever. you make name
Peter Otten於 2014年2月6日星期四UTC+8下午4時22分45秒寫道:
> wilsonmo...@gmail.com wrote:
>
>
>
> > TypeError: 'list' object is not callable
>
>
>
> Hint:
>
>
>
> > open = []
>
>
>
> [...]
>
>
>
> > with open(...,
r(csvfile, delimiter = ",", skipinitialspace=True)
count = 0
for row in fastreader:
date1.append(row[0])
count = count + 1
TypeError: 'list' object is not callable
I'd be glad to help, but I'm not interested in guessing. Pleas take
wilsonmo...@gmail.com wrote:
> TypeError: 'list' object is not callable
Hint:
> open = []
[...]
> with open(..., "rb") as csvfile:
--
https://mail.python.org/mailman/listinfo/python-list
count = 0
for row in fastreader:
date1.append(row[0])
count = count + 1
TypeError: 'list' object is not callable
--
https://mail.python.org/mailman/listinfo/python-list
On Thu, Feb 6, 2014 at 5:08 PM, Dave Angel wrote:
> print('The secretWord is ' + secretWord
> print('The secretKey is ' + key
))
http://xkcd.com/859/
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
dave em Wrote in message:
>
>
> Fixed the error and am now onto the next issue.
>
> Solution was to return a list (I think) and then break out the components of
> the list and put in the variable. Here is how we did it:
>
> secretWord = getRandomWord(words)
> print('The secretWord is ' + str
27; + str(len(missedLetters))
> + ' missed guesses and ' + str(len(correctLetters)) + ' correct guesses, the
> word was "' + secretWord + '"')
>
> TypeError: Can't convert 'list' object to str implicitly
>
>
>
> -I c
an.py", line 155, in
print('You have run out of guesses! \n After ' + str(len(missedLetters)) +
' missed guesses and ' + str(len(correctLetters)) + ' correct guesses, the word
was "' + secretWord + '"')
TypeError: Can't convert 'li
age[s]". There is no
such list, and there never will be, because there is no limit to the
number and kind of possible error messages.
Instead, you should actually read the error message you see. Python is
telling you what the problem is. Pay attention to it.
AttributeError: 'list&
On Sat, Sep 15, 2012 at 1:01 AM, Token Type wrote:
> Thanks. By the way, do we have a list of explanations of error message? If
> so, whenever we come across error message, we can refer to it and solve the
> problem accordingly.
Not really, but if you paste the message into Google or DuckDuckGo
Thanks. By the way, do we have a list of explanations of error message? If so,
whenever we come across error message, we can refer to it and solve the problem
accordingly.
--
http://mail.python.org/mailman/listinfo/python-list
Token Type wrote:
In fact, I'm guessing that's your problem. I think you're ending up
with a list of lists of strings, when you think you're getting a list of
strings.
Thanks. You guess right. It turns out that lemma_list is a list of list, as I
tested in the previous post.
I of
In article ,
Token Type wrote:
> > structures are simple, just plain print will work, but for more
> >
> > complicated structures, pprint.pprint() is a life saver.
> >
>
> I did try . However,
>
> >>> pprint.pprint(lemma_list)
>
> Traceback (most recent call last):
> File "", line 1, in
In article <43a68990-d6cf-4362-8c47-b13ce780b...@googlegroups.com>,
Token Type wrote:
> Thanks very much for all of your tips. Take noun as an example. First, I need
> find all the lemma_names in all the synsets whose pos is 'n'. Second, for
> each lemma_name, I will check all their sense numb
> structures are simple, just plain print will work, but for more
>
> complicated structures, pprint.pprint() is a life saver.
>
I did try . However,
>>> pprint.pprint(lemma_list)
Traceback (most recent call last):
File "", line 1, in
pprint.pprint(lemma_list)
NameError: name 'pprint
> In fact, I'm guessing that's your problem. I think you're ending up
>
> with a list of lists of strings, when you think you're getting a list of
>
> strings.
>
Thanks. You guess right. It turns out that lemma_list is a list of list, as I
tested in the previous post.
--
http://mail.python
Thanks very much for all of your tips. Take noun as an example. First, I need
find all the lemma_names in all the synsets whose pos is 'n'. Second, for each
lemma_name, I will check all their sense number.
1) Surely,we can know the number of synset whose pos is noun by
>>> len([synset for syn
On 08Sep2012 13:45, Roy Smith wrote:
| First, I don't understand this code:
|
| In article ,
| Token Type wrote:
| > synset_list = list(wn.all_synsets(pos))
| > lemma_list = [synset.lemma_names for synset in synset_list]
|
| It looks like you're taking an iterable, converting it to a l
In article ,
Token Type wrote:
> I wrote the following function to solve it. However, it pops up
> "AttributeError: 'list' object has no attribute 'lower'". Quite confused, I
> supposed [synset.lemma_names for synset in synset_list] has made all the
&
en(synset_list)
>>> average_polysemy('n')
3
>
> I wrote the following function to solve it. However, it pops up
> "AttributeError: 'list' object has no attribute 'lower'". Quite confused, I
> supposed [synset.lemma_names
semy of nouns, verbs, adjectives, and adverbs according
to WordNet.http://nltk.googlecode.com/svn/trunk/doc/book/ch02.html
I wrote the following function to solve it. However, it pops up
"AttributeError: 'list' object has no attribute 'lower'". Quite confused, I
supposed
On Oct 31, 2:44 pm, Benjamin Kaplan wrote:
> Rep() = Rep object
> Rep.all() = Query object
> list(Rep.all()) = List of Rep objects.
> list(Rep.all())[0] = A single Rep object
> list(Rep.all())[0].replist = A list
>
Thanks! This was very helpful.
--
http://mail.python.org/mailman/listinfo/python
7;][u'a', u'b'][u'a', u'b']. . .
>
> So, these are the lists in datastore. I want to take one of these
> lists and apply list method on it. How do I do that? Thanks.
> --
Quite simple. You can apply a list method to a list object by actually
On Oct 31, 7:04 pm, Zeynel wrote:
> On Oct 31, 5:52 am, Dave Angel wrote:
>
>
>
>
>
>
>
>
>
> > On 2:59 PM, Zeynel wrote:> class Rep(db.Model):
> > > author = db.UserProperty()
> > > replist = db.ListProperty(str)
> > > unique = db.ListProperty(str)
> > > date = db.DateTimePro
On Oct 31, 5:52 am, Dave Angel wrote:
> On 2:59 PM, Zeynel wrote:> class Rep(db.Model):
> > author = db.UserProperty()
> > replist = db.ListProperty(str)
> > unique = db.ListProperty(str)
> > date = db.DateTimeProperty(auto_now_add=True)
>
> >
>
> > Rep().replist = L
> > R
On Oct 31, 3:00 am, Richard Thomas wrote:
> On Oct 31, 5:42 am, Zeynel wrote:
>
> > class Rep(db.Model):
> > author = db.UserProperty()
> > replist = db.ListProperty(str)
> > unique = db.ListProperty(str)
> > date = db.DateTimeProperty(auto_now_add=True)
>
> >
>
> > Rep().rep
On 2:59 PM, Zeynel wrote:
class Rep(db.Model):
author = db.UserProperty()
replist = db.ListProperty(str)
unique = db.ListProperty(str)
date = db.DateTimeProperty(auto_now_add=True)
Rep().replist = L
Rep().put()
mylist = Rep().all().fetch(10)
I am trying to display myli
On Oct 31, 5:42 am, Zeynel wrote:
> class Rep(db.Model):
> author = db.UserProperty()
> replist = db.ListProperty(str)
> unique = db.ListProperty(str)
> date = db.DateTimeProperty(auto_now_add=True)
>
>
>
> Rep().replist = L
> Rep().put()
> mylist = Rep().all().fetch(10)
>
> I
class Rep(db.Model):
author = db.UserProperty()
replist = db.ListProperty(str)
unique = db.ListProperty(str)
date = db.DateTimeProperty(auto_now_add=True)
Rep().replist = L
Rep().put()
mylist = Rep().all().fetch(10)
I am trying to display mylist; but I am getting the object.
On Mon, Jun 22, 2009 at 7:31 PM, bluefisher80 wrote:
> Hi
>
> Thanks for you tip,
>
> I am generating some code for another python application,
>
> so is there a better way for code generating? Actually i just need to
> generate some list objects to define EDI syntax using python.
Well, I would sa
:41
收件人: bluefisher80
抄送: J. Cliff Dyer; python-list
主题: Re: Re: How to output a complex List object to a file.
2009/6/22 bluefisher80 :
>
> Actually I think i am just looking for
>
> print >> myFile.py, myListObj
Well, that syntax is deprecated. And you'd have to create
2009/6/22 bluefisher80 :
>
> Actually I think i am just looking for
>
> print >> myFile.py, myListObj
Well, that syntax is deprecated. And you'd have to create the actual
file object. And put it in a variable.
So it's more like:
f = file("myFile.py", "w")
f.write(str(myListObj))
f.close()
Howeve
Actually I think i am just looking for
print >> myFile.py, myListObj
2009-06-23
bluefisher80
发件人: J. Cliff Dyer
发送时间: 2009-06-22 22:17:12
收件人: Jim Qiu
抄送: python-list
主题: Re: How to output a complex List object to a file.
Have you looked at the JSON module?
On Mon, 2009
Let me get my question more clear,
I want like the "structure" object printed into another python source file,
which i will use in other program.
The pickled format or even JSONed format does not fullfil my requirement, does
it?
Do i make it clear, I still need your guides.
Jim
Detail ste
On Mon, Jun 22, 2009 at 6:17 AM, Jim Qiu wrote:
> Hi all,
>
> I have a object list list this:
> I need to output this "structure" object into a file, how to do that ?
Links for the modules mentioned:
http://docs.python.org/library/pickle.html
http://docs.python.org/library/json.html
Cheers,
Chr
Have you looked at the JSON module?
On Mon, 2009-06-22 at 21:17 +0800, Jim Qiu wrote:
> Hi all,
>
> I have a object list list this:
>
> from bots.botsconfig import *
> from D96Arecords import recorddefs
> from edifactsyntax3 import syntax
>
> structure=[
> {ID:'UNH',MIN:1,MAX:1,LEVEL:[
> {I
On Jun 22, 2009, at 9:17 AM, Jim Qiu wrote:
Hi all,
I have a object list list this:
from bots.botsconfig import *
from D96Arecords import recorddefs
from edifactsyntax3 import syntax
structure=[
{ID:'UNH',MIN:1,MAX:1,LEVEL:[
{ID:'BGM',MIN:1,MAX:1},
{ID:'DTM',MIN:1,MAX:5},
...snip...
Hi all,
I have a object list list this:
from bots.botsconfig import *
from D96Arecords import recorddefs
from edifactsyntax3 import syntax
structure=[
{ID:'UNH',MIN:1,MAX:1,LEVEL:[
{ID:'BGM',MIN:1,MAX:1},
{ID:'DTM',MIN:1,MAX:5},
{ID:'NAD',MIN:1,MAX:5,LEVEL:[
{ID:'CTA',MIN:0,MAX:5,LEVEL:[
On Wed, May 13, 2009 at 1:55 AM, VenkataRamaKrishna Boddu
wrote:
> Hi All,
>
> This is my first mail to python-list.
>
> I just want to propose the idea of introducing a new method for the List
> Object in similar lines of Dictionary Object has_key method.
has_key has been rem
Hi All,
This is my first mail to python-list.
I just want to propose the idea of introducing a new method for the List Object
in similar lines of Dictionary Object has_key method.
See my below code, It always produces the ValueError, if I want to check
whether an item is present or not, then
En Wed, 31 Dec 2008 04:27:01 -0200, Steven D'Aprano
escribió:
On Wed, 31 Dec 2008 03:08:29 -0200, Gabriel Genellina wrote:
eval is like Pandora´s box, all kind of bad things can come from it. Do
not use it with any user-supplied string. If you can restrict the values
to be just constants, t
On Wed, 31 Dec 2008 03:08:29 -0200, Gabriel Genellina wrote:
> eval is like Pandora´s box, all kind of bad things can come from it. Do
> not use it with any user-supplied string. If you can restrict the values
> to be just constants, there is a "safe eval" recipe in
> http://code.activestate.com
En Wed, 31 Dec 2008 02:46:33 -0200, Harish Vishwanath
escribió:
li = [1,2,3]
repr(li)
'[1, 2, 3]'
Is there a standard way to get back li, from repr(li) ?
py> eval('[1, 2, 3]')
[1, 2, 3]
eval is like Pandora´s box, all kind of bad things can come from it. Do
not use it with any user-sup
On Wed, Dec 31, 2008 at 2:46 PM, Harish Vishwanath
wrote:
> Hello,
> Consider :
li = [1,2,3]
repr(li)
> '[1, 2, 3]'
> Is there a standard way to get back li, from repr(li) ?
Normally you would use eval(..) however this is
considered by many to be evil and bad practise (especially by me!
Hello,
Consider :
>>> li = [1,2,3]
>>> repr(li)
'[1, 2, 3]'
Is there a standard way to get back li, from repr(li) ?
Regards,
Harish
--
http://mail.python.org/mailman/listinfo/python-list
On May 10, 12:39 pm, Gandalf <[EMAIL PROTECTED]> wrote:
> my manual contain chapter about lists with python. when i try to copy
> paste :
>
> li = ["a", "b", "mpilgrim", "z", "example"] (1)
>
> it i get this errore:
>
t;mpilgrim", "z", "example"] (1)
| >
| >
| > it i get this errore:
| >
| > "TypeError: 'list' object is not callable"
| Remove the "(1)"
The '(1)' was almost certainly an 'equation number' or 'l
On 5/10/08, Gandalf <[EMAIL PROTECTED]> wrote:
> my manual contain chapter about lists with python. when i try to copy
> paste :
>
> li = ["a", "b", "mpilgrim", "z", "example"] (1)
>
>
> it i get this errore:
>
>
my manual contain chapter about lists with python. when i try to copy
paste :
li = ["a", "b", "mpilgrim", "z", "example"] (1)
it i get this errore:
"TypeError: 'list' object is not callable"
i was wondering if their is a
aceback (most recent call last):
> File "xxx", line 184, in onAddErro
> list = self.errorMgr.getList()
> TypeError: 'list' object is not callable
>
> How can I solve it?
This error implies that getList is a list, *not* a function which
returns a list.
If t
onAddErro
list = self.errorMgr.getList()
TypeError: 'list' object is not callable
How can I solve it?
--
http://mail.python.org/mailman/listinfo/python-list
On May 23, 10:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote:
> This is the winner:
>
> class Point(list):
> def __init__(self, x, y, z = 1):
> super(Point, self).__init__([x, y, z])
> self.x = x
> self.y = y
> self.z = z
>
> def __getattr__(self, name):
>
On May 23, 2:24 pm, Lyosha <[EMAIL PROTECTED]> wrote:
> On May 23, 12:19 pm, Lyosha <[EMAIL PROTECTED]> wrote:
>
>
>
> > On May 23, 12:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote:
>
> > > On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
>
> > > > On 23 May 2007 11:31:56 -0700, Mangabasi <
On May 23, 2:19 pm, Lyosha <[EMAIL PROTECTED]> wrote:
> On May 23, 12:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote:
>
> > On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
>
> > > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote:
>
> > > > When I modified this to:
>
> > >
On May 23, 12:19 pm, Lyosha <[EMAIL PROTECTED]> wrote:
> On May 23, 12:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote:
>
> > On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
>
> > > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote:
>
> > > > When I modified this to:
>
> > >
On May 23, 12:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote:
> On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote:
>
> > > When I modified this to:
>
> > > class Point(list):
> > > def __init__(self,x,y):
> > >
On May 23, 12:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote:
> On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote:
>
> > > When I modified this to:
>
> > > class Point(list):
> > > def __init__(self,x,y):
> > >
On May 23, 12:07 pm, Mangabasi <[EMAIL PROTECTED]> wrote:
> On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
>
>
>
> > On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote:
>
> > > When I modified this to:
>
> > > class Point(list):
> > > def __init__(self,x,y):
> > >
On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
> On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote:
>
> > When I modified this to:
>
> > class Point(list):
> > def __init__(self,x,y):
> > super(Point, self).__init__([x, y])
> > self.x = x
> >
On May 23, 1:43 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
> On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote:
>
> > When I modified this to:
>
> > class Point(list):
> > def __init__(self,x,y):
> > super(Point, self).__init__([x, y])
> > self.x = x
> >
On 23 May 2007 11:31:56 -0700, Mangabasi <[EMAIL PROTECTED]> wrote:
> When I modified this to:
>
> class Point(list):
> def __init__(self,x,y):
> super(Point, self).__init__([x, y])
> self.x = x
> self.y = y
>
> It worked.
Are you sure?
>>> p = Point(10, 20)
>>> p
[10,
On May 23, 12:47 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
> On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote:
>
> > There must be a way to inherit from the list type without having to
> > redefine all the methods and attributes that regular lists have.
>
> Like this:
>
> class
On May 23, 12:47 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
> On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote:
>
> > There must be a way to inherit from the list type without having to
> > redefine all the methods and attributes that regular lists have.
>
> Like this:
>
> class
On May 23, 12:47 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
> On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote:
>
> > There must be a way to inherit from the list type without having to
> > redefine all the methods and attributes that regular lists have.
>
> Like this:
>
> class
On May 23, 12:47 pm, "Jerry Hill" <[EMAIL PROTECTED]> wrote:
> On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote:
>
> > There must be a way to inherit from the list type without having to
> > redefine all the methods and attributes that regular lists have.
>
> Like this:
>
> class
Hi,
u have the answer in ur question itself :) u dont need to redefine list
methods again - just inherit from the builtin-list-type.
try this with new style classes:
code ###
class Point(list):
def __init__(self,x,y):
super(Point, self).__init__()
self.x = x
self.y
On 23 May 2007 09:58:36 -0700, Mangabasi <[EMAIL PROTECTED]> wrote:
> There must be a way to inherit from the list type without having to
> redefine all the methods and attributes that regular lists have.
Like this:
class Point(list):
def __init__(self, x, y, z = 1):
list.__init__(sel
Howdy,
I would like to create a Point class that lets me use Point instances
like the following example.
>>> p = Point(3, 4)
>>> p.x
3
>>> p.y
4
>>> p.z
1
>>> p[0]
3
>>> p[1]
4
>>> p[1] = 5
>>> p.y
5
>>>
other than the x, y, z attributes, these instances should behave like
regular Python lists.
On Monday 12 March 2007 20:34, Steve Potter wrote:
> I am trying to find some method of attaching a
> Listbox object to a list object so as the
> contents of the list are changed the contents
> of the Listbox will be updated to match. I
> have found a few references to something
Steve Potter wrote:
> I am trying to find some method of attaching a Listbox object to a
> list object so as the contents of the list are changed the contents of
> the Listbox will be updated to match. I have found a few references
> to something like this in this old
I am trying to find some method of attaching a Listbox object to a
list object so as the contents of the list are changed the contents of
the Listbox will be updated to match. I have found a few references
to something like this in this old post
http://groups.google.com/group/comp.lang.python
On Jan 30, 10:47 am, Peter Otten <[EMAIL PROTECTED]> wrote:
> jeremito wrote:
> > I have created a class that inherits from the list object. I want to
> > override the append function to allow my class to append several
> > copies at the same time with one f
jeremito wrote:
> I have created a class that inherits from the list object. I want to
> override the append function to allow my class to append several
> copies at the same time with one function call. I want to do
> something like:
>
> import copy
>
> class MyList(
I have created a class that inherits from the list object. I want to
override the append function to allow my class to append several
copies at the same time with one function call. I want to do
something like:
import copy
class MyList(list):
__init__(self):
pass
def append(self
76 matches
Mail list logo