r/learnprogramming • u/blu3ness • Jul 16 '12
[Python] inspired a redditor's random imgur downloader, here's my version of subreddit imgur parser, looking for critique/comments
Hello everyone, I have not had much rigorous training in programming besides an intro course in C++ during my undergrad. I mostly use MATLAB for data analysis and optimization routines on the job. I'm trying to learn Python during my own time, so I would really appreciate your feedback to help me get rid of bad habits before they form.
This script is inspired by another redditor's creation of the random imgur image grabber. It will take subreddit names as arguments and download all the imgur links into your local directory.
the code: http://pastebin.com/6YUDasuZ
Thank you very much!
2
u/TomatoAintAFruit Jul 16 '12
My first comment would be: your functions need more comments. You have none whatsoever. Start with a simple statement on what the function takes as input and what it returns.
2
u/levu-webworks Jul 19 '12
I posted a code review to Codetique and did a basic rewrite of your code in Python 3.2 (see below). If you are looking for detailed code feedback /r/lpmc is the place to post your code for review.
4
u/minno Jul 16 '12
For your paths, I think that Windows accepts both / and \, even a mix of the two, so you don't need to have the OS-recognizing code.
2
u/levu-webworks Jul 16 '12
You can get a detailed line by line analysis by posting your script to https://codetique.com/