Your NewsFeed
class instance n
doesn’t have a Canvas
attribute. If you want to pass the Canvas
defined in your Achtergrond
class instance hoofdscherm
to n
, you can define it under the class definition for NewsFeed
using __init__()
:
class NewsFeed (): def __init__(self, canvas): self.canvas = canvas ...
Then when you initialize your NewsFeed
object as n
, you can pass the Canvas
instance from your Achtergrond
class instance hoofdscherm
:
n = NewsFeed(hoofdscherm.canvas)
This is a solution to your current issue, but there are other errors in your code that you can see once you modify it.
Related Posts:
- How can I create an object and add attributes to it?
- Creating a static class with no instances
- How to print instances of a class using print()?
- Python dictionary from an object’s fields
- PermissionError: [Errno 13] Permission denied
- Saving and loading objects and using pickle
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- _tkinter.TclError: no display name and no $DISPLAY environment variable
- ImportError: No module named ‘Tkinter’
- Are static class variables possible in Python?
- How to pip or easy_install tkinter on Windows
- matplotlib error – no module named tkinter
- tkinter gui with progress bar
- filedialog, tkinter and opening files
- How can I create a dropdown menu from a List in Tkinter?
- How do I insert a JPEG image into a python Tkinter window?
- Does Python have “private” variables in classes?
- TypeError: generatecode() takes 0 positional arguments but 1 was given
- Tkinter understanding mainloop
- takes 1 positional argument but 2 were given
- How to pass arguments to a Button command in Tkinter?
- Tkinter scrollbar for frame
- Tkinter understanding mainloop
- matplotlib error – no module named tkinter
- Python calling method in class
- Difference between ‘cls’ and ‘self’ in Python classes?
- AttributeError: ‘datetime’ module has no attribute ‘strptime’
- How do you call an instance of a class in Python?
- List attributes of an object [duplicate]
- How to extend a class in python?
- How to implement a binary search tree in Python?
- How to use an image for the background in tkinter?
- How to update a plot in matplotlib?
- Using __add__ operator with multiple arguments in Python
- Function to close the window in Tkinter
- Python function overloading
- Windows- Pyinstaller Error “failed to execute script ” When App Clicked
- super() fails with error: TypeError “argument 1 must be type, not classobj” when parent does not inherit from object
- How do I determine the size of an object in Python?
- Using Tkinter in python to edit the title bar
- Difference between import tkinter as tk and from tkinter import
- Accessing a class’ member variables in Python?
- Disable / Enable Button in TKinter
- How to clear Tkinter Canvas?
- How to handle a Button click event
- tkinter gui layout using frames and grid
- Tkinter error: Couldn’t recognize data in image file
- Strange Exception in Tkinter callback
- How do I compile my Python 3 app to an .exe?
- How to change the order of DataFrame columns?
- What does %s mean in a python format string?
- ImportError: No module named ‘tensorflow.python’
- How to access environment variable values
- python numpy ValueError: operands could not be broadcast together with shapes
- error: command ‘gcc’ failed with exit status 1 while installing eventlet
- Python foreach equivalent
- Python NoneType object is not callable (beginner)
- What does if __name__ == “__main__”: do?
- How to fix IndexError: invalid index to scalar variable
- TypeError: cannot unpack non-iterable int objec
- Why are Python’s ‘private’ methods not actually private?
- Pandas DataFrame column to list
- Error: ” ‘dict’ object has no attribute ‘iteritems’ “
- Rename Pandas DataFrame Index
- TypeError(“‘bool’ object is not iterable”,) when trying to return a Boolean
- Flask Template Not found
- Making a collatz program automate the boring stuff
- Reverse / invert a dictionary mapping
- using pip3: module “importlib._bootstrap” has no attribute “SourceFileLoader”
- TypeError: unsupported operand type(s) for -: ‘list’ and ‘list’
- What’s the difference between a Python module and a Python package?
- SyntaxError invalid token
- TypeError: ‘type’ object is not iterable – Iterating over object instances
- How to check the version of scipy
- Viewing all defined variables
- Difference between two dates in Python
- ImportError: No module named win32com.client
- Error message “Linter pylint is not installed”
- How to create a numpy array of all True or all False?
- What is the quickest way to HTTP GET in Python?
- Pandas index column title or name
- Removing nan values from an array
- Python – While-Loop until list is empty
- ImportError: No module named xgboost
- How to properly create a HeatMap with Bokeh
- How to detect key presses?
- How do I merge lists in python? [duplicate]
- creating a reverse method for a python list from scratch
- What does on_delete do on Django models?
- Convert floats to ints in Pandas?
- Unable to import tweepy module
- pandas comparison raises TypeError: cannot compare a dtyped [float64] array with a scalar of type [bool]
- TypeError: got multiple values for argument
- How can I recover the return value of a function passed to multiprocessing.Process?
- Python Remove last char from string and return it
- NameError: name ‘reduce’ is not defined in Python
- numpy : calculate the derivative of the softmax function
- Difference between exit(0) and exit(1) in Python
- IOError: [Errno 32] Broken pipe when piping: `prog.py | othercmd`