Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Defining functions
#1
Hi,

I'm just learning Python and trying to understand best practices

When defining functions for an app, is it right to define all of the functions in a single file? So if i have an app called myapp.py and within this file, I define loads of functions or is there a better way to kinda define the functions outside of the myapp.py file and reference the functions using .\ or something?

Thanks

Tommy
Reply
#2
Hey, your just starting , don't over complicate things at this point, keep it simple, just use a single file, at a later point you may feel the need to split out some of the functions that you want to re use in other projects.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Defining Functions theturtleking 4 2,818 Dec-07-2021, 06:45 PM
Last Post: deanhystad
Question trouble with functions "def", calling/defining them Duck_Boom 13 4,383 Oct-21-2020, 03:50 AM
Last Post: Duck_Boom
  Defining multiple functions in the same def process sparkt 5 2,832 Aug-09-2020, 06:19 PM
Last Post: sparkt

Forum Jump:

User Panel Messages

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