Python Forum
Class test : good way to split methods into several files
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Class test : good way to split methods into several files
#5
Not an expert, so maybe I don't understand the problem, but if I had lots of different functions I needed in various places, I would pack them in a module, say, mymodule.py

Then, import your module:

import mymodule as mm
After that, all the functions in mm are available to you. You can edit them, add new functions, or delete old ones.

x = mm.func1()
y = mm.func2()
Reply


Messages In This Thread
RE: Class test : good way to split methods into several files - by Pedroski55 - Jan-30-2024, 11:46 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Good class design - with a Snake game as an example bear 1 1,877 Jan-24-2024, 08:36 AM
Last Post: annakenna
  [split] Class takes no arguments bily071 2 674 Oct-23-2023, 03:59 PM
Last Post: deanhystad
  Structuring a large class: privite vs public methods 6hearts 3 1,126 May-05-2023, 10:06 AM
Last Post: Gribouillis
  Split Bytearray into separate Files by Hex delimter lastyle 5 2,758 Mar-09-2023, 07:49 AM
Last Post: bowlofred
  unittest generates multiple files for each of my test case, how do I change to 1 file zsousa 0 985 Feb-15-2023, 05:34 PM
Last Post: zsousa
Question Take user input and split files using 7z in python askfriends 2 1,148 Dec-11-2022, 07:39 PM
Last Post: snippsat
  access share attributed among several class methods drSlump 0 1,082 Nov-18-2021, 03:02 PM
Last Post: drSlump
  a function common to methods of a class Skaperen 7 2,685 Oct-04-2021, 07:07 PM
Last Post: Skaperen
  How to test and import a model form computer to test accuracy using Sklearn library Anldra12 6 3,205 Jul-03-2021, 10:07 AM
Last Post: Anldra12
  How do I split a dataset into test/train/validation according to a particular group? 69195Student 1 2,310 May-12-2021, 08:27 PM
Last Post: bowlofred

Forum Jump:

User Panel Messages

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