Re: AttributeError: 'NoneType' object has no attribute 'get'

2022-01-06 Thread Chris Angelico
On Fri, Jan 7, 2022 at 8:47 AM <2qdxy4rzwzuui...@potatochowder.com> wrote: > > On 2022-01-06 at 14:21:48 -0700, > Mats Wichmann wrote: > > > And at a more meta level: many functions in the Python world return > > None as an indication that the operation did not succeed. It's useful > > because i

Re: AttributeError: 'NoneType' object has no attribute 'get'

2022-01-06 Thread 2QdxY4RzWzUUiLuE
On 2022-01-06 at 14:21:48 -0700, Mats Wichmann wrote: > And at a more meta level: many functions in the Python world return > None as an indication that the operation did not succeed. It's useful > because in many circumstances None is an "out of band" value - one > that could not happen natura

Re: AttributeError: 'NoneType' object has no attribute 'get'

2022-01-06 Thread Mats Wichmann
On 1/6/22 11:02, Kushal Kumaran wrote: > On Tue, Jan 04 2022 at 11:34:20 PM, NArshad wrote: >> How to correct what is written below: >> >> Exception in Tkinter callback >> Traceback (most recent call last): >> File "C:\Users\Dani Brothers\Anaconda3\lib\tkinter\__init__.py", line >> 1705, in __c

Re: AttributeError: 'NoneType' object has no attribute 'get'

