5 Tips To Organize Python Code

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 มิ.ย. 2024
  • Welcome back to another video! In this video I am going to be sharing with you 5 tips on how you can better organize your code! Now keep in mind these are not going to be life changing, they are just meant to help make your code much more readable and easier to navigate! They are not going to deal with software design and software architecture, so I hope you enjoy and find this video helpful!
    💻 ProgrammingExpert is the best platform to learn how to code and become a software engineer as fast as possible! Check it out here: programmingexpert.io/tim and use code "tim" for a discount!
    📄 Resources 📄
    Tech With Tim GitHub: github.com/Tech-With-Tim
    Join the discord server! / discord
    ⭐️ Timestamps ⭐️
    00:00 | Introduction
    00:26 | #1 - Use Modules and Packages
    03:59 | #2 - One Class = One File
    05:15 | #3 - Group Related Functionality Together
    07:47 | #4 - Separate Utility & Helper Functions
    09:26 | #5 - Organize Imports
    ◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
    👕 Merchandise: teespring.com/stores/tech-wit...
    📸 Instagram: / tech_with_tim
    📱 Twitter: / techwithtimm
    ⭐ Discord: / discord
    📝 LinkedIn: / tim-ruscica-82631b179
    🌎 Website: techwithtim.net
    📂 GitHub: github.com/techwithtim
    🔊 Podcast: anchor.fm/tech-with-tim
    🎬 My TH-cam Gear: www.techwithtim.net/gear/
    💵 One-Time Donations: www.paypal.com/donate?hosted_...
    💰 Patreon: / techwithtim
    ◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️◼️
    ⭐️ Tags ⭐️
    -Tech With Tim
    -5 Tips to Organize Your Code
    -Organize Your Code
    -How to Organize Code
    -Python Code Organization
    ⭐️ Hashtags ⭐️
    #TechWithTim #TipsToOrganizeCode

