Setting out to learn Python. Anyone wanna join?

Gremlin wrote:
Godzilla Blitz wrote:

I wonder, would it make sense to start a new thread called "Learning Unity"?

We've got a general purpose Unity development thread which kind of doubles as a learning Unity thread.

Oh, right. I even posted there once. Cool. I'll put new Unity comments there. Thanks.

Godzilla Blitz wrote:

Woot! Done with Programming for Everybody! They released the final exam today. It was super easy. That gives me three Coursera courses completed now.

This was a gentle, low demand course. I don't think I spent more than a couple hours on the content in any given week. The first half, in particular, is too simple. The complexity escalates in the back half, but I found the content in the back half to be extremely useful. The course focuses on writing code to extract useful information from data, and none of the other courses I've taken has covered this topic. I feel like I can actually mine useful information from text files now. Thumbs up!

This, in particular, is what I am looking for. I signed up for the next session.

DonD wrote:
Godzilla Blitz wrote:

Woot! Done with Programming for Everybody! They released the final exam today. It was super easy. That gives me three Coursera courses completed now.

This was a gentle, low demand course. I don't think I spent more than a couple hours on the content in any given week. The first half, in particular, is too simple. The complexity escalates in the back half, but I found the content in the back half to be extremely useful. The course focuses on writing code to extract useful information from data, and none of the other courses I've taken has covered this topic. I feel like I can actually mine useful information from text files now. Thumbs up!

This, in particular, is what I am looking for. I signed up for the next session.

I'd be curious how you enjoy it. The focus on working with data doesn't show up until the back half. The first half is pretty basic stuff, and won't take long. I ran all the videos at 1.25/1.5 speed, as he kind of beats some topics to death, especially in the first half.

I'm a very novice python user, after being introduced to it at an old job. I've used codeacademy to get a basic understanding, but wouldn't mind finding some practical ways to use it so I can get a better understanding.

Okie dokie, back from two and a half weeks in Japan, just in time for a bunch of new Python courses to start up!

I'm making a second attempt at the MIT course, which started yesterday. I got to 9% on the first attempt, aiming for better this time around!

I'm also hoping to redo Part 2 of the Rice University course, as a refresher for further adventures in this specialization.

Work promises to be super busy in September though, so this might be a bit ambitious.

Clusks wrote:

I'm a very novice python user, after being introduced to it at an old job. I've used codeacademy to get a basic understanding, but wouldn't mind finding some practical ways to use it so I can get a better understanding.

I don't consider myself a good programmer yet, but what I've found as helpful as learning how to program is learning how to think like a programmer. By this I mean that many times we solve problems the way we've always solved them, but once you start thinking like a programmer, you start writing programs to answer questions and solve problems you would have previously done in more inefficient ways. So the more you start to think like a programmer, the more often you're going to find yourself in situations where you say, "Hey, I could probably write a program to answer that!"

Quick update...

I've already surpassed my completion percentage for the first time through the MIT Course. I'm up to 10% now, and only made it to 9% before. Go me!

I've also finished Week 1 in my review course of the Rice Python Course, Part 2. Week 2 starts object-oriented programming, and that in particular is what I'm hoping to review.

So far so good.

In other news, for anyone who enjoyed Python for Everybody, they are launching a five-course specialization starting in October. The emphasis, as with the first course, is on using Python with data. The previous 10-week course will make up the first two courses of the new track, and they're adding two more courses and a project. I'm hoping to be able to take the two new courses in the track. I think the project might only be open to people who opt in to the Signature Track (paid).

I find that listening to people talk about Python tends to inspire me to spend more time working on learning it. A couple of years ago there was a great podcast (From Python Import Podcast) that simply disappeared. They only had 17 irregular episodes, but i missed them when they stopped releasing new ones.

Now, there are two new (launched this year) Python podcasts out there.

I've just about caught up on Talk Python to Me which is an awesome podcast that is very often over my head as a newbie, but still quite interesting. The host simply interviews one person on a particular topic, and I really like his interview style.