2022-01-06 Thread Kushal Kumaran
On Tue, Jan 04 2022 at 11:34:20 PM, NArshad wrote: > How to correct what is written below: > > Exception in Tkinter callback > Traceback (most recent call last): > File "C:\Users\Dani Brothers\Anaconda3\lib\tkinter\__init__.py", line 1705, > in __call__ > return self.func(*args) > File "D

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Larry Martell
On Thu, Aug 8, 2019 at 1:33 PM Peter Otten <__pete...@web.de> wrote: > > Larry Martell wrote: > > >> Pyke has been ported to py3. Here is the code that returns the data I > >> am trying to process: > >> > >> return map(self.doctor_answer, it) > >> > >> I don't see anything calling imap. > > > > I g

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Peter Otten
Larry Martell wrote: >> Pyke has been ported to py3. Here is the code that returns the data I >> am trying to process: >> >> return map(self.doctor_answer, it) >> >> I don't see anything calling imap. > > I grepped through the entire pyke code and imap is not in there. Fire up the python3 interp

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Larry Martell
On Thu, Aug 8, 2019 at 12:34 PM Rhodri James wrote: > > On 08/08/2019 17:16, Larry Martell wrote: > > On Thu, Aug 8, 2019 at 11:30 AM Peter Otten <__pete...@web.de> wrote: > >> > >> Larry Martell wrote: > [snip] > >>> But in py3 that fails with: AttributeError: module 'itertools' has no > >>> attr

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Rhodri James
On 08/08/2019 17:16, Larry Martell wrote: On Thu, Aug 8, 2019 at 11:30 AM Peter Otten <__pete...@web.de> wrote: Larry Martell wrote: [snip] But in py3 that fails with: AttributeError: module 'itertools' has no attribute 'imap' In Python 3 the map() builtin is "lazy", so you can use that ins

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Larry Martell
On Thu, Aug 8, 2019 at 12:16 PM Larry Martell wrote: > > On Thu, Aug 8, 2019 at 11:30 AM Peter Otten <__pete...@web.de> wrote: > > > > Larry Martell wrote: > > > > > I have some code that is using the pyke package > > > (https://sourceforge.net/projects/pyke/). That project seems fairly > > > dead

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Larry Martell
On Thu, Aug 8, 2019 at 11:30 AM Peter Otten <__pete...@web.de> wrote: > > Larry Martell wrote: > > > I have some code that is using the pyke package > > (https://sourceforge.net/projects/pyke/). That project seems fairly > > dead, so asking here. > > > > There is a pyke function that returns a cont

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread MRAB
On 2019-08-08 15:29, Larry Martell wrote: I have some code that is using the pyke package (https://sourceforge.net/projects/pyke/). That project seems fairly dead, so asking here. There is a pyke function that returns a context manager with an iterable map. In py2.7 I did this: from pyke import

Re: AttributeError: module 'itertools' has no attribute 'imap'

2019-08-08 Thread Peter Otten
Larry Martell wrote: > I have some code that is using the pyke package > (https://sourceforge.net/projects/pyke/). That project seems fairly > dead, so asking here. > > There is a pyke function that returns a context manager with an > iterable map. In py2.7 I did this: > > from pyke import knowl

Re: AttributeError: 'module' object has no attribute 'urlretrieve' in window subsystem ubuntu bash for tensorflow

2017-05-20 Thread Kev Dwyer
Ho Yeung Lee wrote: > i use window subsystem ubuntu > and install python 3 and tensorflow > > then when try deep learning > > https://www.tensorflow.org/tutorials/wide_and_deep > > got error when urlretrieve local directory in ubuntu in window > > tried urllib3 still have error > > import tem

Re: AttributeError into a bloc try-except AttributeError

2016-06-12 Thread Vincent Vande Vyvre
Le 12/06/16 09:20, Vincent Vande Vyvre a écrit : Hi, I have a strange behaviour in my code. In an interactive session, the result is as expected: Python 3.4.3 (default, Oct 14 2015, 20:28:29) [GCC 4.8.4] on linux Type "help", "copyright", "credits" or "license" for more information. >>> a = No

Re: AttributeError: 'module' object has no attribute '__path__'

2015-08-31 Thread Chris Angelico
On Tue, Sep 1, 2015 at 1:32 PM, Rustom Mody wrote: > On Tuesday, September 1, 2015 at 3:46:15 AM UTC+5:30, Laura Creighton wrote: >> Can you make the effort to move your cursor to the bottom of >> the mail you are replying to, before you start typing, >> so that your reply comes after what was sai

Re: AttributeError: 'module' object has no attribute '__path__'

2015-08-31 Thread Rustom Mody
On Tuesday, September 1, 2015 at 3:46:15 AM UTC+5:30, Laura Creighton wrote: > Can you make the effort to move your cursor to the bottom of > the mail you are replying to, before you start typing, > so that your reply comes after what was said before, instead of > first thing, and thus before what

Re: AttributeError: 'module' object has no attribute '__path__'

2015-08-31 Thread Laura Creighton
In a message of Mon, 31 Aug 2015 17:01:07 -0400, Saran Ahluwalia writes: >Laura, > >It does not appear to be the case. I actually had to actually unset the >PYTHONPATH. > >Thanks for your suggestion. > >Sincerely, >Saran Are you and kbtyo the same person? If deleting your PYTHONPATH fixed it, th

Re: AttributeError: 'module' object has no attribute '__path__'

2015-08-31 Thread Saran Ahluwalia
Laura, It does not appear to be the case. I actually had to actually unset the PYTHONPATH. Thanks for your suggestion. Sincerely, Saran On Mon, Aug 31, 2015 at 4:17 PM, Laura Creighton wrote: > Check and see if you have a file in your working directory with the > very same name as a module yo

Re: AttributeError: 'module' object has no attribute '__path__'

2015-08-31 Thread Laura Creighton
Check and see if you have a file in your working directory with the very same name as a module you are trying to import, or the_same_name.py If so, change the name of that file to something else. Laura -- https://mail.python.org/mailman/listinfo/python-list

Re: AttributeError

2015-08-14 Thread Ben Finney
Ltc Hotspot writes: > So calling people stupid and ignorant on the internet makes you sexual > arousal and to masturbate with yourself With that, you have worn out your welcome here. Please don't post here again until you can refrain from puerile demeaning insults. -- \ “Alternative e

Re: AttributeError

2015-08-13 Thread Denis McMahon
On Thu, 13 Aug 2015 02:41:55 -0700, Ltc Hotspot wrote: >>> How do I define X? > What are the values of X & Y from the code as follows: > # print time: ['From', 'stephen.marqu...@uct.ac.za', 'Sat', 'Jan', '5', '09:14:16', '2008'] This is the data you need to look at. X is the position in the p

Re: AttributeError

2015-08-13 Thread Ltc Hotspot
On Thu, Aug 13, 2015 at 2:15 AM, Denis McMahon wrote: > On Wed, 12 Aug 2015 16:46:32 -0700, Ltc Hotspot wrote: > >> How do I define X? >> > - >> Traceback reads: >> >> 10 f = open(filename,'r') >> 11 for

Re: AttributeError

2015-08-13 Thread Mark Lawrence
On 12/08/2015 22:04, Ltc Hotspot wrote: So calling people stupid and ignorant on the internet makes you sexual arousal and to masturbate with yourself *plonk* - please follow suit everybody, it's quite clear that he has no interest in bothering with any of the data we've all provided. -- My

Re: AttributeError

2015-08-13 Thread Denis McMahon
On Wed, 12 Aug 2015 16:46:32 -0700, Ltc Hotspot wrote: > How do I define X? > - > Traceback reads: > > 10 f = open(filename,'r') > 11 for l in f: > ---> 12 h = int(l.split()[X].split(':')[Y]) >

Re: AttributeError

2015-08-13 Thread Ltc Hotspot
So calling people stupid and ignorant on the internet makes you sexual arousal and to masturbate with yourself On Wed, Aug 12, 2015 at 1:38 PM, Denis McMahon wrote: > On Wed, 12 Aug 2015 12:05:37 -0700, Ltc Hotspot wrote: > >>>Have a look at assignment_10_2_v_06.py. > >> What should I look at ass

Re: AttributeError

2015-08-12 Thread MRAB
On 2015-08-13 00:46, Ltc Hotspot wrote: >> How do I define the file name in order to remove the traceback? >> > At this point I think I'll just let you figure that out for yourself... > > -- > https://mail.python.org/mailman/listinfo/python-list MRAB, How do I define X?

Re: AttributeError

2015-08-12 Thread Ltc Hotspot
>> How do I define the file name in order to remove the traceback? >> > At this point I think I'll just let you figure that out for yourself... > > -- > https://mail.python.org/mailman/listinfo/python-list MRAB, How do I define X? --

Re: AttributeError

2015-08-12 Thread MRAB
On 2015-08-13 00:05, Ltc Hotspot wrote: On Wed, Aug 12, 2015 at 3:35 PM, MRAB wrote: > On 2015-08-12 22:16, Denis McMahon wrote: > [snip] > >> c = [0 for i in range(24)] >> f = open(filename,'r') >> for l in f: >> h = int(l.strip().split()[X].split(':')[Y]) >> c[h] = c[h] + 1 >> f.clos

Re: AttributeError

2015-08-12 Thread Emile van Sebille
On 8/12/2015 4:05 PM, Ltc Hotspot wrote: On Wed, Aug 12, 2015 at 3:35 PM, MRAB wrote: On 2015-08-12 22:16, Denis McMahon wrote: [snip] c = [0 for i in range(24)] f = open(filename,'r') for l in f: h = int(l.strip().split()[X].split(':')[Y]) c[h] = c[h] + 1 f.close() for i in range

Re: AttributeError

2015-08-12 Thread Ltc Hotspot
On Wed, Aug 12, 2015 at 3:35 PM, MRAB wrote: > On 2015-08-12 22:16, Denis McMahon wrote: > [snip] > >> c = [0 for i in range(24)] >> f = open(filename,'r') >> for l in f: >> h = int(l.strip().split()[X].split(':')[Y]) >> c[h] = c[h] + 1 >> f.close() >> for i in range(24): >> print '

Re: AttributeError

2015-08-12 Thread MRAB
On 2015-08-12 22:16, Denis McMahon wrote: [snip] c = [0 for i in range(24)] f = open(filename,'r') for l in f: h = int(l.strip().split()[X].split(':')[Y]) c[h] = c[h] + 1 f.close() for i in range(24): print '{:02d} {}'.format(i, c[i]) There's no need to strip whitespace just bef

Re: AttributeError

2015-08-12 Thread Mark Lawrence
On 12/08/2015 23:02, Ltc Hotspot wrote: FOR GOD'S SAKE WILL YOU PLEASE STOP TOP POSTING AND TRIM DOWN YOUR REPLIES. WHAT GRADE DO YOU EXPECT, A Z-? -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence -- https://mail.python.

Re: AttributeError

2015-08-12 Thread Ltc Hotspot
The problem here is that these are home work assignment and to code an else word assignment would be in contradiction to the academic curriculum. Specifically, I want to deploy a quick and simply dic solution: Revised code: c = [0 for i in range(24)] filename = raw_input("Enter file name: ") f =

Re: AttributeError

2015-08-12 Thread Mark Lawrence
On 12/08/2015 22:32, Emile van Sebille wrote: @ltc -- read this -- then re-read all the responses you've been given. Repeat ad nauseam. Until you can understand and incorporate advice given you're wasting your time and ours asking. This question has been asked on *THREE* different Python mai

Re: AttributeError

2015-08-12 Thread Mark Lawrence
On 12/08/2015 22:15, Clayton Kirkwood wrote: I'm thinking we are being played by a Turing type machine. crk Will you please stop top posting, how many times do people have to be asked until the message gets through? -- My fellow Pythonistas, ask not what our language can do for you, ask wh

Re: AttributeError

2015-08-12 Thread Emile van Sebille
On 8/12/2015 1:38 PM, Denis McMahon wrote: On Wed, 12 Aug 2015 12:05:37 -0700, Ltc Hotspot wrote: Have a look at assignment_10_2_v_06.py. What should I look at assignment_10_2_v_06.py.: You shouldn't. You should instead approach your tutor and tell him you are too stupid to learn computer

Re: AttributeError

2015-08-12 Thread Gene Heskett
On Wednesday 12 August 2015 15:05:37 Ltc Hotspot wrote: > >Have a look at assignment_10_2_v_06.py. > > What should I look at assignment_10_2_v_06.py.: > > > handle = """From stephen.marqu...@uct.ac.za Sat Jan 5 09:14:16 2008 > From lo...@media.berkeley.edu Fri Jan 4 18:10:48 2008 > """.split("\n

Re: AttributeError

2015-08-12 Thread Denis McMahon
On Wed, 12 Aug 2015 11:35:03 -0700, Ltc Hotspot wrote: > How do I define time in the revised code ? I'm guessing that you have a line of input like: word word word timestamp word word word word and that timestamp looks something like: hh:mm:ss Start of by defining a list with 24 elements all

RE: AttributeError

2015-08-12 Thread Clayton Kirkwood
I'm thinking we are being played by a Turing type machine. crk > -Original Message- > From: Python-list [mailto:python-list- > bounces+crk=godblessthe...@python.org] On Behalf Of Denis McMahon > Sent: Wednesday, August 12, 2015 1:39 PM > To: python-list@pyth

Re: AttributeError

2015-08-12 Thread Mark Lawrence
On 12/08/2015 21:28, Denis McMahon wrote: On Wed, 12 Aug 2015 09:29:50 -0700, Ltc Hotspot wrote: Using the attached file of a diagram as a frame, why is there an attribute message? Perhaps you should read the message. It's very clear. Not to Ltc Hotspot. I'm unsure as to whether he's sim

Re: AttributeError

2015-08-12 Thread Denis McMahon
On Wed, 12 Aug 2015 12:05:37 -0700, Ltc Hotspot wrote: >>Have a look at assignment_10_2_v_06.py. > What should I look at assignment_10_2_v_06.py.: You shouldn't. You should instead approach your tutor and tell him you are too stupid to learn computer programming[1], and can you please transfer

Re: AttributeError

2015-08-12 Thread Denis McMahon
On Wed, 12 Aug 2015 09:29:50 -0700, Ltc Hotspot wrote: > Using the attached file of a diagram as a frame, why is there an > attribute message? Perhaps you should read the message. It's very clear. -- Denis McMahon, denismfmcma...@gmail.com -- https://mail.python.org/mailman/listinfo/python-li

Re: AttributeError

2015-08-12 Thread MRAB
On 2015-08-12 20:05, Ltc Hotspot wrote: >Have a look at assignment_10_2_v_06.py. What should I look at assignment_10_2_v_06.py.: How "time" is defined! handle = """From stephen.marqu...@uct.ac.za Sat Jan 5 09:14:16 2008 >From lo...@media.berkeley.edu Fri Jan 4 18:10:48 2008 """.split("\n")

Re: AttributeError

2015-08-12 Thread Ltc Hotspot
>Have a look at assignment_10_2_v_06.py. What should I look at assignment_10_2_v_06.py.: handle = """From stephen.marqu...@uct.ac.za Sat Jan 5 09:14:16 2008 >From lo...@media.berkeley.edu Fri Jan 4 18:10:48 2008 """.split("\n") # Snippet file data: mbox-short.txt count = dict() #fname = raw_i

Re: AttributeError

2015-08-12 Thread MRAB
On 2015-08-12 19:35, Ltc Hotspot wrote: Emile How do I define time in the revised code ? Have a look at assignment_10_2_v_06.py. --- Traceback Message reads: In [66]: %run assignment_10_2_v_07 NameError Traceback (most

Re: AttributeError

2015-08-12 Thread Ltc Hotspot
Emile How do I define time in the revised code ? --- Traceback Message reads: In [66]: %run assignment_10_2_v_07 NameError Traceback (most recent call last) C:\Users\vm\Desktop\apps\docs\Pyt

Re: AttributeError

2015-08-12 Thread Emile van Sebille
On 8/12/2015 10:24 AM, MRAB wrote: What is it _actually_ trying to split? Aah, reading. Such an underused skill. Emile -- https://mail.python.org/mailman/listinfo/python-list

RE: AttributeError

2015-08-12 Thread Clayton Kirkwood
> -Original Message- > From: Python-list [mailto:python-list- > bounces+crk=godblessthe...@python.org] On Behalf Of Ltc Hotspot > Sent: Wednesday, August 12, 2015 9:57 AM > To: MRAB > Cc: python-list@python.org > Subject: Re: AttributeError > > MRAB, > &g

Re: AttributeError

2015-08-12 Thread MRAB
On 2015-08-12 17:57, Ltc Hotspot wrote: MRAB, I ran the code, and the output: Raw data code: handle = """From stephen.marqu...@uct.ac.za Sat Jan 5 09:14:16 2008 >From lo...@media.berkeley.edu Fri Jan 4 18:10:48 2008 """.split("\n") # Snippet file data: mbox-short.txt count = dict() #fname =

Re: AttributeError

2015-08-12 Thread Ltc Hotspot
MRAB, I ran the code, and the output: Raw data code: handle = """From stephen.marqu...@uct.ac.za Sat Jan 5 09:14:16 2008 >From lo...@media.berkeley.edu Fri Jan 4 18:10:48 2008 """.split("\n") # Snippet file data: mbox-short.txt count = dict() #fname = raw_input("Enter file name: ")# Add Snipp

Re: AttributeError

2015-08-12 Thread MRAB
On 2015-08-12 17:29, Ltc Hotspot wrote: Denis, Using the attached file of a diagram as a frame, why is there an attribute message? The code in the error report doesn't match the "revised code". ---

Re: AttributeError

2015-08-12 Thread Ltc Hotspot
Denis, Using the attached file of a diagram as a frame, why is there an attribute message? - Here is the attribute message: AttributeError Traceback (most recent call last) C:\Users\vm\Desk

Re: AttributeError

2015-08-12 Thread Denis McMahon
On Tue, 11 Aug 2015 22:03:05 -0700, Ltc Hotspot wrote: > Question: What sorted function should I write to produce the desired > output, below: Me, I'd start by declaring a dictionary to hold the data: counts = { "{:02d}".format(h):0 for h in range(24) } Then I'd parse the strings in the log fil

Re: AttributeError

2015-08-12 Thread MRAB
On 2015-08-12 06:03, Ltc Hotspot wrote: Message heard loud and clear: There are no error messages, the output is the issue. Question: What sorted function should I write to produce the desired output, below: Instead of iterating over "count.items()", iterate over "sorted(count.items())". D

Re: AttributeError

2015-08-12 Thread MRAB
On 2015-08-12 04:05, Ltc Hotspot wrote: Chris, Check the code and the visualize execution of the code, available at http://tinyurl.com/p8tgd5h message reads: NameError: name 'collections' is not defined You didn't import the module. Regards, Hal On Tue, Aug 11, 2015 at 5:49 PM, Chris Ange

Re: AttributeError

2015-08-12 Thread Denis McMahon
On Tue, 11 Aug 2015 17:01:24 -0700, Ltc Hotspot wrote: > What is the list equivalent to line 12: ncount.sort(reverse=True) > > count = dict() > fname = raw_input("Enter file name: ")# > handle = open (fname, 'r')# > for line in handle: > if line.startswith("From "): > address = line.s

Re: AttributeError

2015-08-11 Thread Ltc Hotspot
Message heard loud and clear: There are no error messages, the output is the issue. Question: What sorted function should I write to produce the desired output, below: Desired output: 04 3 06 1 07 1 09 2 10 3 11 6 14 1 15 2 16 4 17 2 18 1 19 1 Latest revised code: count = dict() fname = raw_i

Re: AttributeError

2015-08-11 Thread Chris Angelico
On Wed, Aug 12, 2015 at 1:05 PM, Ltc Hotspot wrote: > > Check the code and the visualize execution of the code, available at > http://tinyurl.com/p8tgd5h > > message reads: NameError: name 'collections' is not defined I've no idea why you made this Frankenstein monster out of your original code a

Re: AttributeError

2015-08-11 Thread Mark Lawrence
On 12/08/2015 04:05, Ltc Hotspot wrote: Chris, Check the code and the visualize execution of the code, available at http://tinyurl.com/p8tgd5h message reads: NameError: name 'collections' is not defined Which is why we kept telling you over on the tutor mailing list to show us your complete

Re: AttributeError

2015-08-11 Thread Ltc Hotspot
Chris, Check the code and the visualize execution of the code, available at http://tinyurl.com/p8tgd5h message reads: NameError: name 'collections' is not defined Regards, Hal On Tue, Aug 11, 2015 at 5:49 PM, Chris Angelico wrote: > On Wed, Aug 12, 2015 at 10:43 AM, Ltc Hotspot > wrote: > >

Re: AttributeError

2015-08-11 Thread Mark Lawrence
On 12/08/2015 01:49, Chris Angelico wrote: On Wed, Aug 12, 2015 at 10:43 AM, Ltc Hotspot wrote: Python can pull the hour from the 'From ' line by finding the time and then splitting the string a second time using a colon, i.e., From stephen.marqu...@uct.ac.za Sat Jan 5 09:14:16 2008 Finally,

Re: AttributeError

2015-08-11 Thread MRAB
On 2015-08-12 01:43, Ltc Hotspot wrote: The Assignment: I'm trying to write Python code to read through a data file and figure out the distribution by hour of the dat for each message in the data file. Python can pull the hour from the 'From ' line by finding the time and then splitting th

Re: AttributeError

2015-08-11 Thread Chris Angelico
On Wed, Aug 12, 2015 at 10:43 AM, Ltc Hotspot wrote: > Python can pull the hour from the 'From ' line by finding the time and then > splitting the string a second time using a colon, i.e., From > stephen.marqu...@uct.ac.za Sat Jan 5 09:14:16 2008 > > Finally, accumulated the counts for each hour,

Re: AttributeError

2015-08-11 Thread Ltc Hotspot
The Assignment: I'm trying to write Python code to read through a data file and figure out the distribution by hour of the dat for each message in the data file. Python can pull the hour from the 'From ' line by finding the time and then splitting the string a second time using a colon, i.e., F

Re: AttributeError

2015-08-11 Thread MRAB
On 2015-08-12 01:01, Ltc Hotspot wrote: Hi Everyone, What is the list equivalent to line 12: ncount.sort(reverse=True) count = dict() fname = raw_input("Enter file name: ")# handle = open (fname, 'r')# for line in handle: if line.startswith("From "): address = line.split()[5]

Re: AttributeError

2015-08-11 Thread leo kirotawa
assign using () creates tuple not a list. Tuples have not .sort() method. correct would be: ncount = [key,val] On Tue, Aug 11, 2015 at 9:01 PM, Ltc Hotspot wrote: > Hi Everyone, > > > What is the list equivalent to line 12: ncount.sort(reverse=True) > > > count = dict() > fname = raw_input("Enter

Re: AttributeError: LineLogic instance has no attribute 'probe'

2015-07-29 Thread John Gordon
In Cameron Simpson writes: > >Since you haven't posted the actual complete code, we can only guess > >at the problem. > > > >My guess is that you have two different definitions of the LineLogic > >class, one of them lacking the probe attribute. > Alternatively, if the code he did quote is accu

Re: AttributeError: LineLogic instance has no attribute 'probe'

2015-07-27 Thread Cameron Simpson
On 27Jul2015 13:43, John Gordon wrote: In Abder-Rahman Ali writes: In the class ---> LineLogic def __init__(self): self.probe = vtk.vtkProbeFilter() In another class ---> LineLogicTest logic = LineLogic() probe = logic.probe data = probe.GetOutput().GetPointData().GetScalars()

Re: AttributeError: LineLogic instance has no attribute 'probe'

2015-07-27 Thread John Gordon
In Abder-Rahman Ali writes: > In the class ---> LineLogic > def __init__(self): > self.probe = vtk.vtkProbeFilter() > In another class ---> LineLogicTest > logic = LineLogic() > probe = logic.probe > data = probe.GetOutput().GetPointData().GetScalars() > When I try running the program

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-08 Thread Chris Angelico
On Fri, Aug 8, 2014 at 5:17 PM, Rustom Mody wrote: >> But with Roy's suggestion, testing for the existence of os.fork is not >> sufficient, because it will exist even on platforms where fork doesn't >> exist. So testing that os.fork exists is not sufficient to tell whether or >> not you can actual

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-08 Thread Rustom Mody
On Friday, August 8, 2014 11:18:17 AM UTC+5:30, Steven D'Aprano wrote: > Rustom Mody wrote: > > On Thursday, August 7, 2014 10:26:56 PM UTC+5:30, Steven D'Aprano wrote: > >> Roy Smith wrote: > >> > Peter Otten wrote: > >> >> os.fork() > >> >> Fork a child process. > >> >> ... > >> >> Availabilit

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-07 Thread Steven D'Aprano
Rustom Mody wrote: > On Thursday, August 7, 2014 10:26:56 PM UTC+5:30, Steven D'Aprano wrote: >> Roy Smith wrote: > >> > Peter Otten wrote: >> >> os.fork() >> >> Fork a child process. >> >> ... >> >> Availability: Unix. >> >> """ >> >> You are using the wrong operating system ;) >> > To be hone

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-07 Thread Rustom Mody
On Friday, August 8, 2014 10:49:27 AM UTC+5:30, Rustom Mody wrote: > On Thursday, August 7, 2014 10:26:56 PM UTC+5:30, Steven D'Aprano wrote: > > Roy Smith wrote: > > > Peter Otten wrote: > > >> os.fork() > > >> Fork a child process. > > >> ... > > >> Availability: Unix. > > >> """ > > >> You ar

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-07 Thread Rustom Mody
On Thursday, August 7, 2014 10:26:56 PM UTC+5:30, Steven D'Aprano wrote: > Roy Smith wrote: > > Peter Otten wrote: > >> os.fork() > >> Fork a child process. > >> ... > >> Availability: Unix. > >> """ > >> You are using the wrong operating system ;) > > To be honest, this could be considered a bu

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-07 Thread Steven D'Aprano
Roy Smith wrote: > In article , > Peter Otten <__pete...@web.de> wrote: > >> os.fork() >> Fork a child process. >> ... >> Availability: Unix. >> """ >> >> You are using the wrong operating system ;) > > To be honest, this could be considered a buglet in the os module. It > really should raise

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-07 Thread Roy Smith
In article , Peter Otten <__pete...@web.de> wrote: > os.fork() > Fork a child process. > ... > Availability: Unix. > """ > > You are using the wrong operating system ;) To be honest, this could be considered a buglet in the os module. It really should raise: NotImplementedError("fork() is on

Re: AttributeError: 'module' object has no attribute 'fork'

2014-08-07 Thread Peter Otten
Satish ML wrote: > Hi, > > Code: > import os, time > def child(pipeout): > zzz = 0 > while True: > time.sleep(zzz) > msg = ('Spam %03d' % zzz).encode() > os.write(pipeout, msg) > zzz = (zzz+1) % 5 > def parent(): > pipein, pipeout = os.pipe() > if o

RE: AttributeError: '' object has no attribute 'SeriesCollection'

2014-02-13 Thread Stefan Schukat
Hello, the "chartObj" is not a Chart object it is a shape see >> from win32com.client import Dispatch >>> Excel = Dispatch("Excel.Application") >>> WB = Excel.Workbooks.Add() >>> Shape = WB.Sheets[0].Shapes.AddChart() >>> Shape.Chart.SeriesCollection >> Regards Stefan Schukat -

Re: AttributeError: 'Or' object has no attribute 'as_independent'

2014-02-13 Thread Terry Reedy
On 2/13/2014 4:03 AM, wilsonmo...@gmail.com wrote: Traceback (most recent call last): File "testcsv.py", line 17, in print(sy.solve([x^2+x+1-t, x^3+x^2-t], x)) File "C:\Python27\lib\site-packages\sympy\solvers\solvers.py", line 902, in so lve solution = _solve_system(f, symbols,

Re: AttributeError: '' object has no attribute 'SeriesCollection'

2014-02-13 Thread Tim Golden
On 13/02/2014 11:58, Jaydeep Patil wrote: > Just consider that you have chart object & you need to add data series for > that chart. How you can add this? Jaydeep: you're writing to a general Python list. Few of the people here run on Windows; fewer still will use Python to automate Excel via COM

Re: AttributeError: '' object has no attribute 'SeriesCollection'

2014-02-13 Thread Jaydeep Patil
On Thursday, 13 February 2014 16:41:48 UTC+5:30, Ben Finney wrote: > Jaydeep Patil writes: > > > > > I have created chart object. But unable to add series into chart. > > > > Your code isn't self-contained (we are not able to run it as you > > presented it). > > > > Are you relying on s

Re: AttributeError: '' object has no attribute 'SeriesCollection'

2014-02-13 Thread Ben Finney
Jaydeep Patil writes: > I have created chart object. But unable to add series into chart. Your code isn't self-contained (we are not able to run it as you presented it). Are you relying on some specific third-party library? If so, you need to be explicit. You may also get better response if you

Re: AttributeError Problem

2013-04-23 Thread MRAB
On 24/04/2013 01:28, animemaiden wrote: On Tuesday, April 23, 2013 8:02:08 PM UTC-4, Skip Montanaro wrote: > numberOfVertices = int(infile.readline().decode()) # Read the first line from the file > AttributeError: 'str' object has no attribute 'readline' ... > infile = filedialog.askopen

Re: AttributeError Problem

2013-04-23 Thread animemaiden
On Tuesday, April 23, 2013 8:02:08 PM UTC-4, Skip Montanaro wrote: > > numberOfVertices = int(infile.readline().decode()) # Read the first line > > from the file > > > AttributeError: 'str' object has no attribute 'readline' > > ... > > > infile = filedialog.askopenfilename() > > > > Thi

Re: AttributeError Problem

2013-04-23 Thread Skip Montanaro
> numberOfVertices = int(infile.readline().decode()) # Read the first line from > the file > AttributeError: 'str' object has no attribute 'readline' ... > infile = filedialog.askopenfilename() This is just returning a filename. You need to open it to get a file object. For example: in

Re: AttributeError Problem

2013-04-23 Thread animemaiden
On Tuesday, April 23, 2013 7:41:27 PM UTC-4, animemaiden wrote: > Hi, > > > > I'm trying to display a graph in Tkinter that reads a graph from a file and > displays it on a panel which the first line in the file contains a number > that indicates the number of vertices (n). The vertices are l

Re: AttributeError: ' ' object has no attribute ' '

2013-02-23 Thread matt . doolittle33
yeah im not a programmer, i have not wrote anything here that i am trying to use; i am an end user. my only interest in this code is to get the program working. so i have to do what i have to do try to get it working. im just hoping that what im going through here, this error thats coming up

RE: AttributeError: ' ' object has no attribute ' '

2013-02-23 Thread Graham Fielding
> Date: Sat, 23 Feb 2013 10:22:54 -0800 > Subject: AttributeError: ' ' object has no attribute ' ' > From: matt.doolittl...@gmail.com > To: python-list@python.org > > I am using Ubuntu 12.10, and Python 2.7.3, GNU Radio Companion v3.6.3. I get > the this error in terminal: > > in __init_

Re: AttributeError: ' ' object has no attribute ' '

2013-02-23 Thread Chris Angelico
On Sun, Feb 24, 2013 at 5:22 AM, wrote: > I am using Ubuntu 12.10, and Python 2.7.3, GNU Radio Companion v3.6.3. I get > the this error in terminal: > > in __init__ > self.wxgui_waterfallsink2_0.set_callback(wxgui_waterfallsink2_0_callback) > File "/usr/local/lib/python2.7/dist-packages/

Re: AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback'

2013-02-14 Thread Albert Hopkins
On Thu, Feb 14, 2013, at 04:39 PM, Dave Angel wrote: [... snip] > For those of us using text-based email, the program in this message is > totally unreadable. This is a text mailing-list, so please put your > email program in text mode, or you'll lose much of your audience. For those of us n

Re: AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback'

2013-02-14 Thread Dave Angel
On 02/14/2013 04:16 PM, md...@nycap.rr.com wrote: I am using ubuntu 12.10 and python version 2.7.3. i run the following command in terminal: def connect(self, *points): """ Connect two or more block endpoints. An endpoint is either a (block, port) tuple or a block instance. In the latter

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-14 Thread Steven D'Aprano
On Fri, 14 Sep 2012 08:01:11 -0700, 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. Forget about a "list of explanations of error message[s]". There

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-14 Thread Chris Angelico
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

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-14 Thread Token Type
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

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-10 Thread Jean-Michel Pichavant
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

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Roy Smith
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

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Roy Smith
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

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Token Type
> 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

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Token Type
> 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

Re: AttributeError: 'list' object has no attribute 'lower'

2012-09-09 Thread Token Type
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

  1   2   >