r/learnpython • u/dstnmyrs • Feb 29 '20
Actually used python today
I've been learning python for about a month now. I started with automate the boring stuff like so many others have. Since then I have made some small games to practice. I am currently working on a hangman game and needed a list of words to use. I found a list of words and copied the whole thing to a .text file but it came with extra stuff I didn't need. So instead of manually deleting everything I didn't need I made a python script to do it for me. GREATEST FEELING EVER.
7
u/floridaturtles Feb 29 '20
Could you please share the code? I’m a very very beginner and I have no idea how you could code that
2
u/dstnmyrs Mar 01 '20
Probably not the most efficient way of doing it but it worked and it took me only 3 minutes to write. This is the script for 5 letter words BTW.
-11
u/mircatmanner Feb 29 '20
Look into regular expressions in python
7
u/rrjamal Feb 29 '20
Just a heads up: regular expressions are a bitch, and just pointless to tell someone to 'look into' when they barely know how to code.
Besides, OP probably just had to get rid of the '/n' or '/b' or something simple at the beginning/end of each line. Just hard coding that removal would more than suffice.
1
u/ScoopJr Feb 29 '20
Regex101 is a good resource. I usually test my strings in here before grabbing the pattern
2
u/midairmatthew Feb 29 '20
Neat! Next step for hangman: find an API that can serve random words and dig into the Python Requests module. :)
2
u/dstnmyrs Mar 01 '20
I just started toying around with wordsAPI after reading your comment. I'm getting random words and after a few missed guesses it shows synonyms and with 1 guess left it shows the definition. I'll eventually add those features based on difficulty selected.
2
31
u/codezoned Feb 29 '20
Great work mate. I'm a software engineer in Tokyo straight Outta uni and the one thing that helped me get my job was to make all my fun scripts into functional opensource projects on GitHub. Try to apply this into whatever you build :)
3
2
Feb 29 '20
Are there jobs in Tokyo (or is there a job market) for Americans that don’t speak Japanese?
2
Feb 29 '20
As an American who has spent a decent amount of time in various Asian countries (although it's been close to 10 years) I would try visiting before you think of moving there. Lots of people end up being really surprised at the culture, especially in Japan. It's not at all like it's portrayed in pretty much any western media.
I know lots of people who think they'd love Japan because they love anime and games by Japanese studios and all that Jazz and honestly a lot of that is exported specifically for American consumption.
Additionally Japanese is not an easy language for a native English speaker to learn. You can look it up but depending on what your first language is the hard pallet in your mouth hardens differently, making some sounds more difficult or easier to make. Same goes with muscles in your lips and tongue they strengthen depending on what language you speak.
Basically do your research before you try and move to a foreign country. Additionally Japan when I was there was not a high tech culture. Most people's Banks ATMs were only available during business hours and you paid your bills at the local convenience store instead of online. I'm sure some of that has changed in 10 years but it surprised the hell out of me.
5
Feb 29 '20
Thanks but that didn’t answer my question at all.
We’ve been to Tokyo 6 times for up to a month for travel. We love it there. I only meant, as I asked, is there a job market for Americans who doesn’t speak Japanese
1
u/sinosplice Mar 01 '20
From what I understand, you need to speak/read/write Japanese. Your English is not a huge pro, but your lack of Japanese is a huge con.
1
u/codezoned Mar 01 '20
I work in a startup and don't speak a speck of Nihongo, But I'm good at what I do. Companies like Rakuten, Google and a lot of others don't require you to speak Japanese but they do need a good level in English.
If you want to work in Japan, It's absolutely possible and in some cases easier than the West as there is a need for good software engineers over here right now. I would say APPLY, APPLY, APPLY and ignore everything else.
1
20
Feb 29 '20
Congratulations buddy!
Fee free to post the link to your code here for getting reviews and suggestions from fellow redditors.
13
7
u/batch_is_fun Feb 29 '20
Congrats! Learning to automate processes is a great skill! I’m not a software engineer but I work for a growing security company and right now my whole job is to automate processes for the analysts. Things like running through long lists of addresses and checking them with multiple online sources. Tasks that would take hours normally are able to be done in seconds with python. There’s obviously so much more outside of just that, but I figured I’d give my own real world example. It’s really great stuff! Keep it up!
1
u/ErnieCruz Feb 29 '20
Do you mind sharing the kinds of things you check for addresses? Just curious because I want to help automate the checking of addresses for local taxes at my job.
3
3
Feb 29 '20
Your IDE's regex capabilities would probably do the same job way faster than writing the actual regex in Python, but I get it; used to do the same thing, and the joy you get when hours become miliseconds is to die for.
0
3
u/thefsfempire Feb 29 '20
I've been learning for about the same duration and I've had a few of these moments myself. Its very rewarding and a lot more accessible than when I tried jumping into C# years ago (don't remember anything of that though lol)
3
2
2
1
u/rommon010110 Feb 29 '20
That is awesome, I am having a tough time getting through the book, hoping Kirk Byers free course sparks motivation.
1
1
u/Assumptio Mar 01 '20
I remember my first useful python script. My tv was having troubles displaying " " in subs, so i made a script to get rid of them on my subs files. Feels great! Congrats!
63
u/schwitaner Feb 29 '20
What boring stuff did/can you automate?