Top products from r/learnpython

We found 231 product mentions on r/learnpython. We ranked the 261 resulting products by number of redditors who mentioned them. Here are the top 20.

Next page

Top comments that mention products on r/learnpython:

u/philintheblanks · 6 pointsr/learnpython

That's an interesting pattern you have going on there. I don't know what kind of background you're coming from, but one of the nice things about Python is that, being dynamically typed, you can pass almost anything to a function at run-time.


What that means is, you can have a function like a spell that expects a character object, whether it's p1 or p2 is irrelevant. It holds the logic of how to access the object and alter the attributes. There's a LOT that goes into how you design that, but that's a thing that literal books have been written about.


So, as a brief example, you might do something like this:

def fire_spell(target):
target.spell_hits('fire', damage=2)
return target

class Character:
def init(self, name, health=10, mana=10, immunity=None):
self.name = name
self._health = health
self._mana = mana
self._spells = {
'fire': fire_spell
}

@property
def health(self):
return self._health

@property
def mana(self):
return self._mana

def cast_spell(name, target):
self._spellsname
return self

def spellhits(self, type, damage=1):
if self.immunity == type:
return None
else:
self.health -= damage
return None

So let's break that down a bit:


fire_spell: Exists outside of the characters. I would probably put all my spells in a separate module, that way I can import them, and add and remove them at run-time from the characters. That enables you to do things like have spells that aren't accessible prior to a level up, or some other mechanic. This isn't too different from having a separate class for the moves, since you're trying to namespace the moves, but I'll get to where that's a little odd here in a second.


self._health: This is just an attribute, but note the leading underscore. This is a pythonic convention that tells anyone who is using your code not to use this variable to access the thing that it points to. That is it would be best to leave it private. Python doesn't have private variables, so this is as good as it gets. We're all adults here.


@property: This is an example of a built-in decorator. If you don't know what decorators are, there are TONS of tutorials out there. Essentially, they modify how a function works. This one makes it so that instead of having to call the function, e.g. player1.health(), you simply access it as an attribute a la player1.health. Why on earth would you want to do this though? Well, any code in the function will run prior to returning the attribute! This allows you to modify what the calling code receives when it accesses the attribute. You want to have a conditional health buff based on the zone that the character is? Boom, way easier with this pattern. What to have the mana get dropped to 0 because of a status effect, easy peasy. And as soon as the effect clears, it can go right back to where it was! Basically, @property is really cool.


spell_hits: This is a method on the Character object. This you know. But why is it there? Well, designing a game is essentially designing an API. You may have heard of API around town, usually people are talking about web APIs, but the term is Application Program Interface. It applies equally to what this is. The Character class exposes an API to function inside of your program. They can expect that if they're going to receive a Character then they can act on it in a certain way. This is actually where you start to understand why certain programmers really aren't fans of dynamic typing. Python gives precisely 0 shits what you pass to this function. You can pass it a list of integers and it will not be annoyed. Well, until you try to call spell_hits. Then you get PropertyError: list object has no method 'spell_hits'. This won't happen until runtime. Then you're stuck chasing down which part of your gaht DANG CODE PASSED IN A DAMNED LIST!!!!! This probably won't happen to you with a small program, but I like to add context!


return self: Why would you do that? Well, we're back to the concept of API design! It's a pattern used for a "fluent interface". This pattern allows you to utilize method chaining, which is a really nifty thing. For example, let's assume that you want to run specific series of methods on a certain user input, then you could do p1.cast_spell(p2).use_item(p1).another_method(). This is a pattern that you see in a lot of libraries. It helps wrap your head around it if you write some code yourself that does it.


As far as your code is concerned, there's on thing that really sticks out:

Attributes.init(self)
Moves.init(self)

You don't need to explicitly call __init__. The __init__ function is what a lot of pythonistas refer to as a "dunder method", short for "double-underscore". I prefer to call them "data-model methods", since that tells you what they're actually a part of, instead of describing how they're written (which is totally useless information). A bit pedantic? Totally, but I wouldn't be a programmer if I didn't have a pedantic pet peeve (how's that alliteration!)


Data model methods are called when they need to be, and in the case of __init__ that is when you initialize an object. Example:

class Thing:
def init(self, name):
self.name = name

t = Thing('bobby brown')
print(t.name)

That will output 'bobby brown' because we assign the newly initialized Thing object to the variable t. Without capturing the object with a reference to a variable, they will be garbage collected. Basically, the Attributes and Moves objects that you're initializing will not be attached in any way to the player. You would need to do something like

self.attributes = Attributes(self)

Which would allow you to reference the new objects inside your player. Garbage collection in python isn't something that you'll need to be concerned about often, but I mention it because it's nice to know that python uses reference counting. Well, C Python does, and you're probably using that, so....


Overall, I think that what you need to get coded (pun intended) into your brain is the idea of frist class-ness, specifically as it relates to python. This concept is what makes decorators possible, and underlies the design patterns related to classes. I would also highly recommend the official tutorial as a place to find solid info on basics.


Past that, really it comes down to design choices. There's a million other ways than the one that I gave you to do this. Each one has a good reason to do it, and each one has trade-offs. This is where the rubber meets the road! Real programming boys! If you're interested in reading something that might help, I recommend Clean Code as a good read on designing good reusable software. The design book I linked above is kind of dense and uses Java, which could be confusing if you don't have experience with it. Clean Code is more generalized.


TL;DR: Functions accept objects, so pass the player object to the function and alter the health there. Then go read a LOT of stuff on OOP design patterns, cause they're hella hard.

u/CrimsonCuntCloth · 4 pointsr/learnpython

Depending on what you want to learn:

PYTHON SPECIFIC

You mentioned building websites, so check out the flask mega tutorial. It might be a bit early to take on a project like this after only a month, but you've got time and learning-by-doing is good. This'll teach you to build a twitter clone using python, so you'll see databases, project structure, user logons etc. Plus he's got a book version, which contains much of the same info, but is good for when you can't be at a computer.

The python cookbook is fantastic for getting things done; gives short solutions to common problems / tasks. (How do I read lines from a csv file? How do I parse a file that's too big to fit in memory? How do I create a simple TCP server?). Solutions are concise and readable so you don't have to wade through loads of irrelevant stuff.

A little while down the road if you feel like going deep, fluent python will give you a deeper understanding of python than many people you'll encounter at Uni when you're out.

WEB DEV

If you want to go more into web dev, you'll also need to know some HTML, CSS and Javascript. Duckett's books don't go too in depth, but they're beautiful, a nice introduction, and a handy reference. Once you've got some JS, Secrets of the javascript ninja will give you a real appreciation of the deeper aspects of JS.

MACHINE LEARNING
In one of your comments you mentioned machine learning.

These aren't language specific programming books, and this isn't my specialty, but:

Fundamentals of Machine Learning for Predictive data analytics is a great introduction to the entire process, based upon CRISP-DM. Not much of a maths background required. This was the textbook used for my uni's first data analytics module. Highly recommended.

If you like you some maths, Flach will give you a stronger theoretical understanding, but personally I'd leave that until later.

Good luck and keep busy; you've got plenty to learn!

u/kurashu89 · 1 pointr/learnpython

If you want a serious book recommendation: Learning Python 5th Edition by Mark Lutz. It's a monster at 1600 pages but to say it's thorough is an understatement. I got the ebook so I can quickly search through it on my phone. Even though I wouldn't consider myself a beginner anymore, I find between this book and the Python Cookbook I find answers to most of my problems (unless they're related to a library).

You can also read Learn Python the Hard Way (my introduction to Python 2). Which is free but not anywhere near the scale of Learning Python. As a warning, there's some coarse language used in it.

If you don't know any Python -- and this will probably stir the pot a little -- learn Python 3. BUT learn how to make it Python 2 compatible. Sure, you'll give up things like advanced tuple unpacking and yield from (to name two off the top of my head) and you'll probably have to use six but when the day comes that you can fully move your library to just Python 3, you'll be thankful.

If you feel comfortable enough with Python to begin approaching a web framework, I would personally recommend Flask. I'm sure quite a few people would disagree and they probably make valid points. But Flask is easy to start with:

from flask import Flask

app = Flask(name)

@app.route('/')
def index():
return "Hello World"

if name == 'main':
app.run()

