About 52 results
Open links in new tab
  1. struct - C-like structures in Python - Stack Overflow

    Aug 30, 2008 · Is there a way to conveniently define a C-like structure in Python? I'm tired of writing stuff like:

  2. python - What is the best way to structure a Tkinter application ...

    Jul 4, 2013 · The following is the overall structure of my typical Python Tkinter program.

  3. Python code structure for class organization - Stack Overflow

    Feb 1, 2019 · Python classes provide all the standard features of Object Oriented Programming: the class inheritance mechanism allows multiple base classes, a derived class can override any methods …

  4. Representing graphs (data structure) in Python - Stack Overflow

    Oct 20, 2013 · From Python built-in data types point-of-view, any value contained elsewhere is expressed as a (hidden) reference to the target object. If it is a variable (i.e. named reference), then …

  5. python - wrapping ctypes.Structure inside a class - Stack Overflow

    Oct 29, 2024 · I want to be able to pass a structure to some c-code and am using ctypes.structure. I have a simple working example that takes an input array and squares the elements and outputs as …

  6. class - Python module structure for classes - Stack Overflow

    Feb 11, 2021 · In my opinion, importing all the classes you want to expose from the subpackage classes inside its __init__.py is the way to go. In fact, that's what many top-tier Python libraries/frameworks …

  7. python - How to print instances of a class using print ... - Stack Overflow

    A simple decorator @add_objprint will help you add the __str__ method to your class and you can use print for the instance. Of course if you like, you can also use objprint function from the library to print …

  8. Visualize the structure of a Python module - Stack Overflow

    Jan 20, 2017 · Is there tool out there which can be used to graphically represent the structure of a python module? I'm thinking that a graph of sub-modules and classes connected by arrows …

  9. python - Importing files from different folder - Stack Overflow

    I have this folder structure: application ├── app │ └── folder │ └── file.py └── app2 └── some_folder └── some_file.py How can I import a function from file.py, from within som...

  10. How do I declare custom exceptions in modern Python?

    How do I declare custom exception classes in modern Python? My primary goal is to follow whatever standard other exception classes have, so that (for instance) any extra string I include in the exc...