The other one is Podcast.__init__. I haven't listened to it very much yet, but it started around the same time. It's much the same format, but with two hosts, instead. I think I prefer the single host approach, but maybe it will grow on me.

Are these podcasts OK for someone who's hit the wall about halfway through a python MOOC? I really should try and give another course a go.

Hey I just did (am still doing this last week) that Rice coursera class, both parts, the last 9 weeks or so. Been enjoying it mostly. In college we made a lot more practical applications in Java, C# and the couple of other things I dabbled in. But there's something about making Memory, Blackjack, Pong, and Asteroids that makes the learning a bit more enjoyable.

Got a big chunk of the final project done last night. If I finish up tonight, then I'll tinker with the bonus part about adding animations with the rest of my week until Saturday.

Congrats Stele! I did that about 2 years ago as the first programming exposure I had ever had. I followed it up with this course from EDX and MIT https://www.edx.org/course/introduct...
Combined I've gone from 0 coding knowledge to writing my own build management utility, GUI and all, for work and adding a very attractive tool to my toolbelt as a QA Engineer. It was all free and it just took time. I'm happy with the time we live in

Those are both great anecdotes. I did that course, too, about four years ago now. Haven't pushed on much since, though I've dabbled with R and some other junk. It's so hard to pick just one.

Congrats.

Once more into the breach for me. I'm trying the University of Michigan one this time.

https://www.coursera.org/specializat...

I hope by the end I can replace one of the terrible programs I have to use at work (edit an .json file) with something much better.

Great! If I thought I had the time I'd sign up, too.

Also boogle will love that they're not using pandas anywhere in there, just native data structures.

OK. I am gonna try this Programming For Everybody course again. And I'm gonna stick with it this time. I promise. Really. I do.

Stele, I am so very very jealous of your ability to stick with the learning. I took that course a couple years ago and hit the wall about the time we started learning classes (so, maybe the blackjack game?). I got really discouraged that I couldn't wrap my head around the stuff and gave up. But I still have this desire to learn programming.

If I can help y'all in any way, please feel free to ping me @muraii. I have spent plenty of time reading through docs and trying little things. I don't actually do anything, but I might be able to tinker enough to help.

If you're having a hard time finding motivation to learn or just need bite sized chunks, try out CodeCombat It takes things slow and lets you code solutions to problems like navigating your hero through a maze or code up some basic AI to get a coin collecting peasant to analyze the most efficient coins to pick up to get you enough money to spawn knights to defend castle walls.

polypusher wrote:

CodeCombat

Hey that was pretty fun. Wasted about an hour with it yesterday.

Finished up my RiceRocks asteroids clone tonight. Even did the bonus animation part.

Going to miss that class a little bit. At least I feel like I learned some things.

Hey guys, I was introduced to python about 2 years ago while working in market research.

I'm currently a data analyst for a tech company and I've been doing most of our research reporting in Excel due to the fact we don't have our own analytics system yet. We use Excel and R Statistics for all our reporting.

Since I know Python is very powerful and probably better for online analytics than R, I've got one eye on using it for the future, and I'm keen to look deeply into it. I've got a basic understanding of what Python is, and it's easy to wrap my head around, but I'm clueless at finding the things I need.

I was wondering if anyone knew a decent beginners guide (I'm a big novice when it comes to programming, only VBA I'm adept at) that looks like using Excel with Python much like R Statistics can extract columns in order to do analysis? I've downloaded Anaconda and had a bit of a play about, but I'm still a bit lost.

I can't comment on using it with Excel, but Learn Python the Hard Way is a fantastic learning tool IMO as it introduces both programming concepts and python. That link is to the buy-my-book-html5-athon, but if you just want to get reading add /book to the url (doubt the author would appreciate teaching the goog where to get the book without the sales pitch).

Automate the Boring Stuff by Al Sweigert has a chapter on using the openpyxl library that I found pretty helpful when I was trying to automate the creation of a spreadsheet that I had been doing manually.