Miguel Grinberg (you'll see him float around /r/Flask and some of the other Python subs occasionally) has both a great blog series and a great book on building Flask projects. It's not the end all be all of Flask knowledge and honestly, I'd like see more written on working with bigger projects, but given Flask is only 4 years old I'm not surprised.

For Django, I've heard lots of good things about Two Scoops of Django but I've not read it (though, I need to at some point).

I'm unsure about other frameworks like Pyramid or TurboGears or WebPy.

You'll also want to have working knowledge of HTML (not hard), CSS and Javascript (much harder). And getting chummy with libraries like Bootstrap and JQuery/Angular/whatever is probably a good idea, too.

There's also specific concepts you'll want to be familiar with depending on where and what you work on: things like REST, JSON, Ajax, CSRF, etc.

u/xPolydeuces · 2 pointsr/learnpython

My friend who was getting into Python recently asked me about the same thing, I've made some research and this was what I came with. Just for the record, I'm personally a book dude - can't really focus much when learning from Udemy courses and stuff like that, so I will only cover books:


First book:


Python Crash Course by Eric Matthes
Very solid position for beginners. The first part of the book covers Python's basics - data types, lists, functions, classes, pretty much everything you need to get a good grasp of Python itself. The second part of the book includes three practical projects, mini-game, data visualization and an introduction to making web apps with Django. From what I so, it's a pretty unusual approach to beginner friendly books, since most of them avoid using additional libraries. On the other hand, it's harder to get bored with this book, it really makes you want to learn more and more once you can actually see the effects of all your work.


Automate the Boring Stuff with Python by Al Sweigart
Best alternative if you want to spend 0 bucks or want to dive all into projects. Even though it covers basics as well, I still recommend to read it, even if you have done Python Crash Course before, even just for the sake of all those projects you can make to practice your Python. He also has a Youtube channel where he has a loooot of Python content and sometimes does cool things like streaming and helping people make their code better, really cool guy, be sure to check his channel!


Second book:


Writing Idiomatic Python by Jeff Knupp

Very solid book, filled with examples what you, as a Python developer should do, and what you shouldn't (and why not). Sounds like not much, but it is actually a lot of useful knowledge that will make your code shorter, cleaner and better.


Effective Python by Brett Slatkin

A bit easier to understand and easier to approach than a previous book, but still has a load of knowledge to share.


Third book:


Fluent Python by Luciano Ramalho

One of the best Python books overall, covers all of the things that previous books could have missed or didn't have time to introduce. My personal favorite when it comes to books for advanced Python developers.


All of those recommendations are my personal opinion, so if anyone has anything to add, I will gladly listen to any comments!

u/tyroneslothtrop · 1 pointr/learnpython

Really, that's not even something I would consider all that important to know off-hand. I actually had to go to the REPL and the docs to verify how the int function behaved with alpha-numeric strings. This is the sort of thing that people might pick up with experience, but I wouldn't say it's such a commonly used feature of the language that not knowing it reflects poorly on your abilities.

If you don't know something like this, you can just say that and use the question to demonstrate your reasoning skills and your general knowledge of the language. E.g. "I don't know how that would work off hand. But I know that python is a strongly typed language, so it doesn't do implicit casting. But where this would be an explicit casting, maybe it interprets the string as a number if a high enough radix is specified. Or maybe it behaves like ord and returns the ASCII value of the character. If I was in the python REPL, I would type help(int) to see how it works, or I would go to python.org and look at the docs."

Actually, having mentioned that last part, it strikes me that it sounds like they might have actually been talking about ord, not int.

Anyway, if, on the other hand, they're only looking for the technically correct answer to questions about obscure, unimportant, or easily googleable aspects of the language, then they're probably not very good at interviewing, or aren't all that knowledgeable themselves. I don't know if there's much you can do about that, unless you're willing to pursue an encyclopedic knowledge of the language. While it's good to be more familiar with a language, I don't think it's generally worth anyone's time to try to memorize every single aspect of it. Who cares if you don't know the exact signature for the range function, or the exact string formatting syntax to left-align text and specify a 79 character width, or whatever? That's what the docs are for.

Having said all that, the int casting question sounds like it was kind of stupid, and if you're conveying it correctly, it sounds like maybe they don't even know what they're talking about there. The dictionary question, though, doesn't sound like a trick question at all. First-class functions, and the 'everything is an object' philosophy are pretty core features of python. If that's new to you, maybe bone-up with Dive Into Python, or Think Python, or Learning Python, or similar.

Good luck!

u/RangerPretzel · 1 pointr/learnpython

Sure, I'm self-taught, but I've been in software engineering for a while.

Python is like a lot of other languages. It has its own vocabulary for some things, but it also uses the vocabulary for most other things in the industry.

Mostly, I just picked up a book and started reading and coding. It also helps to have someone to chat with, too.

My one co-worker and I like to geek out about Python nuances. He's a big fan of it. I like Python, too, but prefer statically typed languages, like C# and Scala. Although I do code in Python daily.

So we have interesting debates about things. It's not that we're diametrically opposed about things, it's that we have subtle differences that we like to discuss.

And we both learn about the language this way.

So yeah: recommendation: Get someone to talk to about this. Also read other people's code.

Also, I like the book Effective Python: 59 Specific ways to write better Python

u/myRobotArms · 1 pointr/learnpython

Also, I can't recommend this book enough. http://www.amazon.com/Python-Programming-Absolute-Beginner-Edition/dp/1435455002 It's fun and challenging. At the end of some pretty lengthy chapters that explain certain concepts really well, he presents challenges that you can attempt, just give you more practice and get you thinking like a programmer. The book takes you from great explanations on the basics to developing GUIs and even simple video games. It's a great place to get started. Also there is Udemy.com, who is wrapping up their 65% off promotion. There are a good number of free tutorials and paid tutorials as well. Good luck with Python!

u/2ht · 10 pointsr/learnpython

While I find doing challenges such as Project Euler fun, and they're good for making me think outside the box, I need to feel "accomplished" when I program. Solving a puzzle generally has no practical purpose, and it isn't something I can go back to later to experience again.

So work on either something practical or something entertaining, like a game. As long as it is something you can run later and be proud of.

  1. Write small programs that will improve your daily life. E.g. track all your movies, what shows you watch or books you read, a todo list app, write a simple command line finance manager, etc.
  2. Learn a web framework such as Flask or Django
  3. Read http://www.greenteapress.com/thinkpython/thinkpython.html if you are interested in a computer science approach to Python (as well as the MIT class)
  4. Buy and read http://www.amazon.com/Programming-Python-Mark-Lutz/dp/0596158106 if you want a more advanced book on Python (well worth it)
  5. Read and work through http://inventwithpython.com/ - both books - if you think game dev might be fun.
u/slayerming2 · 1 pointr/learnpython

Okay yeah sorry, I'll try to do more research on the reddit next time. A less knowledagable friend suggested I try my hands on with VBA and, I asked my more knowledgable friends about that and php. He said that VBA is kind of outdated and PHP, although easier, is really specific for what you want, and Python encompass both VBA and PHP better. Do you agree with that?

Also is this the book you were talking about? https://www.amazon.com/Learn-Python-Hard-Way-Introduction/dp/0321884914

My friend said he said he heard good things about this book https://www.amazon.com/Automate-Boring-Stuff-Python-Programming/dp/1593275994?ref_=nav_signin&

What do you recommend?

u/KennedyRichard · 1 pointr/learnpython

Python Cookbook 3rd ed., by David Beazley and Brian K. Jones, has a dedicated chapter about metaprogramming. The book is so good the other stuff may also give some insight on metaprogramming or alternatives. I already read it and it gave me insight on my code about metaprogramming and other topics, so it is pretty useful. You can also find a lecture from Beazley about the topic with a quick google search with his name and the "metaprogramming" word.

There's also Fluent Python by Luciano Ramalho, which has three dedicated chapters about metaprogramming. Didn't read the chapters myself but I'm half way into the book and it is awesome, so I'm having great expectations about those chapters.

Don't mind the metaprogramming "chapter count", it is just a piece of information. Quality is what you should be looking for. And I believe those books have it. Even though I admit an entire book about metaprogramming would be neat.

u/Rhemm · 1 pointr/learnpython

Start with idiomatic python. That's a very good, short book of important pythonic features. Also make sure to learn standart library. You can refer to docs for exact arguments, but you have to know all of functions and what they do. After you can read fluent python. It will show you how python works, python data model and I think overall it's the best python book. Then practice, read others code. When you use some library or whatever don't be afraid to dive into source code. Good luck and happy programming

u/cscanlin · 10 pointsr/learnpython

Sorry you had to go through that. Zed Shaw is pretty widely discredited among a big portion of the community for stuff like this, and the fact that he still wants the world to stay in the past on Python 2.

Automate the Boring Stuff is extremely well regarded as a learning resource on this subreddit, which can definitely not be said about LPTHW. It's free online, but you'll probably only really need to skim through it if you feel pretty comfortable with the basics.

I've also seen Effective Python and Fluent Python recommended as good intermediate books if you want something a little more challenging, but I haven't read either so YMMV.

u/yyzdslr · 1 pointr/learnpython

If you are a beginner coder like myself (someone who procrastinates and is distracted very easily, most of the time by random subreddits :) This method of learning python has helped me tremendously:

  1. Find your nearest book store and locate a copy of ['Learn Python the Hard' Way by Zed Shaw] (http://www.amazon.com/Learn-Python-Hard-Way-Introduction/dp/0321884914)

  2. Find a nice comfortable spot in the Bookstore (DO NOT connect to the wifi)

  3. Go through 5-7 exercises a day initially and then set your own pace as you pick it up.


    Shaw does a great job at breaking it down into small chunks to consume and a lot of repetition typing code so you get familiar and comfortable before he moves on to more difficult concepts; at which stage if you follow the exercises and do the study drills the concepts should be easier to understand.

    Learning python the hard way actually turns out to be the easier way in the end
u/s-ro_mojosa · 4 pointsr/learnpython

Sure!

  1. Learning Python, 5th Edition Fifth Edition. This book is huge and it's a fairly exhaustive look at Python and its standard library. I don't normally recommend people start here, but given your background, go a head.
  2. Fluent Python: Clear, Concise, and Effective Programming 1st Edition. This is your next step up. This will introduce you to a lot of Python coding idioms and "soft expectations" that other coders will have of you when you contribute to projects with more than one person contributing code. Don't skip it.
  3. Data Structures and Algorithms in Python. I recommend everybody get familiar with common algorithms and their use in Python. If you ever wonder what guys with CS degrees (usually) have that self-taught programmers (often) don't: it's knowledge of algorithms and how to use them. You don't need a CS degree (or, frankly any degree) to prosper in your efforts, but this knowledge will help you be a better programmer.

    Also, two other recommendations: either drill or build pet projects out of personal curiosity. Try to write code as often as you can. I block out time three times a week to write code for small pet projects. Coding drills aren't really my thing, but they help a lot of other people.
u/Deslan · 2 pointsr/learnpython

I have two books which I think are excellent, and both do what you describe.

One is Rapid GUI programming with Python and Qt which teaches you GUI programming through examples. It's a really good book, the only thing it lacks is that it's not Python3.

The other one is Python programming for the absolute beginner which lets you create games, one at a time, to teach you Python programming by example. This book also has a continuation called More Python programming for the absolute beginner which continues where the first one left off. I don't have the second book, but they both seem to be rather good and well liked by their readers. Like the Qt book I mentioned, these two are also Python2, which is a bit boring but they will at least get you started.

u/rzzzwilson · 3 pointsr/learnpython

I like Dave Beazley's book, though it may be a little tough for a noob as it's a real reference. The beginning does have a quick introduction to python, but it doesn't try to teach python. The rest of the book is a reference for many of the library modules.

Another one to consider is Doug Hellmann's book. If you like his online Python module of the week site you'll like the book.

Both of the above books are references to using the library modules. Once you know the base language this is the sort of reference you need. If you are still learning base python then you need some other reference until you are ready for books like the two above. The nice thing about Amazon is that you can download a free e-book sample before buying, though it's probably wise to do a final check of the paper version before buying as an e-book can be very different from the paper version (usually worse, but who knows). The Hellmann e-book is particularly bad in this respect.

u/Yawzheek · 2 pointsr/learnpython

Also, to clarify slightly more: YES, I believe it's more than possible to learn Python in a month assuming no previous programming experience.

But again, that doesn't mean you'll understand advanced aspects of the language. I mean that you'll understand basic programming concepts - and especially those specific to Python - such as variables, types, functions, classes, etc.

This is the book I spoke of earlier. I feel that if you read carefully through it, work the examples, do the problem sets, and practice on your own a bit, within a month it would be fair to say you "know" some Python. A good deal, in fact, and it's not a particularly long book. But know, there will be things that still elude you. StackOverflow, Google, Reddit, and maybe a more advanced book after will get you the knowledge you may desire.

Best of luck to you!

u/boloney048 · 1 pointr/learnpython

There are few reasons that fact that mentioned book is published in Poland is quite important to me:
a) I'm Polish so polish is my native language and my English could be better
b) polish issues of popular books about Python are translated very slowly, for example: we don't have polish translation of this famous book yet (older editions were published here)
c) books are quite expensive here, I'm not one hundred percent sure if my interest in Python is worth the investment
d) original editions of books about programming are very expensive here
e) I have read good opinions about this book

