Skip to content

Change python intro to use files#210

Merged
bmispelon merged 2 commits intoDjangoGirls:masterfrom
phalt:python-intro-uses-files
Dec 2, 2014
Merged

Change python intro to use files#210
bmispelon merged 2 commits intoDjangoGirls:masterfrom
phalt:python-intro-uses-files

Conversation

@phalt
Copy link
Copy Markdown
Member

@phalt phalt commented Dec 2, 2014

Changes to the Python Introduction chapter to use files when things get more complex.

This reshuffles the code editor chapter to between the Python installation and Python introduction chapters.

Reading through the tutorial, it felt like the interpreter was a good choice up until conditional loops and functions were introduced, so I didn't rewrite the whole thing. I did however add a small section on getting the code editor open and why we are switching to it at that point (see line 396 and onwards in python_introduction/README.md)

Closes #207 and #190

🎁

Comment thread python_introduction/README.md Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think here we need to make sure that they are in the right directory (desktop) or tell them how to go to this directory (they learned cd commands in intro to command line)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I wasn't sure if they fully understood this yet. Better to be explicit here. I'll make a change.

@olasitarska
Copy link
Copy Markdown
Member

Thanks for this awesome contribution @phalt! Really well done. I am nitpicking on two things, what do you think?

@bmispelon it'd be awesome if you would have 10 minutes to see if I missed something :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't looked through the entire tutorial, but as far as I can remember we use double quotes " for string most the time. This would reduce confusion if we stick to them here as well.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually it looks like a lot of the tutorial uses single quotes. Happy to change it. Can we get a definitive on this please @olasitarska? Single or double quotes?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we haven't ever made that decision. Can you check what this chapter is using and adjust to that?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My general guideline is: single quotes for machine-readable strings and double quotes for human readable ones.

It might be nice to be more consistent about this through the tutorial but I think that's out of scope for this PR.

Also note that we do explain the two syntax at the beginning of this chapter and in my exprience, I haven't seen much confusion about this in practice.

@bmispelon
Copy link
Copy Markdown
Contributor

I will give this a thorough review later in the evening.

Thanks for tackling this, Paul. Much appreciated ❤️

Comment thread python_introduction/README.md Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be before the previous paragraph?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cleared this up, it should print out "Hi anonymous" this time, but I can see why there was confusion.

@bmispelon
Copy link
Copy Markdown
Contributor

I left a few comments here and there but this is a really awesome contribution!

As I mentionned in #210, I think we could switch to file-based execution right before we introduce the print() function.
However, this PR stands on its own and I'd be happy to merge it in its current state (well, after you remove all the if __name__ == '__main__' as noted in my comments :) ).

Thanks again!

@phalt
Copy link
Copy Markdown
Member Author

phalt commented Dec 2, 2014

Updates should have been pushed up now:

  • Removed all the if __name__ == '__main__' stuff
  • Cleared up the hi() function
  • Removed explanation of colons in favour of "this is how if and for work"

bmispelon added a commit that referenced this pull request Dec 2, 2014
@bmispelon bmispelon merged commit 29ca8f6 into DjangoGirls:master Dec 2, 2014
@bmispelon
Copy link
Copy Markdown
Contributor

Thank you! 💖

@olasitarska
Copy link
Copy Markdown
Member

Yay! ✨ 🎉

@phalt
Copy link
Copy Markdown
Member Author

phalt commented Dec 3, 2014

😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Switch to file-based code execution in chapter 4 (intro to python)

4 participants