Honestly if you are doing excel stuff I would suggest exporting sheets as csvs, then processing using python, then loading those back into excel.

The program Resolver One was discontinued years ago, but if you can find a copy, it was basically Python embedded directly into a spreadsheet. AFAIK, they released the last version as freeware. They don't host it themselves anymore, so it may take some hunting, but it might be an interesting tool for your problem domain.

I'm doing OK with python so far, I still feel a bit stupid using it as I'm by no means a programmer, but I'm understanding the basic concepts a bit better as I go along. However, I've come to a stumbling block in chapter 6 of automate the boring stuff, particularly the first project it introduces, as I'm not so sure it does a good job of explaining sys.argv. With step two it says:

The command line arguments will be stored in the variable sys.argv. (See Appendix B for more information on how to use command line arguments in your programs.) The first item in the sys.argv list should always be a string containing the program’s filename ('pw.py'), and the second item should be the first command line argument. For this program, this argument is the name of the account whose password you want. Since the command line argument is mandatory, you display a usage message to the user if they forget to add it (that is, if the sys.argv list has fewer than two values in it). Make your program look like the following:

#! python3
# pw.py - An insecure password locker program.

PASSWORDS = {'email': 'F7minlBDDuvMJuxESSKHFhTxFtjVB6',
'blog': 'VmALvQyKAxiVH5G8v01if1MLZF3sdt',
'luggage': '12345'}

import sys
if len(sys.argv) < 2:
print('Usage: python pw.py [account] - copy account password')
sys.exit()

account = sys.argv[1] # first command line arg is the account name

It's the whole fact that it mentions the word "lists" which I think is throwing me. If anyone could break it down for me in simple terms as to what this is actually going on about, it would be super helpful, as I just started to feel like I was getting it!

Clusks wrote:

If anyone could break it down for me in simple terms as to what this is actually going on about, it would be super helpful, as I just started to feel like I was getting it!

I'm decoding this from context. I did programming ages ago, and maybe conventions have changed but this is what I 'see.'
sys.argv is a special variable that contains all the command parameters that were typed when the program was started.
Example: If I typed "python pw.py luggage" then the system variable sys.argv would be a list containing two elements: {pw.py, luggage}
Typing "python pw.py luggage badPassword"
Would make sys.argv have 3 list items. To test badPassword against a password dictionary to see if it passes muster you would assign the sys.argv[2] value to a variable (newPassword), like they did with account in the last line of your quote.

Disclaimer: I could be horribly wrong.

Edit: So what that snippet is doing is checking to see how the program was started, and if it was run without including an account name then it prints out a message to let you know that it needs more information to do any work.

Rezzy has it.

Looking up the documentation, so it's just Argv is just a specific function within the sys library that turns every parameter into a list, with the name of the file always Being [0]?

Clusks wrote:

Looking up the documentation, so it's just Argv is just a specific function within the sys library that turns every parameter into a list, with the name of the file always Being [0]?

No, but close. Close enough that it kind of doesn't matter, but it kind of does.
argv is a special variable of type List that contains all the parameters that were added to the command that started the current program, with the current programs name always being in the first slot of the list [0].
If it were a function it would be called with sys.argv()

Edit: by 'special' I only mean that it is created for you.
Edit: and by 'close' I mean that it seems like you have the gist of it, but in programming the names of things are important. Which is why I really shouldn't be doing this from dusty memory... It might be time to start up one of my long dormant programming projects again. I'm sure I'll have plenty of time once babbie arrives next week.

That is a good point. "name()" is quite a bit different than "name", and because of Python's duck typing it can cause some hard to spot errors.

e.g.

result = func_name

As opposed to

result = func_name()

result = func_name

As opposed to

result = func_name()

For amateurs like me: the difference is that the first variant assigns the function itself to result. I haven't tried, but you might then be able to call result() and get the same function.

The second does what you'd expect: gets a result back from func_name, and slaps the 'result' label on it.