f



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

------=_Part_1122770_31157900.1360876583037
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit


I am using ubuntu 12.10 and python version 2.7.3. i run the following command in terminal:

matt@matt-Inspiron-1525:~$ python -m trace --count -C . op25_grc.py

Here is the output with an error:

Imported legacy fsk4
Using Volk machine: ssse3_32
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/lib/python2.7/trace.py", line 819, in <module>
main()
File "/usr/lib/python2.7/trace.py", line 807, in main
t.runctx(code, globs, globs)
File "/usr/lib/python2.7/trace.py", line 513, in runctx
exec cmd in globals, locals
File "op25_grc.py", line 493, in <module>
tb = op25_grc()
File "op25_grc.py", line 231, in __init__
self.wxgui_fftsink2_0_0.set_callback(wxgui_fftsink2_0_0_callback)
File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py", line 54, in __getattr__
return getattr(self._hb, name)
AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback'

here is the code for "hier_block2_.py":

# Copyright 2006,2007 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
#
# GNU Radio is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# GNU Radio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with GNU Radio; see the file COPYING. If not, write to
# the Free Software Foundation, Inc., 51 Franklin Street,
# Boston, MA 02110-1301, USA.
#

from gnuradio_core import hier_block2_swig
try:
import pmt
except ImportError:
from gruel import pmt

#
# This hack forces a 'has-a' relationship to look like an 'is-a' one.
#
# It allows Python classes to subclass this one, while passing through
# method calls to the C++ class shared pointer from SWIG.
#
# It also allows us to intercept method calls if needed
#
class hier_block2(object):
"""
Python wrapper around the C++ hierarchical block implementation.
Provides convenience functions and allows proper Python subclassing.
"""

def __init__(self, name, input_signature, output_signature):
"""
Create a hierarchical block with a given name and I/O signatures.
"""
self._hb = hier_block2_swig(name, input_signature, output_signature)