ความคิดเห็น • 142

  • @wannabedev2452
    @wannabedev2452 2 ปีที่แล้ว +210

    I have outgrown the difficulty of what you teach but i still come back time to time because your content is what taught me most of what i know

    • @abdul-rehman-d
      @abdul-rehman-d 2 ปีที่แล้ว +1

      Same

    • @RandyWatson80
      @RandyWatson80 2 ปีที่แล้ว +4

      He’s literally the best and I hate to say literally

    • @nadalaban4188
      @nadalaban4188 2 ปีที่แล้ว +1

      😭👍 same here

    • @stanleydadaille
      @stanleydadaille ปีที่แล้ว

      Me too

    • @mddawid0323
      @mddawid0323 ปีที่แล้ว +1

      me three, its allways good to repeat the basics tho

  • @Richard_GIS
    @Richard_GIS 8 หลายเดือนก่อน +15

    The correct order for pep compliance is (see style guide 'Imports'):
    1: Standard library imports.
    2: Related third party imports.
    3: Local application/library specific imports.

    • @samymostefai7644
      @samymostefai7644 6 หลายเดือนก่อน +1

      you are correct

    • @live_destin-3408
      @live_destin-3408 10 วันที่ผ่านมา +2

      I’ve been doing this for so long without knowing it was an actual named standard. It’s just logical

  • @simoneisenschink5269
    @simoneisenschink5269 7 หลายเดือนก่อน +6

    Wow, this is exactly what i was searching for when improving in coding but didn't learn it from scratch just somewhere in between. Thank you so much!

  • @ppolleunus
    @ppolleunus 4 หลายเดือนก่อน +4

    It's not __init__.py that makes a package. It's even not required anymore in Python 3.x. It's just having a folder. Basically, package = folder and module = file.

  • @omlette9214
    @omlette9214 ปีที่แล้ว +2

    Just starting my journey here and I am enjoying this content from over the years. Great stuff Tim

  • @user-zz2ix4fw7z
    @user-zz2ix4fw7z ปีที่แล้ว +14

    Thank you for creating this video on organizing Python code. It may be useful to others who want to improve the readability and maintainability of their code. Here are the 5 key points of the video.
    1. Use modules and packages to better organize Python code.
    2. Place each class in an individual file using Pascal case.
    3. Group related functionality together in packages.
    4. Place all utilities in a single file or package.
    5. Organize import statements by third party, built-in, and local files.

    • @live_destin-3408
      @live_destin-3408 10 วันที่ผ่านมา

      It’s crazy how your comment sounds so much like chat gpt to me. I think I’ve been using gpt to much lately, because I’ve become paranoid that everything around me was written with the bot; when in reality, people are just having good grammar

  • @kirollssabri4651
    @kirollssabri4651 2 ปีที่แล้ว +13

    Every time i see a notification from your channel i feel so happy and excited to learn something new❤️

  • @v0nd3rB0y
    @v0nd3rB0y 2 ปีที่แล้ว +11

    About organize imports, pep8 recommend use 1. standard library imports
    , 2. related third party imports, 3. local application/library specific imports . Anyway great video Thanks!

    • @AndreaGhensi
      @AndreaGhensi 7 หลายเดือนก่อน +2

      And this can be achieved automatically with tools like isort or ruff (my linter of choice) + pre-commit git hooks

  • @fabianstargalla
    @fabianstargalla ปีที่แล้ว +15

    Slowly I start to understand how GitHub Projects work. I must say as a "advanced" beginner who has just finished learning native Python it's pretty intimidating to see such big Projects and not understanding a single thing even though I'm not actually struggling with the Python part but I guess that's a thing you have to get used to :D
    Great video Tim, thank you very much ❤

    • @sweatdog
      @sweatdog ปีที่แล้ว +1

      I'm in the same boat. Tail end of my python course, which includes an "advanced python" section. What intimidates me is all the ways to potentially do 1 thing. Seeing the varying syntax freaks me out. What helped is getting organized, thinking in algorithms, and accepting that the web will answer all my syntax questions easily.

  • @eliasebner3595
    @eliasebner3595 2 ปีที่แล้ว +6

    OMG, THIS WAS ACTUALLY SO USEFUL. Thanks a lot, really learned a lot.

  • @crazycat664
    @crazycat664 2 ปีที่แล้ว +3

    Feels like this guy knows everything I need to know in python

  • @futurism010
    @futurism010 2 ปีที่แล้ว

    No words to explain the contents you made! Just Amazing.

  • @kilocesar
    @kilocesar 2 หลายเดือนก่อน

    This vid was exactly what i need to finish my project, thank you so much!

  • @sobysonics
    @sobysonics 4 หลายเดือนก่อน +1

    1) use module and package: module is individual python file, package is directory with many python modules; package requires __init__.py - which makes folder the package; whatever is in init, it will be run
    2) one class in one file (may be exceptions)
    3) group related functionality together
    4) separate utility and helper functions
    5) organize import statements

  • @kosmonautofficial296
    @kosmonautofficial296 2 ปีที่แล้ว

    Great video thanks so much! I have been using modules but not local packages thanks!

  • @brianrichard903
    @brianrichard903 2 ปีที่แล้ว

    Hi Tim! great video , i enjoyed it and now i feel like i can easily take on python

  • @immortalsun
    @immortalsun 7 หลายเดือนก่อน

    Absolutely fantastic! Thank you :)

  • @leaoaugusto
    @leaoaugusto 2 ปีที่แล้ว

    Thank you Tim! God bless you!

  • @elisachin9330
    @elisachin9330 2 ปีที่แล้ว

    Nice offer and tips from this video, it has given me a sense of relief.

  • @jenjapa
    @jenjapa 2 ปีที่แล้ว

    Great video, very useful. Thanks.

  • @shingaling3315
    @shingaling3315 8 หลายเดือนก่อน +1

    Because of this guy, I learned how to organize my code 👌

  • @Blinknone
    @Blinknone ปีที่แล้ว

    Excellent tips.. thanks!

  • @sylvainprive1754
    @sylvainprive1754 3 หลายเดือนก่อน

    Great content, totally agree on pretty much everything.
    For Utils I would add a little thing: I usually recommend not to do it cause 1. junior dev would over use it and 2. It doesn’t help to know what’s inside. So for me, it is on very last option.

  • @krishj8011
    @krishj8011 4 หลายเดือนก่อน

    awesome content and is nicely presented. Thanks.

  • @gilbertjizz4811
    @gilbertjizz4811 2 ปีที่แล้ว +31

    One class per file makes your code very organized, I agree. However, if two classes are very related it is okay to put them together

    • @ThatOpinionIsWrong
      @ThatOpinionIsWrong ปีที่แล้ว +1

      I'd say if you have a hierarchy of classes (for example 2-3 classes that inherit from an abstract class) you should group them together in a single file, unless they're too large, but that probably means you are breaking a SRP rule

    • @eksortso
      @eksortso 6 หลายเดือนก่อน

      ​@@ThatOpinionIsWrongWhat would you say about class composition, then? If you have one class that is used strictly and extensively inside of a parent class, with no inheritance concerns involved, would it make sense to put the child class definition in the same file as its parent class definition?

    • @carnap355
      @carnap355 5 หลายเดือนก่อน

      Honestly if you can get away with one class per file you are not using OOP enough

  • @ToddVanyo
    @ToddVanyo 5 หลายเดือนก่อน

    You can have the import statements auto sorted by using the isort tool, which formats the imports consistently.
    Available as a formatter in multiple LSPs.

  • @ramneekkaur9645
    @ramneekkaur9645 2 ปีที่แล้ว +1

    Thanks Tim 👍🌟

  • @MeHdi.fz28
    @MeHdi.fz28 5 หลายเดือนก่อน

    thanks that was very helpful

  • @dareal738
    @dareal738 2 ปีที่แล้ว

    you post stuff as i search for it, why, ily so much

  • @AddisChess16985
    @AddisChess16985 2 ปีที่แล้ว

    Nice video, Tim!

  • @taylormayhew369
    @taylormayhew369 หลายเดือนก่อน +1

    You are the GOAT ❤

  • @arthuradriansens3291
    @arthuradriansens3291 2 ปีที่แล้ว +1

    Hi Tim, your videos are super helpful! Can I ask a question please: how can you enable execution time in vs code? Thanks!

    • @splashoui3760
      @splashoui3760 2 ปีที่แล้ว

      You can use time module in python and print the difference between end time and start time.

  • @Pankaj-Verma-
    @Pankaj-Verma- 5 หลายเดือนก่อน

    Thanks 👍

  • @reverseila4363
    @reverseila4363 ปีที่แล้ว

    Thanks!

  • @MrTien-yq6cj
    @MrTien-yq6cj 2 ปีที่แล้ว

    Love this

  • @brianferrell9454
    @brianferrell9454 2 ปีที่แล้ว

    needed this

  • @georgehammond867
    @georgehammond867 2 ปีที่แล้ว +2

    great tips. but would be great to do more on point #1 - Use Modules and Packages.

  • @balazsh2
    @balazsh2 2 ปีที่แล้ว +11

    I think "local imports last" should be a hard rule, in case you're overwriting built-in functions or classes you should never load built-in modules over it

  • @itssuperbaby2979
    @itssuperbaby2979 2 ปีที่แล้ว

    this is not related to your video but the cat in the intro was so cute :D

  • @thaimeuu
    @thaimeuu 5 หลายเดือนก่อน

    thank you

  • @melissaleigh3013
    @melissaleigh3013 2 ปีที่แล้ว

    Thanks

  • @philwebb59
    @philwebb59 4 หลายเดือนก่อน

    I like to do built-ins first, then third party, then local libraries. Then I do initializations and globals, like input_dir = "". I guess what's important is having a system.

  • @jgojiz
    @jgojiz 2 หลายเดือนก่อน

    If I'm inside a folder, wanting to call functions or classes from another folder, same project, how do I do that? Does this structure only work with main files not inside folders?

  • @sinaorojlo5980
    @sinaorojlo5980 9 หลายเดือนก่อน

    Its super niceee 🎉

  • @davideschreiber2821
    @davideschreiber2821 2 ปีที่แล้ว

    Here's one little compliment you might not have got before. I do think your tutorials are among the very best on TH-cam, but having seen some others, I am also very grateful you don't try to be cute or humorous or pumped with enthusiasm. I don't think humour comes easily to programmers (Socratica is an exception), and those who try it generally just sound lame. You give us the straight goods without making us squirm or groan. I really appreciate it.

  • @murphygreen8484
    @murphygreen8484 2 ปีที่แล้ว +1

    Hey, I was just searching for something like this. What are the chances?

  • @davidlu1003
    @davidlu1003 3 หลายเดือนก่อน

    Though I know this, I still think these tips are important, and I know these not from courses but from reading coding books. Thanks, for me, these are great helps too.😁😁😁

  • @zZMazeZz
    @zZMazeZz 2 ปีที่แล้ว +1

    great videos

  • @planktonsgaming8232
    @planktonsgaming8232 2 ปีที่แล้ว

    Your just legend

  • @expansivegymnast1020
    @expansivegymnast1020 ปีที่แล้ว

    THANK YOUUUUUUU! I am doing a Python project for college and this is exactly what I needed.

  • @elamandeep
    @elamandeep 2 ปีที่แล้ว +1

    Hey tim , please make video how to read programming document??

  • @zyhon881
    @zyhon881 ปีที่แล้ว

    Thank you very much. Very useful tips. Just subscribed to ProgrammingExpert.

  • @ewetoobie
    @ewetoobie 2 ปีที่แล้ว

    how would this change with pygame? imports & such seem more complicated, also pygame.init() seems to need to be in each module, etc. Any tips?

  • @schedarr
    @schedarr 2 ปีที่แล้ว +1

    what is this star in snowflake_time function definition?

  • @alicenogueira5972
    @alicenogueira5972 6 หลายเดือนก่อน

    I wanted to do a class for file in one package but all of them need to import one file and when I try to import the classes from outside the package it gives an error cause of the import

  • @funtocode5904
    @funtocode5904 2 ปีที่แล้ว

    GREAT VIDEO! btw small youtuber here!

  • @educateyourselfdaily3196
    @educateyourselfdaily3196 2 ปีที่แล้ว

    Hey Tim, will you 💞 know me which software you are using for video 📷 editing Please...

  • @cristinocanga
    @cristinocanga 2 ปีที่แล้ว

    Hey Tim, i just wanted to say that you didn't add the other videos to the intermediate python list
    Future topics:
    9. Collections: orderedDict
    10. Collections: defualtDict
    11. docstrings
    These are missing lol
    Big fan

    • @Brickkzz
      @Brickkzz 2 ปีที่แล้ว

      Isn't dict ordered in recent python versions?

  • @deeppatel_
    @deeppatel_ 3 หลายเดือนก่อน

    is ok to define all required function in single python file ?

  • @gJonii
    @gJonii 2 ปีที่แล้ว +5

    I find this "separate helper functions" to be an antipattern. Functions that are helpful to one module should be in that module. Functions that are helpful in multiple places are a sign that some module should be doing that task for you already. By these tips you're making it harder to write proper code.
    Same with "unrelated things together", it's an antipattern of making a mess.
    Also, one file = one class sounds almost right but it promotes OOP style thinking, which in itself is kind of an antipattern. I'm not really sure what's the best way to go about it myself, but my own rule of thumb is to chop things up into modules and files to provide a single concept to user of that module or file. It's almost the same, except, a class isn't that good approximation of a concept. You'd be basically falling for OOP trap by forcing your concepts into class-shaped boxes.

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 ปีที่แล้ว

      Functions that are useful in multiple places are a sign of effective code reuse.

    • @gJonii
      @gJonii ปีที่แล้ว

      @@lawrencedoliveiro9104 If the functions don't have clear domain where they operate in, it is to me the antipattern. If you can't name the common thing that all these parts of your program share, beside "helper", you're in a world of hurt if any of the parts coupled through "helper" change or want to be refactored, since there is no context for "helper" stuff to give you any expectations about which way things actually should be, why are things coupled, or even which things are coupled.
      It works if you get it right while you still had the entire program inside your head while making that. Anyone coming afterwards is going to be locked out of making any changes because aside from going through the program line by line to verify how the helpers are used, there's no way for you to know if any change is possible, reasonable, and what it will break.
      Contrast this with having helpers be tied to the module they're used in. You need to understand one module to make changes to helper functions. They're also now coming with context, since you don't need to name helpers, parameters, comments etc in a general non-specific manner, but rather you can have those helpers have very clear purpose in the context of the module. You making changes to helpers is now in terms of what makes sense in context, specifically for your module and the business logic surrounding it, and thus you also understand from changes what consequences it has.
      If you need same helper function in three different modules, I'd any day of the week that same helper function three times, once per module, and treat it as internal to each module.

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 ปีที่แล้ว

      @@gJonii Look at, for example, the built-in integer operations. Do they have a “clear domain where they operate in”? Or are they in fact widely used in a lot of different code?

    • @gJonii
      @gJonii ปีที่แล้ว

      @@lawrencedoliveiro9104 built-in integer operations? You have the domain in the name, it's integers. Them being used in projects is confusing developer of the built-in interface, and developers of python programs.

    • @lawrencedoliveiro9104
      @lawrencedoliveiro9104 ปีที่แล้ว

      @@gJonii So you feel Python shouldn’t have such operations, because you find them “confusing”?

  • @jomy10-games
    @jomy10-games 2 ปีที่แล้ว

    What VS Code theme do you use?

  • @alchenerd
    @alchenerd 2 ปีที่แล้ว

    So theoretically, malicious code can be be injected into __init__.py and do anything, like, say, append itself to all __init__.py on the host?

  • @bonkaiblue7906
    @bonkaiblue7906 2 หลายเดือนก่อน

    Cant you just put your imports in an import package called imports? then you have one import at the top if your main that calls all your imports? & they can be organized further in there.

  • @pawulo6953
    @pawulo6953 2 ปีที่แล้ว

    Could you make a video about cat role in the programmer's life?

  • @educateyourselfdaily3196
    @educateyourselfdaily3196 2 ปีที่แล้ว

    Hey Tim 👍

  • @HDelport8
    @HDelport8 2 ปีที่แล้ว +1

    I'd hate to break the 69 comments but,
    Tip one is a personal game changer that I should have learned in my years of full stack dev studies. I feel like I just learned a basic...

  • @mahshidheshmati3389
    @mahshidheshmati3389 ปีที่แล้ว

    Can you take a course for computer olympiad topics?🙏

  • @harveykyle3690
    @harveykyle3690 2 ปีที่แล้ว +1

    wow look at the cat on the intro :D

  • @aayushpatil7514
    @aayushpatil7514 2 ปีที่แล้ว

    Can you make one for golang? That would be helpful 😃

  • @comm_gt
    @comm_gt ปีที่แล้ว

    sophie the cat is adorable

  • @Betabdullah
    @Betabdullah 2 ปีที่แล้ว

    Allah razı olsun

  • @andressaldarriagajordan6526
    @andressaldarriagajordan6526 2 ปีที่แล้ว +5

    I prefer to use relative import (from [dot]package import this) as it makes more clear we are importing a local package and not, maybe, a standard library's module with the same name

    • @balazsh2
      @balazsh2 2 ปีที่แล้ว +1

      Relative imports can get messy though when you have to import files across your separate modules and have to pay attention to how many periods you write depending on how deep you are in your directory tree. Separating your standard library, third-party and local imports with newlines work just as well but keep the consistency of your code. Also it's bad practice to give your directories the same name as existing libraries, this is what directory naming conventions are for

  • @user-bh3uw3yx1u
    @user-bh3uw3yx1u 2 หลายเดือนก่อน

    WASHHHHHHHHHHHHHHHHHHH SOPHIE IS SO CUTE! 😻😻😻

  • @arjix8738
    @arjix8738 2 ปีที่แล้ว +1

    My import order is based on the length of the line, and in descending order

    • @spaghettiking653
      @spaghettiking653 ปีที่แล้ว

      Ooh interesting, I usually do it in ascending, and also with all "import" lines coming before all "from import ..." lines...

  • @ismaildalhatu308
    @ismaildalhatu308 2 ปีที่แล้ว +1

    Sophie out there! 🤦‍♂️😅

    • @ismaildalhatu308
      @ismaildalhatu308 2 ปีที่แล้ว

      @♜ Pinned by Tech With Tim ridiculous!

  • @user-sh8kh7sk8p
    @user-sh8kh7sk8p 4 หลายเดือนก่อน

    The "import" in "__init__" does not work as I've would expect it.
    If the statements in __init__ are run when we import the module, then I would expect that when we in `__init__` have `from forces import Forces` then we should be able to just used `Forces` right away in `main.py` and not have to import it first (since the "import" part is run in the "__init__").
    So, just to make sure I've understood it correctly; import in `__init__` does not actually import, but "moves" the imports to the main-module such that they can be imported directly from the main-module and not the submodule.

  • @therabidpancake1
    @therabidpancake1 9 หลายเดือนก่อน

    I need to learn to structure code properly .

  • @nowifi3266
    @nowifi3266 ปีที่แล้ว +1

    Do I have to import a module (such as Pygame) into each module/package __init__ file that I create myself?

  • @inspisiavideos8542
    @inspisiavideos8542 2 ปีที่แล้ว +2

    Tech With Tim I kept making a lot of projects on my portfolio about React, Python and APIs. I just got hired! My first job in tech and it’s ove $100K at an internet company. The thing is I won’t see any of the languages I worked hard to learn. If anything, at my job I will see some html and css and that’s it. Other than that, I’m looking at presentation for ads, review analytics with google analytics and make some calls to the employees working at the company’s stores about the updates. Don’t get me wrong. I’m happy I am making 117k but I sometimes think that if I don’t practice coding I might forget and who knows I might need it in the future. BTW I don’t want to go through interviews again. It was horrible many companies told me no and thank goodness this one told me yes because I was 2 months with no job down to my last $200 and finally I got in but I feel at the long run I might become lazy. What do you think? Do you think it’s probably good I don’t have to code too much?

    • @mrman880
      @mrman880 2 ปีที่แล้ว +1

      Definitely keep coding fresh in your head.

    • @neuron8186
      @neuron8186 2 ปีที่แล้ว +2

      i suggest try doing one leetcode question everyday or once in every 2-3 days because you have a job starting side project can be hectic also leetcode will help you in future if you ever thought of changing job

    • @inspisiavideos8542
      @inspisiavideos8542 2 ปีที่แล้ว +1

      @@neuron8186 Right now I’m still on training but they already told us what I’ll be doing. That’s the thing, my job is multiple things. It’s more like graphic designing, analytics, see code but only html and css and call people that work at the stores. But my title says Analytical Software Developer. Again, I know I shouldn’t complain. Because from last year from June to December I had an internship as an engineer looking at React and cypress and one of the head of Engineers told me once that he’s always worried about deadlines because if anything happened before or during production the blame was on him. I really feel I shouldn’t complain because I didn’t work for 2 months it’s just that in my mind I always thought on building cool stuff. Again I don’t have stress at my job and feel happy for the pay but I sometimes think I have so much more potential

    • @spaghettiking653
      @spaghettiking653 ปีที่แล้ว

      @@inspisiavideos8542 Always improve yourself; if anything, even if in terms of career, you aren't using what you learnt, you can always advance on your own personal terms. Make something massive, something impressive that you can call yours. Maybe in a new language. Hope you're still doing well at your job.

  • @pharoah327
    @pharoah327 3 หลายเดือนก่อน

    There are a lot of things in pep8 that I disagree with. Why not name the file exactly as the classname? That way, if a file begins with a capital letter, you know it contains a class and you know exactly what that class is called. If a file begins with a lowercase letter, you know it's a script without a class. I use this convention for PHP code and it works great.

    • @samwilson5544
      @samwilson5544 2 หลายเดือนก่อน

      How do you name files that both are standalone scripts and also contain classes you import elsewhere?

    • @pharoah327
      @pharoah327 2 หลายเดือนก่อน

      @@samwilson5544 personally I wouldn't have that. Those would be separate files. Too hard to find things if a file has too many different things in it.

  • @LeonDerczynski
    @LeonDerczynski ปีที่แล้ว

    After tip 2 I was expecting tip 3 to be "switch to coding in Eclipse"

  • @umeshlab987
    @umeshlab987 2 ปีที่แล้ว

    Sophie is cute
    @Tech with Tim how many cats do you have?

  • @tareqgamal
    @tareqgamal 8 หลายเดือนก่อน

    Nice cat sophia

  • @KosaQDev
    @KosaQDev 2 ปีที่แล้ว

    Second

    • @KosaQDev
      @KosaQDev 2 ปีที่แล้ว

      @♜ Pinned by Tech With Tim dont worry be ddos

  • @devsutong
    @devsutong ปีที่แล้ว

    how to import packages that is not on the sane directory? I've tested relative path but it's not working

  • @pravachanpatra4012
    @pravachanpatra4012 2 ปีที่แล้ว

    Tim can make more DJANGO tutorials?

  • @nowyouknow2249
    @nowyouknow2249 2 ปีที่แล้ว

    Does Sophie code too 😆?

    • @TechWithTim
      @TechWithTim  2 ปีที่แล้ว +1

      Yes she’s my assistant

  • @beatmarsgo6972
    @beatmarsgo6972 2 ปีที่แล้ว

    I saw the cat 🐱😳

  • @pravachanpatra4012
    @pravachanpatra4012 2 ปีที่แล้ว

    TIM CAN MAKE Django Tutorials

  • @computerrcat870
    @computerrcat870 2 ปีที่แล้ว

    i am more focused on the cat

  • @JLSXMK8
    @JLSXMK8 ปีที่แล้ว

    0:10 What breed is she?! Too precious.

  • @mohmedbadr1947
    @mohmedbadr1947 2 ปีที่แล้ว

    whats peppe et?

  • @rishichougule17
    @rishichougule17 ปีที่แล้ว

    I give you like for Sophie🥰😄...

  • @adamstrejcovsky8257
    @adamstrejcovsky8257 ปีที่แล้ว

    cat :)

  • @YJstation
    @YJstation 2 ปีที่แล้ว

    Sophie lol

  • @dennisvlahos
    @dennisvlahos 2 ปีที่แล้ว

    Absolutely disagree with one class one file. This ain't Java.
    It's in the name. "Module". It is supposed to contain multiple classes relating to a functionality. When a module starts growing a bit large, that's when you should consider refactoring something that stands out into its own module. Or subpackages for *major* parts of a system. Reading a file that is just a bit too large is infinitely preferable to trudging through dozens of files that link together to form a single thing in your program. Consider the mental cost of having to keep lots of separate files and keeping track of their structure.

    • @spaghettiking653
      @spaghettiking653 ปีที่แล้ว

      Modularity is defined by the restriction of the scope of the contents. If you start bundling too much into one file, then that isn't likely to bode well for future maintainability. Like you say there is no need to limit things to one class, since classes aren't the literal atom of a program in Python, but if you have multiple unrelated classes bundled together, that might be a little unadvisable. That is where this advice comes from: that if you instinctually avoid multiple classes in a given file, then the files will necessarily be modular since each class ought to represent the entirety of the file's functions.
      But you gotta know the rules in order to break em.

  • @Lukers88
    @Lukers88 6 หลายเดือนก่อน

    Single class = single file isn't controversial... convention is from S.O.L.I.D..

  • @alish2950
    @alish2950 หลายเดือนก่อน

    Alphabetically order imports. Bruh 😅

  • @homelessrobot
    @homelessrobot 5 หลายเดือนก่อน

    its not complicated until you give a shit about the precise semantics of the import system and then its ridiculous, 'import' is like a 20 page essay in the documentation with references to like 10 different proposals and blah blah. I have no idea why python needs this much stupid machinery for 'import'.

  • @joutenhakujou
    @joutenhakujou 6 หลายเดือนก่อน

    I need to know if takos22 is from Côtes d’Armor