Using the Python pickle Module

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ธ.ค. 2024
  • As a developer, you may sometimes need to send complex object hierarchies over a network or save the internal state of your objects to a disk or database for later use. To accomplish this, you can use a process called serialization, which is fully supported by the standard library thanks to the Python pickle module.
    Click here to learn more: realpython.com...

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

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

    Great video ! I discovered pickle through API's. When making tons a requests, you can use the pickle module to build a cache and save your responses. If you do the same request in the future, you'll be able to retrieve it from your local cache instead of making the same call to the API

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

    Great video, simple and explanatory. You forgot to mention how the pickle is not a true copy

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

    This really helps to see how to use pickle. Thanks so much for making this video. It would be nice if you might include this code into a github repository.

  • @caw25sha
    @caw25sha 4 ปีที่แล้ว +25

    I have never used this because I don't understand the benefits (if any) of pickle over ubiquitous formats like JSON or even XML. Maybe you could discuss this in a future video?

    • @duncan-mcrae
      @duncan-mcrae 3 ปีที่แล้ว +3

      I've used it to save down the gui state so on re open, it returns as per last used state. I didn't want the users messing with the config file, so made it so they couldn't.

    • @subhambairagi4178
      @subhambairagi4178 3 ปีที่แล้ว +4

      I think you are right. Though I have experienced this yet, I have heard people say that Pickle has poor security level, and it also causes problem during serializing and de-serializing if the versions of the python involved are not the same.

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

    Perfectly explained!

  • @schogaia
    @schogaia 4 ปีที่แล้ว +6

    It's a cool feature I have no idea why I would ever want to use it though

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

    In case of class object byte string is readable

  • @EnglishRain
    @EnglishRain 3 ปีที่แล้ว

    Excellent work thank you so much!

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

    😶 Okay,...seen this here and there 😳 What would I use this for?

  • @jiwan88
    @jiwan88 4 ปีที่แล้ว

    why is the class first letter is not capital here

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

      İt doesnt has to be capital, its just tradition.

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

      PEP STANDARDS are a STANDARD not a tradition. Break the standard and your youtube channel should be perm banned!

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

      @@NathanChambers 🤓

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

    🙏🙏🙏

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

    So good explaination

  • @knut-olaihelgesen3608
    @knut-olaihelgesen3608 2 ปีที่แล้ว +4

    The class name should be "ExampleClass" instead of "example_class"