u/danny95djb · 1 pointr/learnpython

I'm current using learn python 5th edition and i have to say its been really good covers 2.7 and 3.3, its slightly behind the most current update but a really good book in general.

Also the book teaches you about ides you can choose from and such to help you make the best choice for you.

u/InventorWu · 1 pointr/learnpython

3 approaches:

  1. Whenever you need a function, try to search online and see how other pythonist use for what you intended to do. This way you can quickly accumulate a list of commonly use function in your task/daily job, but usually its lands on a function and a few lines of code, and hence you wont have a good understanding of the overall picture of the libary
  2. Skim through https://docs.python.org/3.6/library/ and see what seems to be useful to you. Be expected more searching needed after locating a function you need. This way you will have a more comprehensive idea what python offers, but reading without an aim is always a pain, be expected you will read a lot of unused functions.
  3. Read some beginner-mid level Python books. I have read though learning python by Mark Lutz, https://www.amazon.com/Learning-Python-5th-Mark-Lutz/dp/1449355730 which is a good intro to a lot of libraries, but also a very time-consuming piece. For the time you spent you will gain a better overall understanding of Python and common libraries as well as detailed examples and codes.
u/Fender420 · 1 pointr/learnpython

Buy this book.
https://www.amazon.com/Python-Crash-Course-Hands-Project-Based/dp/1593276036/ref=sr_1_3?keywords=python+crash+course&qid=1562493760&s=gateway&sr=8-3
I recommend it to everyone. They also sell them at booksamillion, but I prefer the amazon kindle version as it's so convenient to reference when working. It's structured perfectly and it involves projects. The chapters perfectly step you up from lists, to dictionaries, to classes etc.

u/AlSweigart · 2 pointsr/learnpython

WHY DO YOU ASK MAINTAINS THE PROPER ATTITUDE OF A DECENT THING?

:)

> From experience, one book is barely enough to get your feet wet

Ha! Definitely. I keep getting ideas for other books I should write.

I'd recommend the following as good general books to read. They're all good no matter what type of programming you do:

u/cheifing · 2 pointsr/learnpython

As someone who is also learning python, I would recommend: http://www.learnpythonthehardway.org/

Since you already know a bit about python, you'll go through the beginning chapters very fast, but the later ones get interesting. The author also checks the comments very often, answering any questions you may have.

If that seems to advanced for you, or if it gets too hard, I would recommend this book. This book is great if python is your first language, and goes through everything in detail. It also teaches you some of the general programming lingo.

u/Ryegan · 29 pointsr/learnpython

This book is absolutely the most incredible thing I've come across so far. I started out using Code academy but honestly I kept getting bored with how linear it was (In my opinion) and honestly I personally learn better when I can take the bite sized pieces and do what I want with them which is what this book does.

It defines the function simply, gives examples of how it's used and then a visible representation of the function in action, and after that it'll give you exercises (that I like to customize) that you can try yourself. I'm only on chapter four which introduces loops but this book goes everywhere with me along with a journal to physically write down code and then test it when I'm near a computer.

There are other books in this series but I refuse to overwhelm myself with too many books at once.

