Python Forum
How to move a class to a custom module?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to move a class to a custom module?
#2
I am confused. In our test you used the global variable "i" and you incremented it like htis:
i += 1; logger.info("I am INFO 0")
In log_format.py you changed "i" to an instance variable and you stop incrementing it.

Why do you expect "i" to change if you don't change it? Somewhere you will need an obj.i += 1 where obj is an instance of ContextFilter/
Reply


Messages In This Thread
RE: How to move a class to a custom module? - by deanhystad - Feb-28-2022, 04:42 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to read module/class from list of strings? popular_dog 1 567 Oct-04-2023, 03:08 PM
Last Post: deanhystad
  My code displays too much output when importing class from a module lil_e 4 1,291 Oct-22-2022, 12:56 AM
Last Post: Larz60+
  Error when refering to class defined in 'main' in an imported module HeRo 2 2,504 Apr-13-2021, 07:22 PM
Last Post: HeRo
  Custom file class deanhystad 11 4,624 Feb-01-2021, 05:09 PM
Last Post: nilamo
  importing same python library in multiple custom module escape_freedom13 6 3,993 May-10-2020, 07:01 PM
Last Post: escape_freedom13
  How to serialize custom class objects in JSON? Exsul1 4 3,600 Sep-23-2019, 08:27 AM
Last Post: wavic
  How can I save a class as a module sakawaka 2 5,106 Feb-07-2018, 03:01 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020