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

Поділитися
Вставка
  • Опубліковано 17 лис 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 6 місяців тому

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

  • @Azcane
    @Azcane 5 років тому +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.

  • @habbab
    @habbab 3 роки тому

    This guy is dropping serious knowledge for beginners here.

  • @fadious_padious2711
    @fadious_padious2711 6 років тому +15

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

  • @cupajoesir
    @cupajoesir 6 років тому +3

    Another Larry Hastings video. Perfect!

  • @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

  • @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

  • @kmn1794
    @kmn1794 5 років тому +1

    As a perfectionist, I appreciate this talk.

  • @medthehatta
    @medthehatta 6 років тому +8

    ... 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

  • @DeepSukhwani
    @DeepSukhwani 4 роки тому

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

  • @jfr9964
    @jfr9964 5 років тому +18

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

  • @Zergosss
    @Zergosss 5 років тому

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

  • @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

  • @陈卢鑫
    @陈卢鑫 5 років тому

    impressive and funny presentation style

  • @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"

  • @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.

  • @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

  • @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

  • @michaelthomheadley
    @michaelthomheadley 5 років тому

    Fantastic

  • @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.

  • @ronaldokun
    @ronaldokun 6 років тому

    Genius!

  • @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.