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
>
> 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
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
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>
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
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
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
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
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
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
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
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
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
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
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
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
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
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_
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
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
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:
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
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
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
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,
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
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
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
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
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\
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
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
"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
>
"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
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
> 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
[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
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
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
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
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
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
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
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
"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.
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
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
47 matches
Mail list logo