I'm aware not everyone retains information the same way but if you'd like I can post pictures of the layout of the book so you can get a feel for it. I'm fairly new to Python and it is my first language (although I did look into Javascript, CSS and HTML first but didn't actually retain it as well. I intend to go back to those after I 'master' python.)

Sorry for the book of a comment! I got excited...

u/arsenalbilbao · 9 pointsr/learnpython
  1. if you want to LEARN how to write programs - read "Structure and interpretation of computer programms" on python - SICP (project: you will write an interpreter of "scheme" programming language on python)

  2. if you want to TRAIN your OOP skills - Building Skills in Object-Oriented Design (you will code 3 games - roulette, craps and blackjack)

  3. Helper resources on your way:
    3.1. Dive into python 3 (excellent python book)
    3.2. The Hitchhiker’s Guide to Python! (best practice handbook to the installation, configuration, and usage of Python on a daily basis.)
    3.3 Python Language Reference ||| python standard library ||| python peps

  4. if you want to read some good python code - look at flask web framework (if you are interested in web programming also look at fullstackpython

  5. good but non-free books
    5.1. David Beazley "Python cookbook" (read code snippets on python)
    5.2. Dusty Phillips "Python 3 Object Oriented Programming" (learn OOP)
    5.3. Luciano Ramalho "Fluent python" (Really advanced python book. But I haven't read it YET)

  6. daily challenges:
    6.1. r/dailyprogrammer (easy, intermediate and advanced challenges) (an easy challenge example)
    6.2. mega project list

  7. BONUS
    From NAND to tetris ( build a general-purpose computer system from the ground up) (part1 and part2 on coursera)
u/IcanCwhatUsay · 6 pointsr/learnpython

Have this book, love this book. I highly recommend Automate the boring stuff. This was a much better kickstarter into learning the program language for as it has real world applications you can do. I tend to drift back and forth between the two books all the time.

Also, good to note, the Author is a redditor ( /u/ehmatthes ) AND posted the book here for free but I bought two copies just because I loved it so much. (Kindle and paperback, I'm not crazy!) If these books came in hardcover, or pocket sized I'd probably own four copies then (NUDGE NUDGE WINK WINK HINT! HINT!)

Good post to read and print

https://www.reddit.com/r/learnpython/comments/4y06nq/beginners_python_cheat_sheets_updated/


u/____candied_yams____ · 20 pointsr/learnpython

OOP in python is a bit different than other languages because of how python doesn't necessarily advocate for private data members as in many statically typed languages like C++ and Java. Additionally, the keyword decorator property eliminates the need for getters and setters up front in class design.

I have lots of python books but the two that helped me write pythonic classes were Effective Python (I actually only have the 1st edition) and Fluent python. The first book is probably a great crash course so if you get just one book get that one, but the latter book is good too and goes into much more detail without coming across like a dense reference text.

James Powell also has some great videos on pythonic programming, a lot of which involves OOP style.

u/the_stanley_duck · 1 pointr/learnpython

I like this book:

https://www.amazon.com/Effective-Python-Specific-Software-Development/dp/0134034287

I'd rank myself as an intermediate Python programmer, and it's pretty handy for me. But I can see it being great for beginners as well, as it introduces a few advanced topics without delving too much into them. It mostly provides specific, functional usages of Python in real-world development.

u/SnowdogU77 · 7 pointsr/learnpython

Just to add some diversity to the potential suggestions, if you are trying to get into programming and are using Python as your gateway drug, I highly recommend Python Programming: An Introduction to Computer Science by John Zelle.

I wouldn't necessarily recommend it for a pure introduction into Python, as it sometimes avoids the Pythonic Way™ in favor of strategies that are more common, but it is an excellent introduction to CS/programming. The book, and the man himself, are what nurtured my love for CS.

u/perrylaj · 1 pointr/learnpython

This isn't a programming book, or even a strictly computer science book. It's about Code, the history, the mindset, the means of communicating in binary/encoded processes, the evolution of signals. It touches on electronics, computers, coding, communication and so many other things. It's great for getting some history in an enjoyable format and lays some groundwork in understanding the roots of modern computing. I read it after having some years of experience in CS and still learned a lot of neat ways to look at the field from different perspectives.

http://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/0735611319/ref=sr_1_1?ie=UTF8&qid=1418450151&sr=8-1&keywords=code+the+language+of&pebp=1418450154033

Highly recommend it.

u/shaggorama · 2 pointsr/learnpython

I also do a fair amount of NLP and anomaly detection in my work and use python for both. The reason I suggested starting with numpy is because, as I suggested, it is the basis on which everything else is built on.

I learned python before R, then used R for my scientific computing needs, then learned the scientific computing stack in python after building out my data science chops in R. I've found the numpy array datatype much less intuitive to work with than R vectors/matrices. I think it's really important to understand how numpy.ndarrays work (in particulary, memory views, fancy indexing and broadcasting) if you're going to use them with any regularity.

It doesn't take a ton of time to learn the basics, and to this day the most pernicious bugs I wrestle with in my scientific (python) code relate to mistakes in how I use numpy.ndarrays.

Maybe you don't think it's that important to learn scipy. I think it's useful to at least know what's available in that library, but whatever. But I definitely believe people should start with numpy before jumping into the rest of the stack. Even the book Python for Data Analysis (which is really about using pandas) starts with numpy.

Also, I strongly suspect you use "out of the box" numpy more often than you're giving it credit.

u/vinotok · 1 pointr/learnpython

(edit, books are not for beginners and black hat has better reviews)

There are two books, not sure if they are too advanced and I think both are writen for python 2.7 but they are more or less on the subject, one is called 'Gray Hat Python' and another 'Black Hat Python'

https://www.amazon.com/Gray-Hat-Python-Programming-Engineers/dp/1593271921
https://www.amazon.com/Black-Hat-Python-Programming-Pentesters/dp/1593275900/

You could read reviews of these two books to see if this would be a good starting point. Othervise I would search youtube for keywords like 'python network security' and similar...

u/thatslifeson · 6 pointsr/learnpython

That's because the explanations aren't very good. You aren't alone in that regard. As one other suggested, there is Think Python.

I would also suggest these:

u/its_joao · 1 pointr/learnpython

You see, python is a very simple language that doesn't require you to annotate everything line by line. You might be better off brushing up your general python knowledge befire jumping into projects. This will save you time having to read or looking for comments to understand the code. Also, consider looking at the requirements.txt file for the imports of a particular repo. It'll tell you what packages are being used and you can then Google their documentation.

I'd definitely recommend you to read a book about python first. Python for Data Analysis: Data Wrangling with Pandas, NumPy, and IPython https://www.amazon.co.uk/dp/1449319793/ref=cm_sw_r_cp_apa_i_U38gDb4RE5933

u/c3534l · 2 pointsr/learnpython

I get quite a lot from books, reading them, working through problems when I need to. But if I could go back in time and tell myself which books I should read, I'd go with (in order):

u/commandlineluser · 1 pointr/learnpython

So there are several things going on here.

First up is amazon checks the User-Agent header sent by your http client.

››› r = requests.get('https://www.amazon.com/gp/product/1593275994/')
››› r.status_code
503

If you look at the actual html response it contains stuff like:

<p class="a-last">Sorry, we just need to make sure you\'re not a robot.

It's some sort of "captcha" because they know you're using requests.

To avoid this issue - you can change the default User-Agent to "look like a real web browser"

››› r = requests.get('https://www.amazon.com/gp/product/1593275994/', headers={'User-Agent': 'Mozilla/5.0'})
››› r.status_code
200

We can do some basic checks to see if offer-price and buyNewSection are contained in the response.

››› 'offer-price' in r.text
True
››› 'id="buyNewSection"' in r.text
True

So let's try beautifulsoup

››› soup = BeautifulSoup(r.text, 'html.parser')
››› soup.select('#buyNewSection')
[]

?!?!!?!?

The default html.parser that comes with Python doesn't always work "correctly" - it doesn't always handle "broken" HTML

If you put the amazon link through the W3C validator https://validator.w3.org/ you'll see it has tons of "violations" - i'm not sure which one is responsible for breaking html.parser - but it does.

The 2 other common parsers to use are html5lib or lxml - you'll have to install those if you don't already have them.

››› soup = BeautifulSoup(r.text, 'html5lib')
››› soup.select('.offer-price')
[<span class="a-size-medium a-color-price offer-price a-text-normal">$21.00</span>]
››› soup.select_one('.offer-price')
<span class="a-size-medium a-color-price offer-price a-text-normal">$21.00</span>
››› soup.select_one('.offer-price').get_text()
'$21.00'

.select_one() can be used if you only want the first match.

u/fernly · 23 pointsr/learnpython

Not personally familiar with it, but a quick Amazon search shows that the same authors have written essentially the same book for different languages: Data Structures and Algorithms in Java, ...in C++, ...in Python. However it is confusing to do this search as there are several other books that use the same words, "Data Structures and Algorithms" but they are by other authors.

Using the "Look Inside" feature I note that in the intro, they say the Python version is improved over the others in several ways. Scrolling to the beginning of chapter 1 they say the book is based on "Python 3.1 and later". It is good that in 2013 they committed to Python 3, but it is now 6 years and 6 dot-versions behind the state of the art, including the async features and several others. It would be good if they'd rewrite it to use 3.8 and all its features.

Scrolling on I am not impressed with their pedagogy. They dump a lot on the student in the first few topics, bouncing between the assignment statement to class methods and mutability. So many concepts so fast, with no code to make them real or show their application. The student is going to be memorizing a whole list of terms and definitions without ever applying any of them. Jeez, they even introduce the frozenSet class before the dict, and still without a single executable example. Expressions and operator precedence, you meet every operator and reserved word in the language in what is called a "Python Primer" section. Lots of luck remembering all that, student, when you need it.

And on and on: you basically have to learn the entire language, functions, argument passing, the entire list of builtins, I/O operations, try/except/raise, comprehension syntax! -- and you have not written one line of code yet.

Based on this admittedly cursory review, I would not recommend this for either a class or for self-study. Since you've had a fair amount of experience, try Python 201 which gets into the use of the standard lib modules. Or Doug Hellman's Python 3 Standard Library by Example.

u/Andrew_Shay · 3 pointsr/learnpython

The book Clean Code will help with improving your code in general.

Head First Design Patterns is great! But in Java. The patterns still apply to Python though.

Here are patterns in Python https://github.com/faif/python-patterns

u/Idoiocracy · 1 pointr/learnpython

Out of curiosity, what is going through your mind when 24-tabling? Can you even keep track of your opponents and their tendencies, or are you mostly playing your own cards and on autopilot? Do your hands look like that of a pro Starcraft player hopped up on caffeine with 300 apm? I'm just a casual poker player and even 9 tabling play money tables seemed frenetic.

As far as Python goes, if you are conducive to learning from a book, I recommend Python Programming: An Introduction to Computer Science, 2nd Edition. There's a pdf copy of the 1st edition if you want to preview before buying.

u/illums · 2 pointsr/learnpython

Similar situation here. I have been studying for 4 months now on most free time (avg: 15 hr/wk). 3 days ago I started codecombat.com and have made it half way though that game. It is all starting to come full circle and beginning to really grasp the concepts. It is previous study, and code combat that has brought me to my current level of understanding of python.

Books I have read:

Code: The hidden language of computer hardware and software:

https://www.amazon.com/Code-Language-Computer-Hardware-Software/dp/073560505X/

​

Automate the Boring Stuff with Python: Practical Programming for Total Beginners:

https://www.amazon.com/Automate-Boring-Stuff-Python-Programming/dp/1593275994

​

Android App::

SoloLearn:Python:

https://play.google.com/store/apps/details?id=com.sololearn.python&hl=en_US

​

Youtube:

Python programming in one video:

https://www.youtube.com/watch?v=N4mEzFDjqtA

I have probably watch this 25 times in the last 4 months. Can about recite the whole thing now. haha

​

Game:

CodeCombat

codecombat.com

​

Online Class:

https://www.edx.org/learn/python

​

I have used all of these to different degrees of completion. I think if I had it all over to do again I would go in this order.

  • Code: the hidden language of computer hardware and software
  • Code Combat
  • Solo learn android app
  • Automate the Boring Stuff
  • EDX learn python class
  • and the special sauce of mixing in the the 45 minute video from youtube when possible.

    ​

    I am going to try check.io out after I finish Code Combat.

    ​

    I am not an expert by any means and still have so much to learn. I can feel myself improving, I have no intentions of becoming a full time software developer in the future. I want to learn how to program because I consider it a useful skill. After seeing the amount of time I have put into Rocket League over the past 4 years, I decided to do something more useful with my free time which is limited anyhow, because of work and family. And who knows what the future holds, maybe one day I will be able to make a dollar with my programming skill.
u/shinigamiyuk · 1 pointr/learnpython

If you really want to learn about Python:

This

If you want to get up and running and have a good book to do some practice exercises and build some fun stuff:

This
if you buy the digital version makes sure you email the publisher to get an updated format so the code doesn't show up weird

u/Khrimz000 · 3 pointsr/learnpython

The easiest and simplest book I can think of is this one:

Automate the Boring Stuff With Python - Linked is an older version of the book:

https://www.amazon.com/Automate-Boring-Stuff-Python-Programming/dp/1593275994/ref=sr_1_3?crid=242Z71KMH05DO&keywords=automate+the+boring+stuff+with+python&qid=1572488779&sprefix=automate+the+boring+s%2Caps%2C212&sr=8-3

​

https://automatetheboringstuff.com/ This is a free version, online, however, of the book (old version i believe)

​

https://www.udemy.com/course/automate/ The video course goes almost hand in hand with the book and you can post questions if you get stuck. (Theres also here you can ask questions)

​

https://www.youtube.com/watch?v=1F_OgqRuSdI This is a sample of the video class on Chapter 1. He also has other videos also on his youtube channel. This is so you can sample what he has put together and see it for yourself.

u/gengisteve · 1 pointr/learnpython

A lot of it is just practice, particularly these sorts of things as it takes a bit of time to get used to recasting (at least if you come from other languages). Your solution was just short of being the same as the top answer, except that the top answer took advantage of two python tricks: You can str(an int) to get a string, and strings are iterable, with each character being returned by next.

For a great resource on these sorts of things, check out the python cookbook: http://www.amazon.com/Python-Cookbook-Alex-Martelli/dp/0596007973

u/JFar2012 · 7 pointsr/learnpython

I can vouch Python Crash Course. It touches on everything per chapter and has some pretty awesome projects at the end. Definitely worth checking out.

u/chra94 · 2 pointsr/learnpython

How about https://learnxinyminutes.com/docs/python3/ ? It's a webpage which covers the basics at least. Might be smaller than you want but it's something you can start reading right now at least.

E: Learnxinyminutes has some book suggestions at the bottom which might interest you.

E2: You might be interested in Fluent Python. It goes into the nitty gritty parts of Python and shows (to my knowledge) idioms in Python. Book here

u/dearoldavy · 2 pointsr/learnpython

I really enjoyed Introduction to Computation and Programming Using Python. This is what helped me take the next step I was struggling to make with other material. This book actually supplements the lecture series for this class at MIT. They have an online version of this on EDX, but I liked the lecture series from MIT OCW better.

u/MyNameIsRichardCS54 · 1 pointr/learnpython

I found Learning Python to be very good but I couldn't say whether it's the best.

u/1nvader · 2 pointsr/learnpython

I can strongly recommend Python Essential Reference (4th Edition). It covers both Python 2 and 3. Maybe it's not free, but i think it reads much better than the free books from the sidebar.
The only downside of the book is that it is not written for absolut programming beginners, you need to have programming experience in any other language.

u/doubles07 · 5 pointsr/learnpython

The book Clean Code was recommended to me by my manager when I asked about writing more efficient code. The author goes through best conventions of naming/organizing/etc for keeping your code base super clean and legible. Other people also recommended the Pragmatic Programmer, but I haven't had time to get to it.

u/TartarugaNL · 2 pointsr/learnpython

This great book hammers the point home that, as a programmer, you are an author. So I'd say your education and teaching experience are an excellent starting point. Read the book and be prepared to reason about why you care about code quality. Any potential employer who cares about the future of their business should pick up on this. Be upfront about your (lack of) experience and show that you want to learn. Work on a portfolio of personal projects: noone expects a newbie to have indepth library knowledge, but experience does count.

u/officialgel · 2 pointsr/learnpython

Buy a book and go through it. Programming Python is good and is in the middle of beginner and advanced - Covering MANY topics with excellent examples and detail.

https://www.amazon.com/Programming-Python-Powerful-Object-Oriented/dp/0596158106/ref=sr_1_3?ie=UTF8&qid=1541000040&sr=8-3&keywords=programming+python

u/cismalescumlord · 1 pointr/learnpython

Many programming text books have an accompanying web site where errata and answers to exercises can be found. I haven't read this book so I don't know if that's the case. The rating and reviews would certainly make me consider buying it , even at that price.

Probably the best book I have read on python. Okay, still reading.

u/CaffinatedSquirrel · 2 pointsr/learnpython

Clean Code: Clean Code

Clean Architecture: Clean Arch

​

Just picked these two up myself.. not sure if its what you are looking for, but seem to be very valuable for software design as a whole.

u/inventor_ninja · 1 pointr/learnpython

This book is a great reference for Python an for computing in general. It's worth the money for sure.

u/piefawn · 3 pointsr/learnpython

if you have 30-50 dollars to spare I highly recommend this book

ive been using it taking notes on my computer and doing the exercises it has that you follow along with and I love it!

u/visene · 3 pointsr/learnpython

Effective python is an awesome book if you already know programming or if you already know python.

https://www.amazon.com/Effective-Python-Specific-Software-Development/dp/0134034287/

u/takethecannoli4 · 24 pointsr/learnpython

Sure. But stay away from Code Academy, dude. It's buggy, slow and doesn't teach you how to code and run programs on your machine. You should be coding on your actual environment, not on some shitty server. Automate the Boring Stuff with Python is much better - and free. It also has an Udemy course. Python Crash Course is another good option.

u/Anticode · 63 pointsr/learnpython

Python Crash Course is a great resource. It starts from the basics and slowly works its way up with little mini-projects along the way to show you what you're actually doing.

Most programming books feel like this. But this one feels like this.

If you have some experience already, it may feel a bit slow at first, but just stick with it and do the little silly projects. "Yeah, yeah... I know how to print("things")..." Just do it anyway and move on.

For each mini projects try 'screwing with it'. Change the conditions/variables and see how the output changes. If it is asking you to pick the 5th letter in a string, try picking the 2nd letter too. Try picking the 6th character in a 4 letter word.

I would almost guarantee that halfway through you'll start to get some little ideas for combining past chapters with new ones - I strongly encourage you to waste some time doing that. Did you just learn about strings? Now loops? Combine them! If the string is longer than 5 characters, find the 6th character. Else find the 2nd character.

Eventually it moves onto some more complex projects, teaching you the basics along the way. The idea is that the book teaches you the basics, from the basics, with examples for each that you get to try.

u/alpha_hxCR8 · 3 pointsr/learnpython

Object oriented programming is a deep topic.

If you are looking for a simple introduction, I found Chapter 8 of this book, which is also used for the MIT Intro to Programming using Python pretty good.
https://mitpress.mit.edu/books/introduction-computation-and-programming-using-python-0

If you want to dive deeper, these 2 books have good descripts of OOP and other fundamentals of Programming. However, these are not specific to Python, but are probably the most recommended books in programming:

  1. Clean code: https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882

  2. Code Complete: https://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670
u/snmdbc · 1 pointr/learnpython

I agree with this guy. I played with a lot of the online tutorials before I just got a book and worked through it. Then I bought a second book that focused on a different area, etc ad nauseam.

I'd recommend starting here:
https://www.amazon.com/Python-Crash-Course-Hands-Project-Based/dp/1593276036?SubscriptionId=AKIAILSHYYTFIVPWUY6Q&tag=duckduckgo-iphone-20&linkCode=xm2&camp=2025&creative=165953&creativeASIN=1593276036

u/jaydoors · 2 pointsr/learnpython

Other libraries and functions!

I think I have a similar perspective to you, of having loose ends in my mind until I know what's underneath all of it. It helped me a lot to learn about what computers are, underneath. It's 'just' simple electronics - circuits which can be powered on or off, and which can affect other circuits. I highly recommend this book for a good explanation right from the bottom, all the way up.

In terms of making windows - when you get down to it: the screen is a bunch of pixels, each of which is represented in the computer's memory, and which the screen hardware effectively reads, in order to generate an image (eg first pixel colour while, second colour blue, etc). Some program on your machine will have arranged for this memory to hold information that gives the right colour pixels in the right place to give the window you expect.

u/CrPlunk · 2 pointsr/learnpython

I recently bought this book, and Decided to return it after reading this thread and instead bought Python Crash Course.It includes a Game, a WebApp, and a Data Visualization Program as final progects that you can do in any order! Python crash course unlike the former covers code in python 3.0, and (when needed) addresses python 2.7 differences.
i have yet to really start in on it as I'm currently Learning C# but comparing the two i would say this book is Much more beginner friendly (LPTHW is actually a little condescending) what i appreciated most about Python crash course is at the end of each chapter he gives you multiple ideas for simple programs so you can start coding from memory right away! this is the most important thing a book can teach you, i think!

u/AtomicWedgy · 2 pointsr/learnpython

If you're looking for an intro to programming in Python I would suggest Introduction to Computation and Programming Using Python For a general language reference Python Essential Refernce For an introduciton to the included modules The Python Standard Library by example which includes a lot of simple code examples. The book Core Python Application Programming is a great subset of the above books with less over all coverage but greater detail in the example code. And last but not least, for advanced algorithm info Annotated Algorithms in Python

u/ewiethoff · 1 pointr/learnpython

Sometimes it helps to be an old fart who has read excellent old books by Alex Martelli: Python in a Nutshell and Python Cookbook.

u/iAbortedFetus · 2 pointsr/learnpython

There has been many sources. I'll just copy and paste my comment above regarding some of the more helpful sources I've come across.

> I'd say Corey Schafer's YouTube channel has been a huge help with visualizing and understanding the basics.

> Fluent Python by Luciano Ramalho has had an impact on me as well. There's a lot of advanced topics in that book that's out of my level, which I try my best to understand, but there's also tons of good examples for beginners to pick up on.

> I've watched hours of CS lectures regarding python. This lecture by Raymond Hettinger helped me break out of some bad practices.

u/ehmatthes · 1 pointr/learnpython

Here's the Amazon link, or if you're interested you can order direct from the publisher as well. It has worked quite well for many people, from all kinds of backgrounds.

u/weo_af · 2 pointsr/learnpython

The Django Girls Tutorial is good.

I learned with Python Crash Course which is especially good if your still starting out with Python as the book is mostly about just Python and the Django project is one of the end projects. Not sure if it's been updated for 2.0 though.

Also the Django Docs are very good.

u/the_battousai89 · 10 pointsr/learnpython

Im currently working through Python Crash Course . Im finding it to be great beginner material, and I have no experience whatsoever in programming. Also, go to the Python website. They seriously have a tremendous amount of free resources available. Hope this helps.

u/DoktorRF · 1 pointr/learnpython

Learn Python the Hard Way was written a long time ago. The most recent edition of the book was released about one year ago. Since then, many of the top downloaded packages have been updated to support Python 3: currently 165 of 200 of the top packages support it.

There isn't a strong reason for beginners to start with Python 2, unless they absolutely need a Python 2-only package.

u/ninety_hex · 2 pointsr/learnpython

The learning resources in the wiki have a section for experienced programmers new to python which may be useful. I came to python from C and found David Beazley's book useful. It has a compressed introduction to python before diving into the standard library, a bit like K&R.

u/JayJay-101 · 1 pointr/learnpython

Hey everyone, I'm looking into learning python as my first programming language. I have had very little experience with programming and I was wandering if this book is worth getting even though it is 6 years old now? Cheers! https://www.amazon.co.uk/Python-Programming-Absolute-Beginner-Dawson/dp/1435455002/ref=sr_1_1?ie=UTF8&qid=1468587952&sr=8-1&keywords=python+programming+for+the+absolute+beginner

u/megazver · 6 pointsr/learnpython

You try the Invent Games with Python / Making Games with Python books, if dipping your toes into gamedev sounds fun.

I am working through Python Programming For the Absolute Beginner and that also has a focus on game-style projects. The first one will probably be a bit too easy for you, but More PPFtAB might be something that interests you.

u/rbvm1949 · 2 pointsr/learnpython

Thank you, would it be better for me to do Python Principles over a book like 'Python Crash Course'?

u/KlaireOverwood · 3 pointsr/learnpython

There are books and articles on the subject (recommendations welcome).

A good advice is to keep in mind (or imagine) that the code will have to be changed. Maybe in a year, maybe not by you - this is very common in "real life". For example, of you have 128 of something to process or a limit of 128 that appears often, write N = 128 and then use only N, this way, if/when the limit changes, you'll have to change in one place. Keep code as modular as possible: if there is getting data, processing the data and displaying the data, keep these as separated as possible - no processing during displaying. This way, if/when you'll have to display it otherwise or somewhere else, you'll change the displaying code, but the processing will stay where it was: out of sight, out of mind.

Then there's code review, not for the faint of heart, as it's 99% negative feedback, because it lists things that need to be changed and improved and doesn't focus on the good ones. But this is very "real life": you can't get attached to your code, it will be ciritised and it will be deleted, it's a stepping stone and not a work of art. (Take pride in what the project does and the difficulties overcame. It can be a challenge to keep your head up high in this job, since you're always working on the things than need fixing, not the ones that are done and working.) If you want, you can send me a sample to review.

Finally, the appropriate xkcd.

u/Economy_Peanut · 1 pointr/learnpython

By the way..If you'd want to try out Object orientation...You could try the book Python for Absolute Beginners Third edition by Michael Dawson. It got an awesome Chapter on OOP ,taking thing step by step.

u/lucidguppy · 1 pointr/learnpython

Step one - write a big function.

Step two - split this big function into smaller functions to make each easier to understand.

Step three - see that you're using the same values over and over - and passing them to the split up functions.

Step four - extract those common variables into a class.

Step five - decide which functions purely relate to those data types - which change the values - those become methods in the class. The associated methods to a class should really only have one reason to change.

Think of classes as full computers - that are stripped down to help you solve one problem - you feed it info - and are only given four or five buttons to do something.

Note - you don't need OOP - but you'll end up passing in the same data structure as the first argument to a set of 4 or 5 functions - C does it all the time. OOP makes it easier.

End: Go read clean code.

u/furas_freeman · 3 pointsr/learnpython

"Automate the Boring Stuff" and other books the same author are free online - http://inventwithpython.com/


There are other free books for beginners

u/get_username · 4 pointsr/learnpython

This 100 times over.

The only way to really learn programming is to pay with it in sweat and frustration. If you can hack together a little project. You just learned a lot.

if you try to maintain that project that you just hacked together. You'll learn even more (and why every choice you originally made was bad).

When you're just starting out don't focus necessarily on writing the perfect, best code every time. As "Uncle Bob" Martin says "In order to write clean code, you must first write dirty code - then clean it"

Step one: Get your hands dirty...(and try out a project)

u/Rinnve · 16 pointsr/learnpython

You should read this book. The best explanation of how computers work I know of.

u/deltrons_ · 2 pointsr/learnpython

I've been using this book
as an intro to learn some Python and a nice mix of CS concepts and a bit of stats. It's the Python 3 version of the book that grew out of this online MIT course.

I'd say its approachable to both CS and python beginners, but if you're entirely new to coding it may move a little fast. But this is great next step after something like Codecademy's or DataCamp's Python courses.

u/nbitting · 1 pointr/learnpython

This book is by Wes McKinney, the author of Pandas. It's a great resource. https://www.amazon.com/Python-Data-Analysis-Wrangling-IPython/dp/1449319793

u/Musaab · 1 pointr/learnpython

May I suggest Mark Lutz Learning Python and Programming Python. (in that order. You'll get where you need to be and you'll be happy getting there.

u/jacobisaman · 2 pointsr/learnpython

I would recommend reading a book like Clean Code. It talks about writing high quality and structured code.

u/5larm · 1 pointr/learnpython

> where do I start?

What's your learning style?

u/blackdrago13 · 6 pointsr/learnpython

Try Learning Python by Mark Lutz. It provides a comprehensive, in-depth introduction to the core Python language (Support Python 2 and 3). It's a hefty read, 1648 pages, only to discuss the about the core of Python.

Or his Python Pocket Reference might suits you better.

u/mapImbibery · 3 pointsr/learnpython

I wanna say that Wes mentions R in his book but I'm not sure. I know numpy and pandas are pretty dang fast though, it's the statistics that Python isn't so great with.

u/snakesarecool · 8 pointsr/learnpython

That book is designed for experienced programmers in either another language or with Python to dive deeper. It isn't meant for pure beginners. I believe the author does have an "except for the brave" caveat, but if you are brand new to programming it isn't the best book to go with.

Take a look at Python Programming: An Introduction to Computer Science by John Zelle. It is used as a computer science 101 textbook in several places. It teaches Python in the context of basic computer topics, so it isn't just focused on the language.

http://www.amazon.com/Python-Programming-Introduction-Computer-Science/dp/1590282418

Also, find practice projects to work on while you're learning. The Zelle book has a good amount of homework problems. Codecademy and Python Batting Practice will also take you pretty far, but you'll need to come up with something on your own.

u/serzkawpoije1 · 6 pointsr/learnpython

This is something simple that could be accomplished with most languages, and it's very simple to do in Python.

I believe Automate the Boring Stuff covers everything you'd need to accomplish the task.

u/gold328 · 3 pointsr/learnpython

This set me up for my first term in uni where we learnt python: http://www.amazon.co.uk/Python-Programming-Absolute-Beginner-Dawson/dp/1435455002.
It begins right at the begining and makes learning fun as you work your way through the book making games and by the end you would have made a game with a fully functioning GUI.

u/InkyPinkie · 1 pointr/learnpython

If you don't mind answering, can you tell me whether this book is a good way to learn OOP in Python? Or is a whole book dedicating to OOP an overkill?

u/terraneng · 1 pointr/learnpython

While not Python specific (it's in Java) this book is very good. Clean Code: A Handbook of Agile Software Craftsmanship

u/uhkhu · 11 pointsr/learnpython

Pandas is a well-known library for data analysis. Very good tutorial.

Good book on Pandas

Good Udemy Course for Python

u/[deleted] · 1 pointr/learnpython

These are the two books that I learned python from and I highly recommend them:

Python Programming for the Absolute Beginner

Game Programming: The L Line, The Express Line to Learning

Both of these books teach you to program your own computer games, starting with the basics and then progressing into tkinter and pygame.

u/nagracks · 1 pointr/learnpython

I am Python beginner too and I would say Python Cookbook is a very nice book. You should try it.

u/tangerinelion · 3 pointsr/learnpython

Personally, I've found this book to be pretty good. It assumes knowledge of Python but does not assume knowledge of OOP.

u/_Mega_Zord_ · 2 pointsr/learnpython

I think this two It's very good for beginners: Automate the Boring Stuff with Python and Python Crash Course. And this guy, his YouTube channel is amazing sentdex

u/RodionGork · 2 pointsr/learnpython

Well...

http://www.amazon.com/Learn-Python-Hard-Way-Introduction/dp/0321884914

However you'd better get used to work with documentation in electronic form. Besides other thing it allows you fast browsing and searching over the text.

u/BobBeaney · 2 pointsr/learnpython

Oh, definitely learn the correct Python 3 idioms. You might want to augment your learning resources with the latest edition of The Python Cookbook which has been updated to Python 3. It's not free but well worth the price!

u/driscollis · 1 pointr/learnpython

You could use Doug Hellman's "The Python Standard Library by Example" (https://www.amazon.com/Python-Standard-Library-Example-Developers/dp/0134291050). It has a Python 3 version. I have a book called Python 101 (https://python101.pythonlibrary.org/), although it's not really a reference...you might find it helpful though.

u/C385 · 5 pointsr/learnpython

I found the first couple of chapters of Programming Python by Mark Lutz helpful

https://www.amazon.com/Programming-Python-Powerful-Object-Oriented/dp/0596158106

u/insec99 · 2 pointsr/learnpython

http://www.amazon.com/Learning-Python-Edition-Mark-Lutz/dp/1449355730
Learning python by Mark Lutz is another exceptional book for python beginners would absolutely recommend it.

u/wired41 · 1 pointr/learnpython

Thanks for the info. It's a 9 week course that ends on November 1 so I am guessing the next course would start that week or the week after. I do want the certificate so I think I will wait. In the mean time, I will check out sentdex's pythonprogramming site.

After the MIT course, I was thinking of moving onto Effective Python, but I am not sure about the jump in difficulty. Would that be a good idea?

u/astrokeat · 6 pointsr/learnpython

I recommend Python for Data Analysis (Holy shit! That's the title of your post!). It's written by the author of Pandas and I have found it incredibly straightforward and helpful.

u/yawpitch · 6 pointsr/learnpython

Just gonna say it; if you're not using function and/or class definitions in every file then you haven't learned Python or programming. Not yet.

Most of professional programming is maintaining code, usually in concert with others; you must be using factorization primitives -- in Python that's functions, classes, and modules -- to write code that is even testable, which is the start of being maintable.

I would suggest starting with a book like Clean Code.

u/Not0K · 5 pointsr/learnpython

If you would like a really in-depth explanation, check out Code.

u/Crath · 2 pointsr/learnpython

I recommend this book to everyone who asks about programming or learning python

Python for the Absolute Beginner

u/Ran4 · 1 pointr/learnpython
  1. Read pep8 - the official python styleguide and format your code according to it. You can run the flake8 tool on your code to get an error report.
  2. Read the book Clean Code by Robert Cecil Martin. It's a classic, and offers tons of great advise.
u/Junaos · 1 pointr/learnpython

No problem :) If you want to read a little bit further on why this happens, take a look at Two's Complement, which explains a bit more how this works, and why it works, at the binary level.

Also, this book does a much better job explaining these concepts than I ever could.

u/Highflyer108 · 1 pointr/learnpython

Well I found the book for €25 so I decided to go ahead and buy it. And that link is to the first edition btw, a second edition was released this June so I hope if there was any formatting issues with the non-kindle version, they're fixed now.

u/Eviltape · 1 pointr/learnpython

It seems that the O'Reilly book Programming Python literally has a Hello World C extension example in Chapter 22, as well as a more traditional book-ish walk through what using C in Python actually entails.

u/idoescompooters · 1 pointr/learnpython

Agreed. If you must go with a book, there's always http://www.amazon.com/Python-Programming-Absolute-Beginner-3rd/dp/1435455002 .

You could also try http://inventwithpython.com/pygame/ and/or http://inventwithpython.com/index.html , which you can always download a PDF of(That's what I did).

u/Wonnk13 · 6 pointsr/learnpython

the python cookbook has some neat projects, but it's a bit outdated with python 2.4.

u/Coding_Startup · 1 pointr/learnpython

Grey Hat Python is an interesting book I have on the subject. It is a little complex so I put it off for now but it might be just what you need.

u/xiongchiamiov · 2 pointsr/learnpython

Your comment was removed automatically by the reddit spam filter because you used a Google redirect link instead of https://www.amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882 directly. Make sure you visit the page first before copying the url, as Google likes to pollute search result links like that.

u/aangush · 1 pointr/learnpython

I am a beginner in Python, and I have been learning through a book called Python Crash Course, by Eric Matthes. I highly, highly recommend this book to anyone who wants to learn python, but also learn how to write effective programs, and understand how to interpret programming problems. Eric Matthes takes a project-based-learning approach, and provides lots of coding exercises throughout the book, and you can find the answers for all of these on the book's website. Here is the link to the book on amazon.

u/smeagol13 · 2 pointsr/learnpython

Just for the exercises, I'd recommend Mark Lutz's Learning Python. Normally, I wouldn't recommend it, but since you ask for exercises, that's the only Python book I've read that's got exercises.

u/slowpush · 8 pointsr/learnpython

You only need two

Python Tricks

https://dbader.org/products/python-tricks-book/

Effective Python

https://www.amazon.com/Effective-Python-Specific-Software-Development/dp/0134034287

​

Everyone recommends Fluent Python, but I think it's a little too dense for an intermediate book. You won't appreciate the book until much later.

u/grandzooby · 11 pointsr/learnpython

This book, "Python for Data Analysis" is coming out in October on Amazon, but PDFs might be available directly from O'Reilley if you pre-order. It's by Wes McKinney, who was apparently involved with pandas and has a blog about doing quant analysis with Python:
http://blog.wesmckinney.com/

You might find what you're looking for in some of his stuff.

u/NextEstimate · 3 pointsr/learnpython

Amazon doesn't like web scraping without permission. I would just use camelcamelcamel to get the same information minus the hassle:

from bs4 import BeautifulSoup
import requests
headers = {'User-Agent': 'Mozilla/5.0'}
r = requests.get('https://camelcamelcamel.com/Automate-Boring-Stuff-Python-Programming/product/1593275994',headers=headers)
print(res.statuscode)
> 200

price = r.text
soup = BeautifulSoup(price,'html.parser')
soup.find('span', class
='green').string
> '$24.45'

u/create_a_new-account · 2 pointsr/learnpython

Classic Computer Science Problems in Python
https://www.amazon.com/gp/product/1617295981

Introduction to Computation and Programming Using Python: With Application to Understanding Data (The MIT Press) second edition Edition
https://www.amazon.com/gp/product/0262529629

Python for Programmers: with Big Data and Artificial Intelligence Case Studies
https://www.amazon.com/gp/product/0135224330

Problem Solving with Algorithms and Data Structures Using Python
https://www.amazon.com/gp/product/1590282574

Python Programming: An Introduction to Computer Science, 3rd Ed.
https://www.amazon.com/gp/product/1590282752

u/Donnersebliksem · 1 pointr/learnpython

Someone else on this sub recommended Python crash course which I just recently got and I have found that it is thorough and helpful so far. That would be my recommendation.

u/PineCreekCathedral · 3 pointsr/learnpython

Harry Potter & The Chamber of Secrets has a lot of python in it.

For reals though, I liked Python Crash Course.

u/CreepyStepdad · 2 pointsr/learnpython

related question- I inherited a couple books, I could use some advice.

I'm about 2/3 through Think Python, I am working through the University of Michigan Programming for Everybody course (and the book: Python for Informatics) and the Rice University An Introduction to Interactive Programming in Python Part 2 (both on Coursera)

I inherited Introducing Python, Fluent Python, Python 3 Object Oriented Programming, and Effective Python

Which one should I jump into after I finish Think Python?

u/LucidOndine · 6 pointsr/learnpython

The Python Cookbook -- a new version is expected in December.

u/stefca · 1 pointr/learnpython

I have been using Python Programming for the Absolute Beginner and the exercises on DataCamp to learn Python for data science.

u/jungrothmorton · 4 pointsr/learnpython

Fluent Python. This book took my Python and coding in general to the next level.

u/Krudflinger · 1 pointr/learnpython

Try out python koans for the basics.

Once I got that out of the way, I grokked through Fluent Python.

u/YUM_BlueberryMuffins · 4 pointsr/learnpython
  1. Code more.
  2. Watch Raymond Hettinger videos on youtube.
  3. Watch David Beazley videos on youtube.
  4. Read Fluent Python.
  5. Podcasts? Talk python to me.
  6. Code more again.
  7. Repeat.
u/vivepopo · 1 pointr/learnpython

http://www.amazon.com/Python-Programming-Introduction-Computer-Science/dp/1590282418/ref=sr_1_1?ie=UTF8&qid=1453495465&sr=8-1&keywords=python+programming


This book really lays into the foundations of not just Python 3 but also the mindset of oop. I've been reading it for the past few weeks and its helped me out immensely.

u/Fight_till_the_end · 2 pointsr/learnpython

Hi,

I'm not an expert but this worked for me.

+++++++++++++

import bs4, requests

headers = {"User-Agent": 'Chrome'}

res = requests.get('https://www.amazon.com/Automate-Boring-Stuff-Python-Programming-dp-1593275994/dp/1593275994/ref=mt_paperback?_encoding=UTF8&me=&qid=%27',headers=headers)

​

soup = bs4.BeautifulSoup(res.text, 'lxml')

​

buy_box=soup.find(id='buyNewSection')

price = buy_box.find('span', class_='a-color-price')

​

print(price.text)

​

+++++++++++++++