def __getattr__(self, name):
"""
Pass-through member requests to the C++ object.
"""
if not hasattr(self, "_hb"):
raise RuntimeError("hier_block2: invalid state--did you forget to
call gr.hier_block2.__init__ in a derived class?")
return getattr(self._hb, name)

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 case, the port number is
assumed
to be zero.

To connect the hierarchical block external inputs or outputs to internal
block
inputs or outputs, use 'self' in the connect call.

If multiple arguments are provided, connect will attempt to wire them in
series,
interpreting the endpoints as inputs or outputs as appropriate.
"""

if len (points) < 1:
raise ValueError, ("connect requires at least one endpoint; %d
provided." % (len (points),))
else:
if len(points) == 1:
self._hb.primitive_connect(points[0].to_basic_block())
else:
for i in range (1, len (points)):
self._connect(points[i-1], points[i])

def _connect(self, src, dst):
(src_block, src_port) = self._coerce_endpoint(src)
(dst_block, dst_port) = self._coerce_endpoint(dst)
self._hb.primitive_connect(src_block.to_basic_block(), src_port,
dst_block.to_basic_block(), dst_port)

def _coerce_endpoint(self, endp):
if hasattr(endp, 'to_basic_block'):
return (endp, 0)
else:
if hasattr(endp, "__getitem__") and len(endp) == 2:
return endp # Assume user put (block, port)
else:
raise ValueError("unable to coerce endpoint")

def disconnect(self, *points):
"""
Disconnect two endpoints in the flowgraph.

To disconnect the hierarchical block external inputs or outputs to
internal block
inputs or outputs, use 'self' in the connect call.

If more than two arguments are provided, they are disconnected
successively.
"""

if len (points) < 1:
raise ValueError, ("disconnect requires at least one endpoint; %d
provided." % (len (points),))
else:
if len (points) == 1:
self._hb.primitive_disconnect(points[0].to_basic_block())
else:
for i in range (1, len (points)):
self._disconnect(points[i-1], points[i])

def _disconnect(self, src, dst):
(src_block, src_port) = self._coerce_endpoint(src)
(dst_block, dst_port) = self._coerce_endpoint(dst)
self._hb.primitive_disconnect(src_block.to_basic_block(), src_port,
dst_block.to_basic_block(), dst_port)

def msg_connect(self, src, srcport, dst, dstport):
self.primitive_msg_connect(src.to_basic_block(), srcport,
dst.to_basic_block(), dstport);

def msg_disconnect(self, src, srcport, dst, dstport):
self.primitive_msg_disconnect(src.to_basic_block(), srcport,
dst.to_basic_block(), dstport);

def message_port_register_hier_in(self, portname):
self.primitive_message_port_register_hier_in(pmt.pmt_intern(portname));

def message_port_register_hier_out(self, portname):
self.primitive_message_port_register_hier_out(pmt.pmt_intern(portname));

i have been unable to find any sort of solution to this problem anywhere. Any help will be greatly appreciated.
Thank you very much!
--------------------------------------------------------------------------------
------=_Part_1122770_31157900.1360876583037
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit

<html>
  <head>
    <style type="text/css">
      <!--
        nobr { white-space: nowrap }
        ol { margin-right-rtl: 50; list-style-type: decimal; margin-bottom: 10; margin-left-ltr: 50; margin-top: 10 }
        u { text-decoration: underline }
        s { text-decoration: line-through }
        p { margin-top: 15 }
        dd p { margin-left: 0; margin-bottom: 0; margin-top: 0 }
        ol li p { margin-bottom: 0; margin-top: 0 }
        address { color: blue; font-style: italic }
        i { font-style: italic }
        h6 { font-size: xx-small; margin-bottom: 10; font-weight: bold; margin-top: 10 }
        h5 { font-size: x-small; margin-bottom: 10; font-weight: bold; margin-top: 10 }
        h4 { font-size: small; margin-bottom: 10; font-weight: bold; margin-top: 10 }
        h3 { font-size: medium; margin-bottom: 10; font-weight: bold; margin-top: 10 }
        dir li p { margin-bottom: 0; margin-top: 0 }
        h2 { font-size: large; margin-bottom: 10; font-weight: bold; margin-top: 10 }
        b { font-weight: bold }
        h1 { font-size: x-large; margin-bottom: 10; font-weight: bold; margin-top: 10 }
        caption { caption-side: top; text-align: center }
        a { text-decoration: underline; color: blue }
        ul li ul li ul li { margin-left: 0; margin-right: 0; margin-bottom: 0; margin-top: 0 }
        menu { margin-right-rtl: 40; margin-bottom: 10; margin-left-ltr: 40; margin-top: 10 }
        menu li p { margin-bottom: 0; margin-top: 0 }
        sup { vertical-align: sup }
        body { font-family: Serif; font-size: 14pt; margin-left: 0; margin-right: 0; font-weight: normal; color: black }
        ul li ul li ul { margin-right-rtl: 25; list-style-type: square; margin-left-ltr: 25 }
        blockquote { margin-left: 35; margin-right: 35; margin-bottom: 5; margin-top: 5 }
        samp { font-family: Monospaced; font-size: small }
        cite { font-style: italic }
        sub { vertical-align: sub }
        em { font-style: italic }
        ul li p { margin-bottom: 0; margin-top: 0 }
        ul li ul li { margin-left: 0; margin-right: 0; margin-bottom: 0; margin-top: 0 }
        var { font-weight: bold; font-style: italic }
        table { border-color: Gray; border-style: outset }
        dfn { font-style: italic }
        menu li { margin-left: 0; margin-right: 0; margin-bottom: 0; margin-top: 0 }
        strong { font-weight: bold }
        ul { margin-right-rtl: 50; list-style-type: disc; margin-bottom: 10; margin-left-ltr: 50; margin-top: 10 }
        center { text-align: center }
        ul li ul { margin-right-rtl: 25; list-style-type: circle; margin-left-ltr: 25 }
        kbd { font-family: Monospaced; font-size: small }
        dir li { margin-left: 0; margin-right: 0; margin-bottom: 0; margin-top: 0 }
        ul li menu { margin-right-rtl: 25; list-style-type: circle; margin-left-ltr: 25 }
        dt { margin-bottom: 0; margin-top: 0 }
        ol li { margin-left: 0; margin-right: 0; margin-bottom: 0; margin-top: 0 }
        li p { margin-bottom: 0; margin-top: 0 }
        strike { text-decoration: line-through }
        dl { margin-left: 0; margin-bottom: 10; margin-top: 10 }
        tt { font-family: Monospaced }
        ul li { margin-left: 0; margin-right: 0; margin-bottom: 0; margin-top: 0 }
        dir { margin-right-rtl: 40; margin-bottom: 10; margin-left-ltr: 40; margin-top: 10 }
        tr { text-align: left }
        pre p { margin-top: 0 }
        dd { margin-right-rtl: 40; margin-bottom: 0; margin-left-ltr: 40; margin-top: 0 }
        th { border-color: Gray; padding-bottom: 3; font-weight: bold; padding-left: 3; border-style: inset; padding-right: 3; text-align: center; padding-top: 3 }
        pre { font-family: Monospaced; margin-bottom: 5; margin-top: 5 }
        td { border-color: Gray; padding-bottom: 3; padding-left: 3; border-style: inset; padding-right: 3; padding-top: 3 }
        td p { margin-top: 0 }
        code { font-family: Monospaced; font-size: small }
        small { font-size: x-small }
        big { font-size: x-large }
      -->
    </style>
    
  </head>
  <body>
    <div>
      <p>
        I am using ubuntu 12.10 and python version 2.7.3. i run the following 
        command in terminal:<br><br><b>matt@matt-Inspiron-1525:~$ python -m 
        trace --count -C . op25_grc.py</b><br><br>Here is the output with an 
        error:<br><br><b>Imported legacy fsk4<br>Using Volk machine: ssse3_32<br>Traceback 
        (most recent call last):<br>File &quot;/usr/lib/python2.7/runpy.py&quot;, line 
        162, in _run_module_as_main<br>&quot;__main__&quot;, fname, loader, pkg_name)<br>File 
        &quot;/usr/lib/python2.7/runpy.py&quot;, line 72, in _run_code<br>exec 
        code in run_globals<br>File &quot;/usr/lib/python2.7/trace.py&quot;, line 819, 
        in &lt;module&gt;<br>main()<br>File &quot;/usr/lib/python2.7/trace.py&quot;, 
        line 807, in main<br>t.runctx(code, globs, globs)<br>File 
        &quot;/usr/lib/python2.7/trace.py&quot;, line 513, in runctx<br>exec 
        cmd in globals, locals<br>File &quot;op25_grc.py&quot;, line 493, in &lt;module&gt;<br>tb 
        = op25_grc()<br>File &quot;op25_grc.py&quot;, line 231, in __init__<br>self.wxgui_fftsink2_0_0.set_callback(wxgui_fftsink2_0_0_callback)<br>File 
        &quot;/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py&quot;, 
        line 54, in __getattr__<br>return getattr(self._hb, name)<br>AttributeError: 
        'gr_hier_block2_sptr' object has no attribute 'set_callback'</b><br>
      </p>
      <p>
        here is the code for &quot;hier_block2_.py&quot;:<br><br><b># 
        Copyright 2006,2007 Free Software Foundation, Inc.<br>#<br># This file 
        is part of GNU Radio<br>#<br># GNU Radio is free software; you can 
        redistribute it and/or modify<br># it under the terms of the GNU 
        General Public License as published by<br># the Free Software 
        Foundation; either version 3, or (at your option)<br># any later 
        version.<br>#<br># GNU Radio is distributed in the hope that it will 
        be useful,<br># but WITHOUT ANY WARRANTY; without even the implied 
        warranty of<br># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
        See the<br># GNU General Public License for more details.<br>#<br># 
        You should have received a copy of the GNU General Public License<br># 
        along with GNU Radio; see the file COPYING. If not, write to<br># the 
        Free Software Foundation, Inc., 51 Franklin Street,<br># Boston, MA 
        02110-1301, USA.<br>#<br><br>from gnuradio_core import hier_block2_swig<br>try:<br>import 
        pmt<br>except ImportError:<br>from gruel import pmt<br><br>#<br># This 
        hack forces a 'has-a' relationship to look like an 'is-a' one.<br>#<br># 
        It allows Python classes to subclass this one, while passing through<br># 
        method calls to the C++ class shared pointer from SWIG.<br>#<br># It 
        also allows us to intercept method calls if needed<br>#<br>class 
        hier_block2(object):<br>&quot;&quot;&quot;<br>Python wrapper around 
        the C++ hierarchical block implementation.<br>Provides convenience 
        functions and allows proper Python subclassing.<br>&quot;&quot;&quot;<br><br>def 
        __init__(self, name, input_signature, output_signature):<br>&quot;&quot;&quot;<br>Create 
        a hierarchical block with a given name and I/O signatures.<br>&quot;&quot;&quot;<br>self._hb 
        = hier_block2_swig(name, input_signature, output_signature)<br><br>def 
        __getattr__(self, name):<br>&quot;&quot;&quot;<br>Pass-through member 
        requests to the C++ object.<br>&quot;&quot;&quot;<br>if not 
        hasattr(self, &quot;_hb&quot;):<br>raise RuntimeError(&quot;hier_block2: 
        invalid state--did you forget to<br>call gr.hier_block2.__init__ in a 
        derived class?&quot;)<br>return getattr(self._hb, name)<br><br>def 
        connect(self, *points):<br>&quot;&quot;&quot;<br>Connect two or more 
        block endpoints. An endpoint is either a (block,<br>port)<br>tuple or 
        a block instance. In the latter case, the port number is<br>assumed<br>to 
        be zero.<br><br>To connect the hierarchical block external inputs or 
        outputs to internal<br>block<br>inputs or outputs, use 'self' in the 
        connect call.<br><br>If multiple arguments are provided, connect will 
        attempt to wire them in<br>series,<br>interpreting the endpoints as 
        inputs or outputs as appropriate.<br>&quot;&quot;&quot;<br><br>if len 
        (points) &lt; 1:<br>raise ValueError, (&quot;connect requires at least one 
        endpoint; %d<br>provided.&quot; % (len (points),))<br>else:<br>if 
        len(points) == 1:<br>self._hb.primitive_connect(points[0].to_basic_block())<br>else:<br>for 
        i in range (1, len (points)):<br>self._connect(points[i-1], points[i])<br><br>def 
        _connect(self, src, dst):<br>(src_block, src_port) = 
        self._coerce_endpoint(src)<br>(dst_block, dst_port) = 
        self._coerce_endpoint(dst)<br>self._hb.primitive_connect(src_block.to_basic_block(), 
        src_port,<br>dst_block.to_basic_block(), dst_port)<br><br>def 
        _coerce_endpoint(self, endp):<br>if hasattr(endp, 'to_basic_block'):<br>return 
        (endp, 0)<br>else:<br>if hasattr(endp, &quot;__getitem__&quot;) and len(endp) == 
        2:<br>return endp # Assume user put (block, port)<br>else:<br>raise 
        ValueError(&quot;unable to coerce endpoint&quot;)<br><br>def 
        disconnect(self, *points):<br>&quot;&quot;&quot;<br>Disconnect two 
        endpoints in the flowgraph.<br><br>To disconnect the hierarchical 
        block external inputs or outputs to<br>internal block<br>inputs or 
        outputs, use 'self' in the connect call.<br><br>If more than two 
        arguments are provided, they are disconnected<br>successively.<br>&quot;&quot;&quot;<br><br>if 
        len (points) &lt; 1:<br>raise ValueError, (&quot;disconnect requires at 
        least one endpoint; %d<br>provided.&quot; % (len (points),))<br>else:<br>if 
        len (points) == 1:<br>self._hb.primitive_disconnect(points[0].to_basic_block())<br>else:<br>for 
        i in range (1, len (points)):<br>self._disconnect(points[i-1], 
        points[i])<br><br>def _disconnect(self, src, dst):<br>(src_block, 
        src_port) = self._coerce_endpoint(src)<br>(dst_block, dst_port) = 
        self._coerce_endpoint(dst)<br>self._hb.primitive_disconnect(src_block.to_basic_block(), 
        src_port,<br>dst_block.to_basic_block(), dst_port)<br><br>def 
        msg_connect(self, src, srcport, dst, dstport):<br>self.primitive_msg_connect(src.to_basic_block(), 
        srcport,<br>dst.to_basic_block(), dstport);<br><br>def 
        msg_disconnect(self, src, srcport, dst, dstport):<br>self.primitive_msg_disconnect(src.to_basic_block(), 
        srcport,<br>dst.to_basic_block(), dstport);<br><br>def 
        message_port_register_hier_in(self, portname):<br>self.primitive_message_port_register_hier_in(pmt.pmt_intern(portname));<br><br>def 
        message_port_register_hier_out(self, portname):<br>self.primitive_message_port_register_hier_out(pmt.pmt_intern(portname));<br></b><br>i 
        have been unable to find any sort of solution to this problem 
        anywhere. Any help will be greatly appreciated.<br>Thank you very much!<br>--------------------------------------------------------------------------------
      </p>
    </div>
  </body>
</html>

------=_Part_1122770_31157900.1360876583037--

0
md1231 (1)
2/14/2013 9:16:23 PM
comp.lang.python 77058 articles. 6 followers. Post Follow

0 Replies
731 Views

Similar Articles

[PageSpeed] 29

Reply:

Similar Artilces:

AttributeError: ' ' object has no attribute ' '
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/gnuradio/gr/hier_block2.py", line 54, in __getattr__ return getattr(self._hb, name) AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback' I have been getting this error in multiple programs. So what is stopping the program here? There is no Attribute .set_callback obviously. But where is this attribute missing from exactly and how do i put it where it should be? On Sun, Feb 24, 2013 at 5:22 AM, <matt.doolittle33@gmail.com> 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/gnuradio/gr/hier_block2.py", line 54, in __getattr__ > return getattr(self._hb, name) > AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback' > > I have been getting this error in multiple programs. So what is stopping the program here? There is no Attribute .set_callback obviously. But where is this attribute missing from exactly and how do i put it where it should be? That's what the trac...

'^=' and '~='?
Hello, What is the difference between '^=' and '~='? Thanks, Duckhye ...

AttributeError: 'Attributes' object has no attribute 'saveFile'
Not sure how to explain, but I'll try my best. I'm making a GUI with wxGlade. The GUI has windows that open when the "Next Page" button is pushed; the button also pickles the information that is input into the frame at the same time. The saveFile name is autocreated based on the data entered by the user in the first frame. Each frame that is created is a new class, e.g. the first frame that opens is "CharInfo", which opens the frame "Attributes". The pickling works for the first frame but doesn't work for the ones after. Apparently the saveFile at...

AttributeError: 'Or' object has no attribute 'as_independent'
Traceback (most recent call last): File "testcsv.py", line 17, in <module> 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, **flags) File "C:\Python27\lib\site-packages\sympy\solvers\solvers.py", line 1434, in _ solve_system i, d = _invert(g, *symbols) File "C:\Python27\lib\site-packages\sympy\solvers\solvers.py", line 2422, in _ invert indep, dep = lhs.as_independent(*symbols) AttributeError: 'Or' object has no attribute 'as_independent' Code: import csv as csv import os import numpy as np import sympy as sy #from sympy import solve, Poly, Eq, Function, exp from sympy import * from numpy import * from numpy.linalg import * from sympy.polys.polyfuncs import interpolate from sympy import Function, dsolve, Eq, Derivative, sin, cos from sympy.abc import x f = sy.Function('f') x = sy.Symbol("x") t = sy.Symbol("t") print(sy.solve([x^2+x+1-t, x^3+x^2-t], x)) print(sy.solve((x^2+x+1-t, x^3+x^2-t), x)) On 2/13/2014 4:03 AM, wilsonmonde@gmail.com wrote: > Traceback (most recent call last): > File "testcsv.py", line 17, in <module> > 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 ...

PyKota, Python: AttributeError: 'module' object has no attribute '_quote'
Hello everyone, I'm new to linux/suse, but I was given the task to install the print accounting software PyKota. Before that I never even touched a linux system, so I don't have any basic knowlegde at all! Up to now I was able to solve all problems with the help of google, but now I'm stuck. My problem: linux-6n5c:/usr/local/bin # pkusers --add john paul Creation... ERROR: PyKota v1.26_official ERROR: pkusers failed ERROR: Traceback (most recent call last): ERROR: File "/usr/local/bin/pkusers", line 442, in <module> ERROR: retco...

Exception running GNU module "op25_grc.py" : AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback'
I am using using ubuntu 12.10 i am trying to run a python block, namely OP2= 5, in GNU Radio Companion v3.6.3-35-g4435082f, which uses python version 2.= 7.3 for some reason although python3.2 is in the lib folder. I run the foll= owing trace command in terminal: ~$ python -m trace --count -C . op25_grc.py Here is the output with an error: Imported legacy fsk4 Using Volk machine: ssse3_32 Traceback (most recent call last): File "/usr/lib/python2.7/runpy.py", line 162, in run_module_as_main "_main__", fname, loader, pkg_name) File "/usr/lib/python2.7/runpy.py", line 72, in run_code exec code in run_globals File "/usr/lib/python2.7/trace.py", line 819, in main() File "/usr/lib/python2.7/trace.py", line 807, in main t.runctx(code, globs, globs) File "/usr/lib/python2.7/trace.py", line 513, in runctx exec cmd in globals, locals File "op25_grc.py", line 493, in tb =3D op25_grc() File "op25_grc.py", line 231, in __init_ self.wxgui_fftsink2_0_0.set_callback(wxgui_fftsink2_0_0_callback) File "/usr/local/lib/python2.7/dist-packages/gnuradio/gr/hier_block2.py", = line 54, in getattr return getattr(self._hb, name) AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callbac= k' The code for "op25_grc.py": #!/usr/bin/env python ################################################## # Gnuradio Python Flow ...

python+libxml2+scrapy AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER'
Hello. Has anybody already meet the problem like this? - AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER' When I run scrapy, I get File "/usr/local/lib/python2.7/site-packages/scrapy/selector/factories.py", line 14, in <module> libxml2.HTML_PARSE_NOERROR + \ AttributeError: 'module' object has no attribute 'HTML_PARSE_RECOVER' When I run python -c 'import libxml2; libxml2.HTML_PARSE_RECOVER' I get Traceback (most recent call last): File "<string>", line 1, in <module...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal''''''''''''''
Hello fellow programmers, I am trying to run an append/update query from code, a command button on a form initiates the queries. the format i am using is; _____________________________________________________ SELECT "criteria" FROM "criteria" WHERE "criteria" UPDATE/APPEND "field selections" RecordSource "qryExample" = above text strings" _______________________________________________________________________ When i am running a SELECT query in this manner it works fine with no problems, and accepts the values of specified linked for...

AttributeError: 'function' object has no attribute 'split'
PathList= string.split(FullPath, "/") is generating the above error message. when I run my script, but works just fine from the python command line! What gives? "Earl" <eee@nmt.edu> wrote in message news:11e5f362.0405060845.16fff0f8@posting.google.com... > PathList= string.split(FullPath, "/") is generating the above error > message. when I run my script, but works just fine from the python > command line! What gives? Somehow you've bound the name "string" to a function e.g. >>> def string(): .... return 'help' ...

AttributeError: 'module' object has no attribute 'urlopen'
Hey, I am trying to run the following example from diveintopython import urllib sock = urllib.urlopen("http://diveintopython.org/") htmlSource = sock.read() sock.close() print htmlSource I have Python 2.3.3 but when i run the above code I get the following error: raceback (most recent call last): File "urllib.py", line 1, in ? import urllib File "/home/shalen/programming/python/tutorials/py/urllib.py", line 2, in ? sock = urllib.urlopen("http://diveintopython.org/") AttributeError: 'module' object has no attribute 'urlopen' Anyone knows how to fix this and why I am getting this error? Thanks Dont ~ ~ ~ ~ __________________________________ Do you Yahoo!? Yahoo! Mail SpamGuard - Read only the mail you want. http://antispam.yahoo.com/tools dont bother wrote: > import urllib > sock = urllib.urlopen("http://diveintopython.org/") > htmlSource = sock.read() > sock.close() > print htmlSource > > I have Python 2.3.3 but when i run the above code I > get the following error: > > raceback (most recent call last): > File "urllib.py", line 1, in ? > import urllib > File > "/home/shalen/programming/python/tutorials/py/urllib.py", > line 2, in ? > sock = > urllib.urlopen("http://diveintopython.org/") > AttributeError: 'module' object has no attribute > 'urlopen' > This is a name cl...

AttributeError: 'module' object has no attribute 'letters'
what does this error mean? i am trying to use mark hammonds win32 package. Traceback (most recent call last): File "aui2.py", line 11, in <module> import win32com.client File "C:\Python25\lib\site-packages\win32com\client\__init__.py", line 12, in <module> import dynamic, gencache, pythoncom File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py", line 24, in <module> import build File "C:\Python25\lib\site-packages\win32com\client\build.py", line 507, in <module> valid_identifier_chars = string.le...

AttributeError: 'module' object has no attribute 'HTTPSHandler'
Hi I built and installed python 2.5 from source and when I do this: opener = urllib2.build_opener(SmartRedirectHandler(), DefaultErrorHandler(), urllib2.HTTPSHandler()) I get this error. AttributeError: 'module' object has no attribute 'HTTPSHandler' What should I do? ...

AttributeError: 'module' object has no attribute 'setdefaulttimeout'
I get those errors when I run: /usr/local/bin/SquidClamAV_Redirector.py -c /etc/squid/SquidClamAV_Redirector.conf ################## Traceback (most recent call last): File "/usr/local/bin/SquidClamAV_Redirector.py", line 573, in ? redirector = SquidClamAV_Redirector(config) File "/usr/local/bin/SquidClamAV_Redirector.py", line 145, in __init__ self.__start_urlhandler__() File "/usr/local/bin/SquidClamAV_Redirector.py", line 454, in __start_urlhandler__ urllib.socket.setdefaulttimeout(self.timeout) AttributeError: 'module' object has no attribute 'setdefaulttimeout' ################# the line that is the problem looks like this: ############# urllib.socket.setdefaulttimeout(self.timeout) ############# from the global sintax: ############## def __start_urlhandler__(self): """ create the urlhandler object """ # set timeout urllib.socket.setdefaulttimeout(self.timeout) self.urlhandler = urllib.URLopener() if self.proxy != {}: self.urlhandler.proxies = self.proxy self.urlhandler.addheaders = [('User-agent', ModuleName + ' ' + str(version))] ############## can you give me a hint with this matter? adrian wrote: > urllib.socket.setdefaulttimeout(self.timeout) > AttributeError: 'module' object has no attribute 'setdef...

AttributeError: 'module' object has no attribute 'pack'
Dear List, I have a freshly installed opensuse 11.2 and I am experiencing the following problem with the module "subprocess": sampsa@linux-912g:~> python Python 2.6 (r26:66714, Feb 3 2009, 20:52:03) [GCC 4.3.2 [gcc-4_3-branch revision 141291]] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import subprocess Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib/python2.6/subprocess.py", line 404, in <module> import p...

AttributeError: 'module' object has no attribute 'fork'
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 os.fork() == 0: child(pipeout) else: while True: line = os.read(pipein, 32) print('Parent %d got [%s] at %s' % (os.getpid(), line, time.time())) parent() Output: Traceback (most recent call last): File "C:/Python34/pipe1.py", line 17, in <module>...

AttributeError: 'module' object has no attribute '__path__'
I am using Jupyter notebooks, with Python 3.4. The error below references t= he Anaconda distribution package. This error occurred quite precipitously (= only 2 minutes before I was able to import the modules). I am using Windows= 7. My path in the console uses Python27. I also have python 34 as well. I = am not sure where to start modifying the path and fear that I will break my= initial setup. I welcome feedback on next steps. --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) ...

AttributeError: 'list' object has no attribute 'lower'
On page 77 of the book natural language processing with Python, we have such an exercise: The polysemy of a word is the number of senses it has. Using WordNet, we can determine that the noun doghas seven senses with len(wn.synsets('dog', 'n')). Compute the average polysemy 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 [synset.lemm...

AttributeError: 'tuple' object has no attribute 'encode'
Hi, I'm trying to build a SQL string sql = """INSERT INTO ag ('cid', 'ag', 'test') VALUES(%i, %s, %d)""", (cid, ag, self.data[parent][child]['results']['test']) It raises this error: AttributeError: 'tuple' object has no attribute 'encode' Some of the variables are unicode (test and ag) - is that what is causing this error? What do I need to do to make it work? Thanks! Erik On Apr 5, 10:31 am, "erikcw" <erikwickst...@gmail.com> wrote: > Hi, > > I'm trying to build a SQ...

'''''''''''''The Running Update/Append Queries Using VBA code Ordeal'''''''''''''' #2
Hi, Thanks for ur help there HJ. I know how to do the tasks you specified there. I would like for the update query to use field values from some of the fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, DateTo. My problem is that an append/update query can't find the values in the open Form (frmInvoices) when I specify them as; [Forms]![frmInvoices]![InvoiceNumber] a select query has no problem finding the field values on a form. please help. Aaron Hi Aaron, Could you post the entire code that you are having trouble with? Now it is not possible to see what goes wrong. HJ "Aaron" <aaron@rapid-motion.co.uk> wrote in message news:260d7f40.0408120245.2f3d01f8@posting.google.com... > Hi, > > Thanks for ur help there HJ. > > I know how to do the tasks you specified there. > > I would like for the update query to use field values from some of the > fields on the form (frmInvoices) such as InvoiceNumber, DateFrom, > DateTo. My problem is that an append/update query can't find the > values in the open Form (frmInvoices) when I specify them as; > > [Forms]![frmInvoices]![InvoiceNumber] > > a select query has no problem finding the field values on a form. > > please help. > > Aaron First off, if you are not always using all the parameters specified in your form, then you have to add parameters to your query on the fly. Also, you can't just do something like qdf.SQL = "SE...

if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.') Any shorter ?
Hi, there. =20 I'm just curious if it ever dawned on anybody how to abbreviate this line : if str_mo not in ('','.') and str_da not in ('','.') and str_yy not in ('','.')=20 =20 Igor Kurbeko Clinical Programmer Analyst 678 336 4328 ikurbeko@atherogenics.com =20 no brain no pain =20 how about: if not (str_mo in ('','.') or str_da in ('','.') or str_yy in ('','.')) OR if not (missing(str_mo) or missing(str_da) or missing(str_yy)) Eric On 22 Oct 03 21:13:37 GMT, ikurbeko@ATHER...

logging: AttributeError: 'module' object has no attribute 'getLogger'
Hi all: Being completely new to Python still (just about a week into it now) I tried to follow the Python 2.6.5 version documemtation aiming at setting up a logger as follows: <code> import logging global gPIBLogger class PIBLogger(object): ''' TODO: classdocs ''' def __init__(self, logFileName): ''' Constructor ''' self.logFileName = logFileName self.logger = logging.getLogger('PIBLogger') self.logger.setLevel(logging.DEBUG) handler = logging.handlers.RotatingFileHandler(self.logFileName, maxBytes=1000000, backupCount=9) self.logger.addHandler(handler) gPIBLogger = self.logger def main(): mylogger = PIBLogger('/tmp/pib.log') gPIBLogger.debug(' Hi ') if __name__ == "__main__": main() </code> When trying to execute main() I get: Traceback (most recent call last): File "/.../src/pib/logging.py", line 37, in <module> main() File "/.../src/pib/logging.py", line 33, in main mylogger = PIBLogger('/tmp/pib.log') File "/...src/pib/logging.py", line 23, in __init__ self.logger = logging.getLogger('PIBLogger') AttributeError: '...

M2Crypto: AttributeError: 'CSR' object has no attribute 'pkey'
Hello python-guys I am trying to build a python based certificate authority using m2crypto. I am quite new to python and I am asking myself why my code snippets below throw the following Traceback: $ python csr.py ....++++++++++++ ................++++++++++++ Traceback (most recent call last): File "csr.py", line 48, in <module> csr.create_cert_signing_request(pubkey, cert_name) File "csr.py", line 17, in create_cert_signing_request cert_request.set_pubkey(keypair) File "/usr/lib64/python2.6/site-packages/M2Crypto/X509.py", line 926, in set_...

A function with 'and' , 'not' , 'null' , 'car' and 'cdr'
What's this ? (defun enigma (x) (and (not (null x)) (or (null (car x)) (enigma (cdr x))))) "I suppose I should learn Lisp, but it seems so foreign." - Paul Graham, Nov 1983 On Wed, Oct 07 2015, CAI GENGYANG wrote: > What's this ? > > > (defun enigma (x) > (and (not (null x)) > (or (null (car x)) > (enigma (cdr x))))) Bad taste? It returns T if the list X contains nil as an element. It would be clearer to write (some #'null x). Helmut CAI GENGYANG ...

which is more 'pythonic' / 'better' ?
hi, there are 2 versions of a simple code. which is preferred? === if len(line) >= (n+1): text = line[n] else: text = 'nothing' === === try: text = line[n] except IndexError: text = 'nothing' === which is the one you would use? thanks, gabor gabor wrote: > hi, > > there are 2 versions of a simple code. > which is preferred? > > > === > if len(line) >= (n+1): > text = line[n] > else: > text = 'nothing' > === > > > === > try: > text = line[n] > except IndexError: > text = '...

Web resources about - AttributeError: 'gr_hier_block2_sptr' object has no attribute 'set_callback' - comp.lang.python

Resources last updated: 3/10/2016 8:37:36 AM