Attribute error for NoneType

2017-09-18 Thread kimvais
Hi, A common source of confusion for newbies is the `AttributeError: NoneType has no attribute ...` Also, one of my pet peeves for violating EAFP is the common `if something is not None:` ... Both of these could be "fixed" by having a new exception (that subclasses AttributeError) e.g. `IsNon

Re: sqlite 3 attribute error __exit__

2016-05-15 Thread Sayth Renshaw
> > As you've written it, the statement declares your intent to enter both > ‘conn’ and ‘conn.cursor()’ as context managers. > > https://docs.python.org/3/reference/compound_stmts.html#with> > > To “enter a context manager” entails calling the ‘__enter__’ method on > the context manager obje

Re: sqlite 3 attribute error __exit__

2016-05-15 Thread Sayth Renshaw
On Monday, 16 May 2016 12:45:26 UTC+10, DFS wrote: > On 5/15/2016 10:21 PM, Sayth Renshaw wrote: > > Hi > > > > I have a file and want to create the sqlite3 db. Using with however i > > receive an attribute error and it causes an exit. > > > > The relevant

Re: sqlite 3 attribute error __exit__

2016-05-15 Thread Ben Finney
Sayth Renshaw writes: > with conn, conn.cursor() as cur: What are you expecting this ‘with’ statement to do? As you've written it, the statement declares your intent to enter both ‘conn’ and ‘conn.cursor()’ as context managers. https://docs.python.org/3/reference/compound_stmts.html#with>

sqlite 3 attribute error __exit__

2016-05-15 Thread Sayth Renshaw
Hi I have a file and want to create the sqlite3 db. Using with however i receive an attribute error and it causes an exit. The relevant section of the file is: import sqlite3 conn = sqlite3.connect("trial.db") with conn, conn.cursor() as cur: # First, create tables. c

Re: Attribute error

2015-01-18 Thread Rustom Mody
On Monday, January 19, 2015 at 5:02:01 AM UTC+5:30, Steven D'Aprano wrote: > Mahendra Prajapati wrote: > > > Hello, > > I'm facing this problem with python class, while practising the python > > programming language.It creates an attribute error. I use windows 7

Re: Attribute error

2015-01-18 Thread Steven D'Aprano
Mahendra Prajapati wrote: > Hello, > I'm facing this problem with python class, while practising the python > programming language.It creates an attribute error. I use windows 7 OS. i > don't why.I just need to know why it gives such an error.please let me > know. Regards

Re: Attribute error

2015-01-18 Thread Denis McMahon
On Sun, 18 Jan 2015 20:50:49 +, Mahendra Prajapati wrote: > Hello, > I'm facing this problem with python class, while practising the python > programming language.It creates an attribute error. I use windows 7 OS. > i don't why.I just need to know why it gives such

Re: Attribute error

2015-01-18 Thread Chris Angelico
On Mon, Jan 19, 2015 at 7:50 AM, Mahendra Prajapati wrote: > I'm facing this problem with python class, while practising the python > programming language.It creates an attribute error. > I use windows 7 OS. i don't why. > I just need to know why it gives such an error

Attribute error

2015-01-18 Thread Mahendra Prajapati
Hello, I'm facing this problem with python class, while practising the python programming language.It creates an attribute error. I use windows 7 OS. i don't why.I just need to know why it gives such an error.please let me know. Regards -- https://mail.python.org/mailman/listinfo/python-list

Re: Can't figure out 'instance has no attribute' error

2014-05-18 Thread Chris Angelico
On Mon, May 19, 2014 at 5:02 AM, wrote: > Thank you very much Ned, Rodri and Gary. I changed the settings of gedit text > editor as mentioned in the Zed Shaw tutorial. I think this is causing me the > problem. I'll follow your advice. > I find that there are better editors than gedit. My perso

Re: Can't figure out 'instance has no attribute' error

2014-05-18 Thread varun7rs
On Sunday, 18 May 2014 01:56:42 UTC+2, varu...@gmail.com wrote: > Hello Friends, > > > > I am working on this code but I kind of get the same error over and over > again. Could any of you help me fix this part of the error? > > > > File RW1: > > class PHY_NETWORK: > > def __init__(sel

Re: Can't figure out 'instance has no attribute' error

2014-05-17 Thread Gary Herron
On 05/17/2014 04:56 PM, varun...@gmail.com wrote: Hello Friends, I am working on this code but I kind of get the same error over and over again. Could any of you help me fix this part of the error? It's an indentation error: In the following the three function defs for __init__, addNode and

Re: Can't figure out 'instance has no attribute' error

2014-05-17 Thread Rhodri James
On Sun, 18 May 2014 00:56:42 +0100, wrote: Hello Friends, I am working on this code but I kind of get the same error over and over again. Could any of you help me fix this part of the error? Shuffling your post around to make an explanation easier, the traceback is: srva@hades:~$ python

Re: Can't figure out 'instance has no attribute' error

2014-05-17 Thread Ned Batchelder
On 5/17/14 7:56 PM, varun...@gmail.com wrote: Hello Friends, I am working on this code but I kind of get the same error over and over again. Could any of you help me fix this part of the error? File RW1: class PHY_NETWORK: def __init__(self, nodes, edges): self.nodes = nodes

Can't figure out 'instance has no attribute' error

2014-05-17 Thread varun7rs
Hello Friends, I am working on this code but I kind of get the same error over and over again. Could any of you help me fix this part of the error? File RW1: class PHY_NETWORK: def __init__(self, nodes, edges): self.nodes = nodes self.edges = edges def addN

Re: Attribute error while executing python script

2014-04-16 Thread Chris Angelico
On Wed, Apr 16, 2014 at 5:45 PM, ali hanif wrote: > Hi i am a student and working on GNU..I have a python code which i want to > run in GNU radio companion but i am unable to search for the right block to > execute that code...can anyone help me with that??When I execute the same > python code(not

Attribute error while executing python script

2014-04-16 Thread ali hanif
Hi i am a student and working on GNU..I have a python code which i want to run in GNU radio companion but i am unable to search for the right block to execute that code...can anyone help me with that??When I execute the same python code(not in GNU), I get the following error: AttributeError: 'top_

Attribute Error in xml.sax.saxutils.XMLGenerator on Arch Linux (64bit)

2011-06-29 Thread Andreas Hasenkopf
Hi there, after switching from Ubuntu to Arch Linux I noticed a disturbing problem in a Python script I wrote (see http://sourceforge.net/projects/emcdutilityprog/files/). Using Windows (Python 2.6) and Ubuntu 11.04 (Python 2.7) I did not experience any problems. Using Arch Linux (Python 2.7) I got

Re: Attribute error-- but I'm innocent(?)

2009-03-03 Thread Denis Kasak
On Tue, Mar 3, 2009 at 6:13 AM, Dennis Lee Bieber wrote: > On Mon, 2 Mar 2009 16:56:58 -0800 (PST), Nick Mellor > declaimed the following in >> >>     def __init(self): >>         self.forename = RandomName("h:\\Testing\\NameDb\ >> \Forenames.csv", namefield = "Forename") > >        Where is "Ran

Re: Attribute error-- but I'm innocent(?)

2009-03-02 Thread Nick Mellor
Thanks Chris and John, all workin now. Sorry about proclamation of innocence-- fruitless morning and 3 hours sleep :-) Nick On Mar 3, 12:03 pm, Chris Rebert wrote: > On Mon, Mar 2, 2009 at 4:56 PM, Nick Mellor > > > > wrote: > > Hi all, > > > I'm pretty sure I'm following all the Python rules:

Re: Attribute error-- but I'm innocent(?)

2009-03-02 Thread John Machin
On Mar 3, 11:56 am, Nick Mellor wrote: > Hi all, > > I'm pretty sure I'm following all the Python rules: I've put "self" > before "forename" to make sure it's treated as a data attribute > (instance variable.) And from within a class, I'm told, you need to > prefix the var with self too. RandomNam

Re: Attribute error-- but I'm innocent(?)

2009-03-02 Thread Chris Rebert
On Mon, Mar 2, 2009 at 4:56 PM, Nick Mellor wrote: > Hi all, > > I'm pretty sure I'm following all the Python rules: I've put "self" > before "forename" to make sure it's treated as a data attribute > (instance variable.) And from within a class, I'm told, you need to > prefix the var with self to

Attribute error-- but I'm innocent(?)

2009-03-02 Thread Nick Mellor
Hi all, I'm pretty sure I'm following all the Python rules: I've put "self" before "forename" to make sure it's treated as a data attribute (instance variable.) And from within a class, I'm told, you need to prefix the var with self too. RandomName is a class that I've tested (and which still work

Re: HELP - Attribute Error, no matter what I do on PAMIE...

2008-07-31 Thread alex23
On Aug 1, 1:00 am, frankrentef <[EMAIL PROTECTED]> wrote: > Greetings all. I'm new to PAMIE and I've watched / followed to PAMIE > videos on Show me Do. I've tried to duplicate the "scriptWrite" > function in an attempt to automate the forms process... without > success. I haven't seen the video,

HELP - Attribute Error, no matter what I do on PAMIE...

2008-07-31 Thread frankrentef
Greetings all. I'm new to PAMIE and I've watched / followed to PAMIE videos on Show me Do. I've tried to duplicate the "scriptWrite" function in an attempt to automate the forms process... without success. Can someone PLEASE Assist!? I'm using the following code from cPAMIE import PAMIE #I

Re: Python C Embedded ! Attribute Error

2007-07-20 Thread Miki
Hello, > I am using the below C code so that i can embed a Python Code and > get input from a python function and use it in C code . > > Below is the C Code [snipped] > I am getting error > > AttributeError: 'module' object has no attribute 'print' > Cannot find function "print" How do

Python C Embedded ! Attribute Error

2007-07-20 Thread pycraze
Hi , I am using the below C code so that i can embed a Python Code and get input from a python function and use it in C code . Below is the C Code #include int main(int argc, char *argv[]) { PyObject *pName, *pModule, *pDict, *pFunc; PyObject *pArgs, *pValue; int i; if

Re: ATTRIBUTE ERROR: 'module' object has no attribute 'ssl'

2006-12-09 Thread John Machin
John Machin wrote: > johnny wrote: > > I am getting the following errors: > > That is *one* error. > > > > File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 679, in > > _send_output > > self.send(msg) > > File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 646, in send > > se

Re: ATTRIBUTE ERROR: 'module' object has no attribute 'ssl'

2006-12-09 Thread John Machin
johnny wrote: > I am getting the following errors: That is *one* error. > > File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 679, in > _send_output > self.send(msg) > File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 646, in send > self.connect() > File "H:\xampp\xampp\

ATTRIBUTE ERROR: 'module' object has no attribute 'ssl'

2006-12-09 Thread johnny
I am getting the following errors: File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 679, in _send_output self.send(msg) File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 646, in send self.connect() File "H:\xampp\xampp\xampp\python\lib\httplib.py", line 1073, in connect

Re: Attribute error

2006-10-16 Thread Teja
Max Erickson wrote: > "Teja" <[EMAIL PROTECTED]> wrote: > > > Hi all, > > > > What is attribute error? what causes that error, especially with COM > > objects? > > > > To be precise : > > > > Attribute Error: LCAS.La

Re: Attribute error

2006-10-14 Thread Max Erickson
"Teja" <[EMAIL PROTECTED]> wrote: > Hi all, > > What is attribute error? what causes that error, especially with COM > objects? > > To be precise : > > Attribute Error: LCAS.LabcarController.writeLogWindow() > > Here, LCAS is a COM object >

Re: Attribute error

2006-10-14 Thread Ben Finney
"Teja" <[EMAIL PROTECTED]> writes: > What is attribute error? exception AttributeError Raised when an attribute reference or assignment fails. http://docs.python.org/lib/module-exceptions.html#l2h-103> > To be precise : Not precise enough, unfortunately. P

Attribute error

2006-10-13 Thread Teja
Hi all, What is attribute error? what causes that error, especially with COM objects? To be precise : Attribute Error: LCAS.LabcarController.writeLogWindow() Here, LCAS is a COM object Thanks Teja.P -- http://mail.python.org/mailman/listinfo/python-list

Re: attribute error using fnmatch

2006-06-05 Thread Fredrik Lundh
> did you verify that the code you posted really has the problem (it does > use the 'os' module which isn't important message.replace("important", "imported") -- http://mail.python.org/mailman/listinfo/python-list

Re: attribute error using fnmatch

2006-06-04 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > listof_files = [i for i in f if not fnmatch(os.path.join(r,i),pat) and > os.path.isfile(os.path.join(r,i))] > ... > .. > > I get this error: > File "C:\Python24\Lib\fnmatch.py", line 37, in fnmatch > pat = os.path.normcase(pat) > File "C:\Python24\lib\ntpath.py

attribute error using fnmatch

2006-06-04 Thread s99999999s2003
hi i have script like this: from fnmatch import fnmatch from glob import glob ... f = ['file1','file2','file3'] r = "d:\\somepath" pat = "*.bat" listof_files = [i for i in f if not fnmatch(os.path.join(r,i),pat) and os.path.isfile(os.path.join(r,i))] ... .. I get this error: File "C:\Pyth

Re: attribute error

2005-09-29 Thread Steven D'Aprano
On Thu, 29 Sep 2005 15:57:47 -0400, M.N.A.Smadi wrote: > This has nothing to do with how the argument is passed. It is prob > something wrong with str.pop in my python because when i run python and type > import os > import string > x = '1 2 3' > x.pop() > > i get the following error > Tracebac

Re: attribute error

2005-09-29 Thread Steve Holden
Mike Meyer wrote: > In <[EMAIL PROTECTED]>, M.N.A.Smadi <[EMAIL PROTECTED]> typed: > >>This has nothing to do with how the argument is passed. It is prob >>something wrong with str.pop in my python because when i run python and type >>import os >>import string >>x = '1 2 3' >>x.pop() >> >>i get

Re: attribute error

2005-09-29 Thread Mike Meyer
In <[EMAIL PROTECTED]>, M.N.A.Smadi <[EMAIL PROTECTED]> typed: > This has nothing to do with how the argument is passed. It is prob > something wrong with str.pop in my python because when i run python and type > import os > import string > x = '1 2 3' > x.pop() > > i get the following error > T

Re: attribute error

2005-09-29 Thread M.N.A.Smadi
This has nothing to do with how the argument is passed. It is prob something wrong with str.pop in my python because when i run python and type import os import string x = '1 2 3' x.pop() i get the following error Traceback (most recent call last): File "", line 1, in ? AttributeError: 'str' o

Re: attribute error

2005-09-29 Thread Mike Meyer
In <[EMAIL PROTECTED]>, M.N.A.Smadi <[EMAIL PROTECTED]> typed: > HI; > > I am having the following error: > > AttributeError: 'str' object has no attribute 'pop' > > am using Python 2.3.4 and am importing the following libraries: > > import sys, os, inspect > from Asterisk import Manager, Base

Re: attribute error

2005-09-29 Thread M.N.A.Smadi
HI; I am having the following error: AttributeError: 'str' object has no attribute 'pop' am using Python 2.3.4 and am importing the following libraries: import sys, os, inspect from Asterisk import Manager, BaseException, Config import Asterisk.Util The code being executed is: if command

Re: attribute error

2005-09-26 Thread Mike Meyer
"M.N.A.Smadi" <[EMAIL PROTECTED]> writes: > 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.

Re: attribute error

2005-09-26 Thread Steven D'Aprano
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 th

attribute error

2005-09-26 Thread M.N.A.Smadi
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' am us