Larry Hastings - Solve Your Problem With Sloppy Python - PyCon 2018

Поделиться
HTML-код
  • Опубликовано: 28 авг 2024

Комментарии • 46

  • @AS-yh1fj
    @AS-yh1fj Год назад +1

    As an Engineer, I believe this is the right approach to coding.

  • @SecondSight
    @SecondSight 6 лет назад +26

    I think this is kind of one of the most underrated uses of Python! In literally minutes you can automate a really dreadful chore in the most hacky way possible but it works perfectly still. Not everything has to have function docstrings, functions for every little thing and a super modular and "formal" structure. Python is perfect for quick and dirty experimentation due to its dynamic / flexible nature

    • @EdiFerreiranet
      @EdiFerreiranet 3 месяца назад

      That's exactly the reason why python exists!!!! 🍺🐍

  • @Azcane
    @Azcane 4 года назад +8

    As someone who uses regex (to rename files) regularly, this seems like such a verbose and convoluted solution to the first problem.
    His mindset regarding sloppy code is great though.

    • @b2gills
      @b2gills 3 года назад

      I wrote the same thing using a singular Raku regex to match the filename. Which among other things meant that I didn't have to put the list of files into the program.
      gist.github.com/b2gills/826f4d0421c5956099d73df70c0bf97f

  • @colpachino
    @colpachino 6 лет назад +9

    Loved the way dude presents his topic.

  • @cupajoesir
    @cupajoesir 6 лет назад +3

    Another Larry Hastings video. Perfect!

  • @techjutsu4066
    @techjutsu4066 6 лет назад +20

    Excellent Talk, if you ever create a beginner to pro book with topics like these I would be one of the first to purchase, great stuff.

    • @10e999
      @10e999 6 лет назад +1

      Tech Jutsu agreed

  • @fadious_padious2711
    @fadious_padious2711 6 лет назад +14

    Don't write shell scripts. Use this shell script to get ready for your Python script.

  • @kmn1794
    @kmn1794 5 лет назад +1

    As a perfectionist, I appreciate this talk.

  • @habbab
    @habbab 3 года назад

    This guy is dropping serious knowledge for beginners here.

  • @luciverse
    @luciverse 6 лет назад +9

    "Why didn't you do a list comprehension?"
    "If you want to practice your list comprehensions, then go ahead." 👍
    ALSO:
    ✨Exception List ✨
    -> DOPE

  • @jfr9964
    @jfr9964 5 лет назад +18

    This guy has probably already made SkyNet just because he didn't want to rename some folders.

  • @DeepSukhwani
    @DeepSukhwani 4 года назад

    Wow, great stuff. Thank you Larry Hastings 🙇🏻‍♂️

  • @medthehatta
    @medthehatta 5 лет назад +7

    ... never write shell scripts
    ... fstrings [are impressive]
    ... [we want] spaces in filenames
    ... always use the latest version of everything
    ... % as prompt string
    ... [ansible] what's that?
    I sense Larry has never been a sysadmin.
    (That said, I'm fully on board with the overall idea of the talk, but I found myself wincing constantly at some of the details)

    • @medthehatta
      @medthehatta 4 года назад +1

      @@humpingmushroom2658 nothing wrong with f strings, but if you've ever used Perl or bash extensively, they wouldn't appear to be such a killer feature

    • @b2gills
      @b2gills 3 года назад

      I like Raku for sys-admin / command line stuff.
      Small example gist.github.com/b2gills/93d1e2aa6583b95315b2
      Those multi sub MAIN are different argument lists you could give it. The comments with #| are documentation comments that gets included in the USAGE message.
      If you called that like 「bytes --help」 (or anything else that doesn't match the arguments) it will give you this generated USAGE message:
      Usage:
      bytes -- the number of bytes on the clipboard
      bytes -- the number of bytes in a file
      bytes --stdin -- the number of bytes from stdin
      I used that a lot when I was writing code golfs regularly.
      I also translated the Python program in this video to Raku gist.github.com/b2gills/826f4d0421c5956099d73df70c0bf97f

  • @Zergosss
    @Zergosss 5 лет назад

    Lovely guy. I'd love to have buddies like him.

  • @unperrier5998
    @unperrier5998 4 года назад +2

    This shell script bashing has to stop. Every language has its usage and shell scripts are perfectly fine.
    I've seen people replacing "shell script" with clojure programs in Jenkins, because they didn't like shell scripts.
    Like cloujure, python is not as suitable as shell scripts to certain kind of tasks.
    Jus learn to use shell scripts and you'll like it. Don't get me wrong I love python but I know where and when to use it.

    • @DanHaiduc
      @DanHaiduc 4 года назад

      How would you rename the songs? Would I have to learn sed or awk also?

    • @SreenikethanI
      @SreenikethanI 2 года назад +1

      heh
      shell script "bash"ing

  • @randywelt8210
    @randywelt8210 6 лет назад +1

    What about Gilectomy 2018, CPython4 with Garbage Collection?

  • @kurtmayer2041
    @kurtmayer2041 5 лет назад

    i was actually already using your way of installing python to update blender before i watched this

  • @user-oq8ph9ee7k
    @user-oq8ph9ee7k 5 лет назад

    impressive and funny presentation style

  • @michaelthomheadley
    @michaelthomheadley 5 лет назад

    Fantastic

  • @japrogramer
    @japrogramer 5 лет назад +1

    I don't like spaces, i use underscores. Escaping characters is evil.

  • @kevindong9672
    @kevindong9672 5 лет назад +1

    This guy is almost as good as David Beazley.

  • @RoamingAdhocrat
    @RoamingAdhocrat 3 года назад

    spend the day embodying this conference and… would dearly love to meet the developer who designed an API where to end an address on 2021-04-01 you send `endDate: {year: 2021, month: 3, day:1}`
    now my problems are Worse
    was wondering why 1 in 12 were coming back with "invalid data error"

  • @dmsalomon
    @dmsalomon 2 года назад

    Totally disagree, many tasks are better done with pure shell, because you can leverage tools like curl, zip and it's much easier than using requests. But once you need do anything more complicated than simple if or for loop, I agree that python will be better

  • @fazlearefin7339
    @fazlearefin7339 5 лет назад

    For the provision solution 17:10 I wrote some ansible playbooks which might be useful for installing everything from scratch: github.com/fazlearefin/ubuntu-dev-machine-setup

  • @ronaldokun
    @ronaldokun 6 лет назад

    Genius!

  • @mmmhorsesteaks
    @mmmhorsesteaks 6 лет назад +2

    Man too bad he quit doing the gilectomy...

    • @jorgegomes83
      @jorgegomes83 6 лет назад

      That's exactly what I was thinking.

    • @magno5157
      @magno5157 5 лет назад

      Too difficult.

  • @hp.ramesh
    @hp.ramesh 4 года назад

    Anyone that takes extreme positions like "here is a solution for all your problems" or "don't write shell scripts, shell is an awful language" is always wrong. DIdn't have to watch the rest of his rant.
    Every language has a purpose. Even so called the "best" language can produce crappy code in the hands of a bad programmer and the vice versa is true as well.
    Respect every language for what it offers that others don't.

    • @gustavoalexandresouzamello715
      @gustavoalexandresouzamello715 4 года назад +6

      I guess you missed the context in which his claim was made. To his goals, writing short automation scripts, shell turns out to be awfully bad.