Config Files & Parsing in Python

2024 ж. 13 Мам.
61 525 Рет қаралды

Today we learn how to work with config files in Python. Writing, reading and parsing them.
◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾◾
📚 Programming Books & Merch 📚
🐍 The Python Bible Book: www.neuralnine.com/books/
💻 The Algorithm Bible Book: www.neuralnine.com/books/
👕 Programming Merch: www.neuralnine.com/shop
🌐 Social Media & Contact 🌐
📱 Website: www.neuralnine.com/
📷 Instagram: / neuralnine
🐦 Twitter: / neuralnine
🤵 LinkedIn: / neuralnine
📁 GitHub: github.com/NeuralNine
🎙 Discord: / discord
🎵 Outro Music From: www.bensound.com/

Пікірлер
  • Love how frequent you post videos, and how they are practical every time. You have quickly became one of my number one resources when getting stuck on projects at home.

    @newberryle19@newberryle19 Жыл бұрын
  • This was a great into into Config files and reinforced with a great example. Thanks!

    @CDA8615@CDA86156 ай бұрын
  • Thanks man got me through the hardest part of my Rainmeter OS customization.

    @YoungDreTheSauceGod@YoungDreTheSauceGodАй бұрын
  • Ha, bro, literally this is what I got assigned to work on today at work and have never done this before. What amazing timing lol.

    @mattRRgraham1996@mattRRgraham19962 жыл бұрын
  • I noticed at 10:06, you copied the line of code where the cursor was at with a keyboard shortcut. I can't seem to find how to do the shortcut, if anybody could tell me what that shortcut is, it would be much appreciated!

    @surferguy45@surferguy457 ай бұрын
  • Feels good to learn something new!

    @rain-er6537@rain-er6537 Жыл бұрын
  • How do you then modify add delete more user with the main program any example?

    @alonsogonzalez6813@alonsogonzalez68139 ай бұрын
  • Nice! Previously used config parser on my motion detection project to hide my username and password. But this expands further on it’s uses. Thanks!

    @webslinger2011@webslinger20112 жыл бұрын
    • I believe it would be safer to use a .env file (dotenv) for storing sensitive information like passwords, etc

      @youtube.user.1234@youtube.user.12342 ай бұрын
  • Are you psychic ? I literally started learning about config files and it seemed like you have made this video knowing it. Thank you very much.

    @ghanteyyy@ghanteyyy2 жыл бұрын
    • Hacker h vo

      @alien_X1@alien_X12 жыл бұрын
  • I've learnt so much Python from you, thank you!

    @matrixtoogood5601@matrixtoogood56012 жыл бұрын
    • Pls search itz shorts time

      @alien_X1@alien_X12 жыл бұрын
    • @@alien_X1 oO

      @obed818@obed818 Жыл бұрын
  • Quick question brother how can i convert silverbullet config .svb to .py is there a repo in github that convert .svb or .loli to .py thanks alot

    @joymackey8218@joymackey82182 жыл бұрын
  • Lol, I never known there's a library for configs, i was parsing them manually in every single project i have, this saves alot of time

    @ahmedahmedeg7941@ahmedahmedeg79412 жыл бұрын
  • i have a config file and declared with some variables in it. I would like to use some variables as a parameter in User defined function. For example : f1(config.VAL_PATH,config.DATASET_NAME) . But when i used like this i am getting Attribute Error. Eventhough config.py is available in same working directory. Pls help me to do in colab.

    @ashwinkumar5223@ashwinkumar5223 Жыл бұрын
  • Very cool :) Was thinking this might include Cisco network device configs - but still handy! Thanks for making the font large enough for me to watch on my phone on the way to work

    @sdolo222@sdolo2222 жыл бұрын
  • Very nice thanks !

    @obed818@obed8182 жыл бұрын
  • Really helpful

    @user-mz7if3uu8x@user-mz7if3uu8x11 ай бұрын
  • Can you continue with the C tutorials, they were really interesting.

    @_M_643@_M_6432 жыл бұрын
  • Nice one!

    @dominicabah5431@dominicabah543110 ай бұрын
  • Muito top. Obrigado

    @ollywerdyego8589@ollywerdyego85892 жыл бұрын
  • Plz provide intro music link

    @jeopardisinggaming8045@jeopardisinggaming80452 жыл бұрын
  • Thanks a lot 🎉🎉🎉🎉🎉

    @nedamehrvar4929@nedamehrvar49297 ай бұрын
  • that was useful tnx

    @alialavizadeh2775@alialavizadeh27752 жыл бұрын
  • really good

    @tcgvsocg1458@tcgvsocg14582 жыл бұрын
  • When reading from a config file, is it possible to validate the data? For example, I might expect a certain value to be between 1000 and 2000. If it’s not, I want to raise an exception.

    @timmarkhuff@timmarkhuff Жыл бұрын
    • Yes it is possible. You can create your own exception from base exception and throw it out. With exit(0)

      @tahmidhossain6349@tahmidhossain63494 ай бұрын
  • I usually prefer json instead of conf files.

    @HTWwpzIuqaObMt@HTWwpzIuqaObMt2 жыл бұрын
  • cooooooooooool

    @leizhao1387@leizhao1387 Жыл бұрын
  • Teach me cython decompilation python file.

    @Saimon404@Saimon4042 жыл бұрын
  • Doesn't even support lists bro Don't make the same mistake i did and just use a different library or JSON

    @xfadedxshadow@xfadedxshadow5 ай бұрын
  • Completely lost you after the 5mins. Could you just initially do a SIMPLE write read so we can get the jist of what vars/arrays/bits/bytes/tuples/ or whatever can be got out of the file, and show goes where when why and how and then go on to write an RTOS, it really should be KISS Keep It Straight ^ Simple, I have created a data file and cannot get a string from it, python complains wrong format, so will give up and try another way for a 'simple' .ini to save so data. But many thks for you your attempt on this, at least I now know there are possibilities,.

    @joeking5211@joeking5211 Жыл бұрын
  • I hate it so many people use library's AND THEY NEVER WORK AND JUST MAKE IT HARDER I HATE THIS.

    @reedyea1358@reedyea13587 ай бұрын
    • Bro, trust me, if you can't do something with a library, doing it without one isn't going to be any less difficult. The reason people use libraries is because they make things easier. Much easier, in fact. Don't just rely on video tutorials, you'll actually learn more by reading the documentation. Look for configparser in the Python docs and read through the page carefully. If you're having trouble understanding that page then you haven't learned enough of the basics, so start reading the Python docs from the beginning. And be patient, learning programming takes time.

      @QuotePilgrim@QuotePilgrim4 ай бұрын
  • :)

    @philtoa334@philtoa3342 жыл бұрын
  • 2nd :)

    @Markandpreston@Markandpreston2 жыл бұрын
  • config file and password in this video kzhead.info/sun/bNFqccmloYydYIU/bejne.html

    @niteshkumar5765@niteshkumar5765 Жыл бұрын
  • tooo much talking, bro just show the concept

    @mosk53@mosk53 Жыл бұрын
KZhead