Sensitive content
You know the new year resolutions? Those you swear by on the new year's eve party but drop after a week? I decided to give into one of those this time around and revisited Python, or any programming language actually, after something like fifteen years.
I read upon a couple of introductory blog posts written in really simple language, played with print for a bit, set up some variables (I knew what those were for a while now but used them in an actual script for the first time(; made one variable request input from me first, tried on a "if" loop (yes, I knew those from Tasker and Apple Shortcuts) then got bored with trying everything on arbitrary fruits, names and greeting generators and decided to try and create something useful with what I knew already.
Someone had a problem: a folder of audio files named in the template of season number - episode number series title - episode title. Only the episode number and title were needed and I thought: "Hey! I read about all the fun things you can do with strings, I can do that... maybe...".
I sat to work. Inspired by what I already recognized as pieces of Python code, I decided to take a look at some NVDA addons and see whether I can understand anything. The first line: import os. Cool, that sounds like Operating System. I have heard of Python modules / libraries before, I guess "import" well... imports that so the commands, I'm sorry, functions can be executed and Python knows it can use them. Os sounds like something that interfaces with the operating system so maybe it can operate on files too. I googled that and bingo! it has a function os.rename that well... renames things to other things. Good, I can take that! Now how do I do anything from here? I guess I need to somehow make the script see the files I'm talking about. (1/2)
I read upon a couple of introductory blog posts written in really simple language, played with print for a bit, set up some variables (I knew what those were for a while now but used them in an actual script for the first time(; made one variable request input from me first, tried on a "if" loop (yes, I knew those from Tasker and Apple Shortcuts) then got bored with trying everything on arbitrary fruits, names and greeting generators and decided to try and create something useful with what I knew already.
Someone had a problem: a folder of audio files named in the template of season number - episode number series title - episode title. Only the episode number and title were needed and I thought: "Hey! I read about all the fun things you can do with strings, I can do that... maybe...".
I sat to work. Inspired by what I already recognized as pieces of Python code, I decided to take a look at some NVDA addons and see whether I can understand anything. The first line: import os. Cool, that sounds like Operating System. I have heard of Python modules / libraries before, I guess "import" well... imports that so the commands, I'm sorry, functions can be executed and Python knows it can use them. Os sounds like something that interfaces with the operating system so maybe it can operate on files too. I googled that and bingo! it has a function os.rename that well... renames things to other things. Good, I can take that! Now how do I do anything from here? I guess I need to somehow make the script see the files I'm talking about. (1/2)
Paweł Masarczyk
in reply to Paweł Masarczyk • • •Sensitive content
Paweł Masarczyk
in reply to Paweł Masarczyk • • •Sensitive content
Learning how to code has been my dream since I touched my first computer as a teenager. In my early highschool years I have considered following some kind of IT as my education path but the feedback I got back then was that I lack the structural, analytical, logical thinking required to code. I was able to scrape good enough grades in STEM subjects but I felt that I was replaying scenarios I observed in classes and not coming up with my own solutions. I tried a Python course back then but quickly lost interest seeing how much there is to learn before I get to doing the actually fun stuff and writing useful software. Many years later I wrote my first script that was useful to anyone and discovered in the process that I am now able to break tasks down to smaller subtasks which will let me achieve what I want, ask good questions that will get me where I want applying the terminology I've learnt, and that I've got the curiosity that leads me to asking very specific questions just to see whether my theory is right, even if they won't lead to answers straight away. I'm not sure how quickly I'll learn Python to the degree where I'll actually code something worth writing home about but the most important thing is, I discovered I have skills that I thought I never had and that might be useful in other areas of life.
If you've always wanted to do something but dropped it, maybe it's worth revisiting that course, book, tutorial, podcast, human or machine and try again, you've grown as a person, circumstances changed and maybe you'll be able to nail it now. 2/2
reshared this
Jonathan reshared this.
Steve Holden
in reply to Paweł Masarczyk • • •Sensitive content
Paweł Masarczyk
in reply to Steve Holden • • •Sensitive content
Tara Owton
in reply to Paweł Masarczyk • • •Sensitive content
Paweł Masarczyk
in reply to Tara Owton • • •Sensitive content
Tara Owton
in reply to Paweł Masarczyk • • •Sensitive content
Paweł Masarczyk
in reply to Tara Owton • • •Sensitive content
Tara Owton
in reply to Paweł Masarczyk • • •Sensitive content
Paweł Masarczyk
in reply to Tara Owton • • •Sensitive content