Best products from r/Python
We found 121 comments on r/Python discussing the most recommended products. We ran sentiment analysis on each of these comments to determine how redditors feel about different products. We found 281 products and ranked them based on the amount of positive reactions they received. Here are the top 20.
2. Fluent Python: Clear, Concise, and Effective Programming
- O Reilly Media
Features:
3. Code Complete: A Practical Handbook of Software Construction, Second Edition
- Microsoft Press
Features:
4. Clean Code: A Handbook of Agile Software Craftsmanship
- Prentice Hall
Features:
5. SupremeTech 12 x 24 x 0.12 Inch Acrylic See-Through Mirror, 30% Transparent
11 15/16 inch x 23 15/16 inch x 0.12 inch see-through acrylic (approximately 30% transparent). Can be used for a smart mirror, surveillance, or theatrical application. Shatter resistant, unlike glass. Slightly bendable.A two-way mirror is coated with a thin, almost-transparent layer of metal. The re...
7. Python for Data Analysis: Data Wrangling with Pandas, NumPy, and IPython
- O'Reilly Media
Features:
8. Expert Python Programming: Best practices for designing, coding, and distributing your Python software
9. Automate the Boring Stuff with Python: Practical Programming for Total Beginners
- No Starch Press
Features:
11. Python in Practice: Create Better Programs Using Concurrency, Libraries, and Patterns (Developer's Library)
- Used Book in Good Condition
Features:
13. Python Programming for the Absolute Beginner, 3rd Edition
- Get ready to explore the world of music production with Reason 5! This book will help you get up to speed in
Features:
14. Python Crash Course: A Hands-On, Project-Based Introduction to Programming
- Easy to Read Text
- Language- English
- This product will be an excellent pick for you
Features:
15. Cracking the Coding Interview: 189 Programming Questions and Solutions
- Careercup, Easy To Read
- Condition : Good
- Compact for travelling
Features:
16. Head First Programming: A learner's guide to programming using the Python language
- O Reilly Media
Features:
17. The Pragmatic Programmer: From Journeyman to Master
- Save up to 15% when buying these two titles together.
- The Pragmatic Programmer cuts through the increasing specialization and technicalities of modern software development to examine the core process--taking a requirement and producing working, maintainable code that delights its users.
- It covers topics ranging from personal responsibility and career development to architectural techniques for keeping your code flexible and easy to adapt and reuse.
Features:
18. The Python Workbook: A Brief Introduction with Exercises and Solutions
- 4K Ultra High definition capture - 4X the resolution of 1080P
- Improved H.265 compression codec - same filesize as 1080P @ 60fps
- Built-in GPS & Dual band Wi-Fi - change settings and review video on the fly!
- Built-in impact & motion detection - lock in event recordings
- BlackVue over the cloud compatible - view your videos anywhere in the world over the internet
- Operation Temperature: -20 °C − 70 °C (-4 °F − 158 °F)
Features:
Good on you for looking to grow yourself as a professional! The best folks I've worked with are still working on professional development, even 10-20 years in to their profession.
Programming languages can be thought of as tools. Python, say, is a screwdriver. You can learn everything there is about screwdrivers, but this only gets you so far.
To build something you need a good blueprint. For this you can study objected oriented design (OOD) and programming (OOP). Once you have the basics, take a look at design patterns like the Gang of Four. This book is a good resource to learn about much of the above
What parts do you specify for your blueprint? How do they go together? Study up on abstract data types (ADTs) and algorithms that manipulate those data types. This is the definitive book on algorithms, it does take some work to get through it, but it is worth the work. (Side note, this is the book Google expects you to master before interviewing)
How do you run your code? You may want to study general operating system concepts if you want to know how your code interacts with the system on which it is running. Want to go even deeper with code performance? Take a look at computer architecture Another topic that should be covered is computer networking, as many applications these days don't work without a network.
What are some good practices to follow while writing your code? Two books that are widely recommended are Code Complete and Pragmatic Programmer. Though they cover a very wide range (everything from organizational hacks to unit testing to user design) of topics, it wouldn't hurt to check out Code Complete at the least, as it gives great tips on organizing functions and classes, modules and programs.
All these techniques and technologies are just bits and pieces you put together with your programming language. You'll likely need to learn about other tools, other languages, debuggers and linters and optimizers, the list is endless. What helps light the path ahead is finding a mentor, someone that is well steeped in the craft, and is willing to show you how they work. This is best done in person, watching someone design and code. Also spend some time reading the code of others (GitHub is a great place for this) and interacting with them on public mailing lists and IRC channels. I hang out on Hacker News to hear about the latest tools and technologies (many posts to /r/programming come from Hacker News). See if there are any local programming clubs or talks that you can join, it'd be a great forum to find yourself a mentor.
Lots of stuff here, happy to answer questions, but hope it's enough to get you started. Oh, yeah, the books, they're expensive but hopefully you can get your boss to buy them for you. It's in his/her best interest, as well as yours!
>Is there any books you would recommend as a reference not a guide? I have a few bookmarks that have really helped but i'd love a hard copy on hand.
I personally cut my teeth on a borrowed copy of Python Essential Reference - it's basically just a rehash of the standard library (though it's fantastic to have a hard copy, and it sounds like what you want). You can also try this book by Alex Martelli - I have never read it, but Alex Martelli is practically a god in the Python world (as someone who read GoF's Design Patterns, I loved his Python design patterns talk). Reddit also raves about Learn Python The Hard Way, though I have never read it because I erm... "disagree" with how Zed Shaw tends to approach things (to put it mildly), and I think it's a guide as opposed to a reference.
>Oh, and i've been having difficulty using the built in help function and such, is there a guide on how to use it effectively? I seem to struggle finding examples of the code too and how to use the functions and what i believe are called attributes ( the sub functions, e.g. datetime.datetime()),
I assume that the inbuild help you're talking about is the code documentation? This documentation is intentionally brief, so it's not particularly useful as anything but a reminder. You can create your own simply creating a string after you open a function or class;
def foo(etc):
""" This is the documentation for foo().
Triple quoted so that it can safely run over multiple lines"""
blah
As for the terminology; you are correct that they're called attributes. There are two sorts of attributes - methods (functions) and properties (values). It can get very messy/fun when you use the
@property
decorator or toy with__getattr__
/__getattribute__
/__setattr__
, but let's not go there (let's just say that Python can be no-holds-barred).>but i came from PHP where the PHP manual is amazing for a novice/new coder.
Python's online docs are absolutely fantastic. They are a comprehensive reference of not only the builtins and standard library, but also the object model, features, a rather good tutorial, the C API reference, and even heavy stuff like metaprogramming. The only things it's really missing is the really hardcore stuff like
__code__
and__mro__
, and to be honest, that's probably a good thing.>And what is the difference between import datetime and from datetime inport datetime. Does it just allow me to call the attribute as datetime() and not datetime.datetime()?
That's exactly correct.
Just to add another complication, you can also
from datetime import datetime as tell_me_the_time_please
, and then instead ofdatetime()
you can usetell_me_the_time_please()
. The reason this is useful is that sometimes things in modules are named too generically (maybe it'smain()
or something), so you can import part of the module as a different name.If you were serious about wanting some deep as-you-go knowledge of software development but from a Pythonic point of view, you cannot go wrong with following a setup such as this:
Mark Lutz writes books about how and why Python does what it does. He goes into amazing detail about the nuts and bolts all while teaching you how to leverage all of this. It is not light reading and most of the complaints you will find about his books are valid if what you are after is not an intimate understanding of the language.
Fluent Python is just a great read and will teach you some wonderful things. It is also a great follow-up once you have finally made it through Lutz's attempt at out-doing Ayn Rand :P
My recommendation is to find some mini projecting sites that focus on what you are reading about in the books above.
Of course this does not answer your question about generic books. But you are in /r/Python and I figured I would offer up a very rough but very rewarding learning approach if Python is something you enjoy working with.
Here are three more worth adding to your ever-increasing library :)
I like little mini-challenges like this which is why I wrote this out for you. Hopefully you can learn from it as you start your journey in learning Python. I wrote this to be pretty basic (i.e. no cool magic tricks, just straight logical code) so that you'll be more likely to understand what it's doing. I also wrote it down and dirty (no error checking). At any rate, I ran this through a number of different rounds, and finally tried 100 rounds where I got 6 wins and 94 losses, so it is possible to win.
​
You'll need Python3 to run this. There's plenty of room for improvement, such as capturing which rounds were wins and which were losses, doing some averages etc.
​
At any rate, good luck on your coding journey. Take a look at The Python Workbook https://www.amazon.com/Python-Workbook-Introduction-Exercises-Solutions/dp/3319142399 which I found a valuable resource of exercises to do once I had the basics under my belt.
Edit: Fixed bug with cards left count and tweaked with some color so it's easier to review output.
"""
A quick down and dirty (no error checking) game of solitaire with the following
rules:
same value as your count e.g. a seven is flipped on the seventh flip, it's
a match and you start your count over at 1 with a new pile.
you pick up the cards, reshuffle and start over.
flipped is the same as your count, it's a WIN, otherwise it's a LOSS.
"""
import random
class TextColor:
PURPLE = str('\033[95m\033[1m')
BLUE = str('\033[94m\033[1m')
GREEN = str('\033[92m\033[1m')
YELLOW = str('\033[93m\033[1m')
RED = str('\033[91m\033[1m')
ENDC = str('\033[0m')
BOLD = str('\033[1m')
UNDERLINE = str('\033[4m')
def buildDeck():
deck = []
Since this game of solitaire doesn't care what the suit is, we don't
need to define a seven of spades. We only care if on the seventh count
during the laydown whether it's a "card" with a value of seven. All we
need to do is make sure the deck has four of every "card" value.
for x in range(4): # Simulate four suits
for y in range(1, 14): # Simulate Ace through King
deck.append(y)
random.shuffle(deck)
return deck
Prep counters
ldc = 1 # Lay Down Count
piles = 1 # Piles created
wins = 0 # How many games won
losses = 0 # How many games lost
restarts = 0 # How many times no matches were found and a new deck is created
rounds = int(input("How many rounds to play? "))
while rounds > 0:
deck = buildDeck()
print(f"Your starting deck is:")
print(deck)
Start laying down cards
while len(deck) > 0:
for c in deck:
if ldc > 13: # No matches, build a new deck
deck = buildDeck()
print(f"{TextColor.YELLOW}New Deck: ", end="")
print(f"{deck}{TextColor.ENDC}")
ldc = 1
restarts += 1
elif ldc == c: # Match found, start a new pile and reset count to 1
deck.remove(c)
print(f"Count: {ldc} - Card: {c} - {len(deck)} cards left{TextColor.PURPLE} <=== MATCH!{TextColor.ENDC}")
if len(deck) > 0: # We've still got deck left
print(f"{TextColor.BLUE}Current Deck: ", end="")
print(f"{deck}{TextColor.ENDC}")
piles += 1
ldc = 1
else: # ldc == c and no cards left, WIN
wins += 1
print(f"{TextColor.GREEN}** WIN **{TextColor.ENDC}")
else: # Not a match, continue on
deck.remove(c)
print(f"Count: {ldc} - Card: {c} - {len(deck)} cards left")
if len(deck) > 0:
ldc += 1
else: # ldc != c and no cards left, LOSS
losses += 1
print(f"{TextColor.RED}** LOSS **{TextColor.ENDC}")
Round finished
rounds -= 1
print("")
print("")
print(f"Piles: {piles}")
print(f"Restarts: {restarts}")
print(f"Wins: {wins}")
print(f"Losses: {losses}")
+1 for having a descriptive
readme.md
& GIF demos.&nbsp; Do that forever.&nbsp;
I didn't look through your code super thoroughly, but I did notice that you're parsing some settings manually from text files.&nbsp; I recommend using PyYAML for improved ease of use, especially as complexity grows (JSON & INI are also common options, but IMO YAML is the most readable & flexible of the three).
&nbsp;
Here's an example:
settings.yaml
music:
extensions: [".mp3", ".wav"]
path: "home/jackson/Desktop/music"
movie:
extensions: [".mp4", ".mkv", ".avi"]
path: "home/jackson/Desktop/movie"
image:
extensions: [".jpg", ".jpeg", ".gif", ".png"]
path: "home/jackson/Desktop/image"
test_yaml.py
import yaml
def load_yaml(file_path):
with open(file_path, "r") as file:
return yaml.load(file)
settings = load_yaml("settings.yaml")
print(settings["music"])
{'extensions': ['.mp3', '.wav'], 'path': 'home/jackson/Desktop/music'}
print(settings["music"]["extensions"])
['.mp3', '.wav']
print(settings["music"]["path"])
home/jackson/Desktop/music
for file_type in settings:
print(file_type, settings[file_type]["extensions"])
music ['.mp3', '.wav']
&nbsp;
-----
&nbsp;
Aside from that, I recommend reading Clean Code (the video series is great also, I'm working through it now. Videos 0 & 1 are free).
&nbsp;
The script you shared is small enough to where a random person (and/or your future self) can look at it and figure out what's going on without too much effort, but there are some implementations that would be much harder to manage & understand in a larger project (unnecessary global usage, nested loops, large amounts of abbreviated variable names, functions containing multiple streams of logic that would be better situated in helper functions, etc.).
&nbsp;
The resources I mentioned above cover a lot of common pitfalls that lead to unmaintainable code, along with elegant solutions that will help you to write code that is clean/maintainable/reusable/easy to understand/etc.
You can add a clicked method to the class definition of Item, and every instance of the item will then have the method.
Probably, though, you'll want two methods. One that simply determines whether the item has been clicked, and another that does something when the item is clicked.
Probably all items will do SOMETHING if they are clicked, but what they do will be based on the item.
The SuperSprite object in my game engine already has this behavior, so you can use that if you want.
I created the library as part of my book on Python game development:
http://www.aharrisbooks.net/pythonGame/
(look at game engine at the bottom of the page.)
You're welcome to the game engine and everything else on that site whether you get the book or not, but if you're interested, the book is here:
http://www.amazon.com/Game-Programming-Line-Express-Learning/dp/0470068221/ref=sr_1_1?ie=UTF8&amp;qid=1312228492&amp;sr=8-1
Though it never sold very well, it does have outstanding Amazon reviews, so it might be helpful.
Back to your example:
Be sure you're thinking properly about the relationship between instances and classes. Chevy S10 is a class. It describes a whole bunch of trucks. All have various features in common, but the specifics change. All have a start() method, and all have an engine attribute.
However, there's a difference between all trucks and a particular truck. My truck is a specific instance of S10. It has a particular color (black) and a few other characteristics specific to that particular truck. Many of its characteristics come from it being an S10, but I don't drive all S10s, just that one.
There is a mechanism called "static methods" which allows you to assign a method to a class which can be run even if there is no instance of that class available (This is used all the time in Java programming, for example.) I don't think that's what you're trying to do, though.
I would start with some sort of Sprite object. The one that comes with Pygame is pretty weak, so I always add enhancements to it (thus the SuperSprite.)
I would then probably make (at least) two subclasses of supersprite objects - a Player class and an item class.
If you're using my supersprite, there is already a clicked() method that returns True if the item is currently being clicked. Any subclass of supersprite can also read a click.
Your player class will probably need some sort of function to add an item to the inventory. Python makes this much easier than many languages, as the built-in list type is far more flexible than a standard array. It's quite easy to add an item to the list with the append() method.
Write to me directly if you want a bit more help.
-Andy
There are plenty of good books, but the obvious one to mention is The C++ Programming Language 4th Edition. I'm still a relative novice at C++ but the book has been recommended by a lot of people much more versed in C++ myself and it is written by Creator and maintainer of C++.
Also, the book is up to date. Writing good idiomatic C++ has changed significantly over the years and so a lot of older resources will not accurately teach modern best practices.
I also really like his intro chapter. He does a really good job of explaining the best "mindset" to use when learning C++, the reasons he initially wrote the language and how it has grown from where it started to where it is now.
Check the side bar for the online books; LPTHW is a good place to start learning the basics. CodeAcademy is cool because it's interactive, but I didn't really like the Python course and I didn't feel like I learned more than some basic syntax. The ruby one is better, but not by much.
I've been using this textbook to teach myself: http://www.amazon.com/Python-Programming-Absolute-Beginner-Edition/dp/1435455002
It was recommended to me by a friend who took CSCI 101 at PSU with it. He does it project-based; every chapter you complete a working game program, and he steps you through all of it with example programs. Very easy to follow, and the programs are fun to write. I've tried learning coding from textbooks in the past without much success, and I really feel like I'm getting somewhere with this one. Plus, it's python3, which is probably what we beginners should be working with.
I'm on a similar track to you, except I'm re-starting my course of studies. Although I've programmed a lot in other languages, I've decided that for my coursework, I need to be able to use Matlab/Ocatve, R, and Python.
I'm just starting out in all 3 paradigms but with Python I have decided to focus on Python 3 syntax and not Python 2. However that's led to some challenges. Many of the tutorials and books cover v2 syntax, which can make things more difficult when you're just starting out.
I started by learning something "simple" like multiplying two matrices and immediately had trouble figuring out the Python method(s) available. That led to this post:
http://www.reddit.com/r/learnpython/comments/ypog9/matrix_multiplication_in_python_3_with_numpy/
Where I did get some very helpful answers.
I'm also learning linear algebra in the process, which adds its own challenges that you shouldn't have.
I also have a couple books on pre-order from Amazon, though I think you can get the PDF from OReilley now:
Python for Data Analysis and
SciPy and NumPy: An Overview for Developers
Reviews of the pre-prints seem pretty positive and they're not too expensive even if they don't turn out to be very useful.
For you, I would recommend going with python cookbook. It’s organized by type of thing you need to do, and has really rich and useful examples. Also watch any David Beazley videos you can find. You’ll pick up on basic Python syntax really quickly so having a book like this will be a great reference when you need to do something specific.
This question or a variant comes up nearly weekly.
I always try to respond, if one doesn't exist already, with a plug for the module 'Pandas'.
Pandas is a data analysis module for python with built in support for reading Excel files. Pandas is perfect for database style work where you are reading csv files, excel files, etc, and creating table like data sets.
If you have used the 'R' language the pandas DataFrame may look familiar.
Specifically look at the method read_excel: http://pandas.pydata.org/pandas-docs/dev/generated/pandas.io.excel.read_excel.html
main website: http://pandas.pydata.org/
book that I use frequently for a reference and examples: http://www.amazon.com/Python-Data-Analysis-Wrangling-IPython/dp/1449319793
If you're just starting out, you will want to read Learn Python the Hard Way
If you want to learn to do thing the "pythonic" way, I've found that Idiomatic Python is a very good book.
If you already know Python and you want to learn about a wide area of subjects that can be dealt with in Python, I recommend the Python Cookbook. While some cookbooks are somewhat shallow, this book is very different. It provides extensive and very practical information even on complex topics such as multithreading (locking mechanisms, event handling, and so on). It's really worth it.
Also, don't forget to simply read and embrace the pep8 guidelines. They really help you produce good, maintainable Python code.
This is a good book: Python Essential Reference.
If you're looking for gift ideas for new programmer my advice is always one of the three things:
Those three things usually go over well with programmer-types.
Here is my list if you need to become a good programmer with Python as your language of choice.
Follow this order for rigorous course on learning Python thoroughly.
By the end, you will be famished but you will have a very solid base to understand and design code for complex systems. To get more hands on experience, start with any popular open source project and delve into the source code. Don't start with the master branch of the codebase, start the version 1 tag of the codebase and progress through the next version tags and check for changelog and move on.
E.g mitsuhiko/flask
Finally you will have a solid understanding of Python as well as how objects communicate behaviors.
Been using python for 5 years, professionally for 1. I learn new stuff every day that makes my python code more pythonic, more readable, faster, and better designed.
Your first mistake is thinking that you know the "things that every python programmer should know." Everyone has different opinions of what you should know. For example, I work with million+ entry datasets. I need to know about generators, the multiprocessing library, and the fastest way to read a file if it's not stored in a database. A web dev might think that it's more important to know SQLAlchemy, the best way to write UI tests with selenium, and some sysadmin security stuff on the side.
If you're stuck with what to learn, I recommend Effective Python and Fluent Python, as well as some Raymond Hettinger talks. You'll want to go back through old code and make it more pythonic and efficient.
I suggest this book, Code Complete. It has nothing to do with Python and it's pretty old at this point but by reading it, I know for a fact that it has a lot of the same ideals. knowledge, values and tips that my college teachers tried very hard to impose upon me in what is considered one of the best IT college courses in my country https://www.amazon.com/Code-Complete-Practical-Handbook-Construction/dp/0735619670
You can also procure your HR department (or your boss) and share the situation. Tell them you'd like to enroll in some courses to get up-to-speed with everyone else around you, since you don't have the same training as them. Most companies (or at least a lot of them) will offer to pay the entire thing for you too.
What initially caught my attention was the example used throughout the course (a stock portfolio). Using the example below, he walks through different scenarios while increasing the difficulty (goes from scripts, functions, classes including Inheritance, Encapsulation, iterators and Generators, Coroutines, etc), and explains everything along the way.
For example, he’s like what If this was a csv file and I wanted to read it? What if I wanted to create data quality checks? What if I wanted to create a class to handle reading this file? What if I wanted to create a class to output the portfolio in html? Csv file? So on, and so on.
Even though I didn't really understand anything past classes (until I watched the video like 10 times), I was reassured by who was presenting (Beazley seems to be kind of a rockstar in Python community) and ultimately decided that what he was talking about was worth knowing.
https://www.amazon.com/Python-Essential-Reference-David-Beazley/dp/0672329786
example used in course:
name, date, shares, price
AA,2007-06-11,100,32.20
IBM,2007-05-13,50,91.10
CAT,2006-09-23,150,83.44
MSFT,2007-05-17,200,51.23
GE,2006-02-01,95,40.37
MSFT,2006-10-31,50,65.10
IBM,2006-07-09,100,70.44
There might be some code examples or open sourced software online that sort of does what you want. However, I think this is really where your own creativity and imagination comes into play.
Part of the fun in programming for me is exactly to find an elegant or new and simple solution for a real world problem.
P.s. this is a nice book to get you started programming an application using python.
The display is basically a monitor with a pc mounted to the back and the front had this acrylic taped to it so that it reflects and transmits some light Supreme Tech 12" x 24" Acrylic See-Through Mirror, 3mm https://www.amazon.co.uk/dp/B01G4MQ5OW/ref=cm_sw_r_cp_apip_uClgNZZuxvo6v, the facial recognition itself was fairly easy as the library is very well documented and had some code listed that pretty much did all I needed to get the name of the user it was the bit after programming it to log in and display my partner's schedule that was difficult haha
Self-taught programmer here. In my experience my having built real things more than made up for my lack of a related degree (my degree's in journalism). I've never failed to land an interview because I didn't have a related degree and nor has it ever stopped me getting a job.
Some advice:
Good luck!
You (the programmer) will be partially responsible for any memory that crosses from python to C/C++. Python does this by reference counting: https://docs.python.org/3.5/c-api/refcounting.html . It is your responsibility to increase/decrease the reference count of an object as it moves between python and C.
If learning C++ is your goal and you'd like to use Python while doing it, I'd recommend Boost.Python: http://www.boost.org/doc/libs/1_57_0/libs/python/doc/ . The tutorial is good, although it does assume that you have a basic understanding of C++: http://www.boost.org/doc/libs/1_57_0/libs/python/doc/tutorial/doc/html/index.html . I'd recommend reading a book if you want to dive into C++, such as http://www.amazon.com/gp/product/0321563840/ref=pd_lpo_sbs_dp_ss_1?pf_rd_p=1944687602&amp;pf_rd_s=lpo-top-stripe-1&amp;pf_rd_t=201&amp;pf_rd_i=0201889544&amp;pf_rd_m=ATVPDKIKX0DER&amp;pf_rd_r=1C9XVC14E3BDBBF8VKP5 .
Also coming from PHP here, I got the "Python Essential Reference" from David Beazley and I must say that I like it very much. It's not a introductory book on programming - it assumed that you know programming very well and just need to learn the ins and outs of python. It's pretty direct-to-the-point and well written. I highly recommend it. http://www.amazon.com/Python-Essential-Reference-David-Beazley/dp/0672329786/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1261867689&amp;sr=8-1
You should probably be a little more disciplined when writing your code, this book will help with strategies on writing good code: http://amzn.com/0132350882. The author discusses Java, but the same techniques apply to python. Obtaining the mythical 100% code coverage with unit test are a good goal, but writing easy to understand, small functions that are as atomic as possible will let you code your "stream of thought" by segmenting each idea into smaller ones that you can name, keep track of, and test. Don't forget to refactor while you still know what your code means; make it work, make it right, make it readable.
Whereas I don't think Fluent Python woudld give you the "nitty-gritty" parts of Python, I seems like it would be a great book for an experience Python developer looking to polish Python programming.
Disclaimer: I haven't read this book yet, but it is no kidding in the mail on the way to me. Like you, I'm looking to polish certain parts of my Python programming, and just become and all-around better Python developer.
"Python for Data Analysis" is pretty good. It's written by Wes McKinney, the creator of Pandas, so its focus is using Pandas for data analysis, but it does include sections on basic and advanced NumPy features: http://www.amazon.com/Python-Data-Analysis-Wrangling-IPython/dp/1449319793
Alternatively, the prolific Ivan Idris has written four books covering different aspects of NumPy, all published by Packt Publishing. I haven't read any of them, but the Amazon reviews seem OK:
One of the most important lessons in Code Complete is that you don't code in a language, you code into a language. That is, your understanding of the parts of your program needs to be independent of the language you happen to be using. Language features can help you be less verbose, or more efficient, or whatever, but good abstraction is what really matters, and it's always up to you. Highly recommended book for professionals or future-professionals.
Something I hawk whenever I can: Code Complete by Steve McConnell is a huge recommendation. I never learned anything besides like 100-line programs before this, and I basically divide my programming journey into before and after reading this. It's seriously worth reading: you can skip chapters that don't apply to you, but it is one of the best resources on how to manage the complexity shift between small and large codebases.
My condolences on the business (been there, lived through that). Some good, advanced Python 3 books include:
Programming in Python 3: A Complete Introduction to the Python Language (2nd Edition)
A subset of the above - Advanced Python 3 Programming Techniques
Python in Practice: Create Better Programs Using Concurrency, Libraries, and Patterns
Python Essential Reference is great. It has a medium level overview of almost all of the standard library, and has some great explanations of decorators, 'with' statements, generators/yields, functional programming, testing, network stuff, etc...
This book is not Python, but it is great for building more complex stuff. This book covers advanced Python specifically. You should probably read both.
I already knew a few languages before but I found this book to be pretty darn good.
http://www.amazon.com/Python-Programming-Absolute-Beginner-3rd/dp/1435455002/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1267542178&amp;sr=8-1
This is a great resource for the community - thank you for it!
I'm curious as to where the list of books comes from, and how they get categorized. Is that done manually?
In particular, I didn't see Lutz' "Learning Python" on the site, but it is listed in the GitHub issues. That's one I could definitely provide a review of!
If someone is really interested in design practices in Python, here is a great book for that
Python in Practice by Mark Summerfield
That's an OK book, as you can see from the reviews, mostly because he never develops a real game. You might find this page for Game Programming: The L Line to be helpful too -- it has a series of PowerPoint slides that give a Pygame tutorial as well.
Not a bible though, but one of the best books on Python I've read. A lot of real life examples https://www.amazon.com/Fluent-Python-Luciano-Ramalho/dp/1491946008
I think /u/swingking8 was spot on when s/he said to find a project that captures your interest. You'll be using the language and not just following a tutorial.
But, once you have a feel for the syntax, I can't recommend strongly enough that you look up presentations and writing by Raymond Hettinger and David Beazley.
If you learn best by reading before doing, Mark Lutz's Learning Python seems intimidating because of its size. But it's so big because it is both comprehensive and accessible for beginners. So depending on what you already know, you can skip large parts. But if you really understand everything in that book, you are well on your way to being an intermediate level Python dev.
I like these books:
> Expert Python Programming practices
> Python in Practice: Create Better Programs Using Concurrency, Libraries, and Patterns
Yes, I'm halfway into
https://www.amazon.com/Learning-Python-5th-Mark-Lutz/dp/1449355730?ie=UTF8&amp;*Version*=1&amp;*entries*=0
I didn't have to upgrade to win10 , win 7 update was enough
The key to building bigger systems is writing modular code. I don't mean just code made of modules, I mean code in which the module boundaries are in the right places. Code divided into the most meaningful and distinct chunks.
You want to divide areas of responsibility into separate modules, in such a way that each module has a clear, distinct and succinct area of responsibility and the interfaces between modules (the function calls and data passed) are simple and minimal. Finding the right boundaries takes thinking deeply about the problem, and considering different ways to model it. When you get it right, you will find that changing implementation of one part of the code is much less likely to cascade into other areas.
The idea that this is an important way to think about designing a program is called the separation of concerns principle.
Patterns that can help with this include dependency injection which is often required for unit testing, and which forces you to separate modules and aspect oriented programming which deals with modularizing cross-cutting concerns, things like caching, logging and error handling which often show up in many different places in your code and undermine modularity.
Code Complete by Steve McConnell addresses these issues and has lots of helpful advice for dealing with large projects and large systems.
I just read through this in about 2.5 days: https://www.amazon.com/Python-Crash-Course-Hands-Project-Based/dp/1593276036
The first half teaches the basics and the second half has three projects to work. I found it pretty useful.
I've read so many of those Reilly books and they are all super dull and sometimes hard to follow. Best python book I came across is this Python Crash Course: A Hands-On, Project-Based Introduction to Programming https://www.amazon.com/dp/1593276036/ref=cm_sw_r_cp_apa_i_OByyCbMTJD8GC
Get the Python Essential Reference by David Beazley. I was in the same boat as you several years ago. I probably read 5-6 python books that were aimed at experienced developers, Dave's book is BY FAR the best that I found.
He just started working on the 5th edition, so the 4th edition is getting a little long in the tooth (python 3 was a new thing back then), but I can still whole-heartedly recommend it.
Novice here. I bought the Python Essential Reference at the advice of this thread when I ran into some frustrations with O'Reilly (Learning Python, 4th Ed). They both have their issues. Essential reference is written for a higher-level audience, but I think it does a better job illustrating concepts by example. By contrast, the O'Reilly is more oriented toward beginners, but it's weirdly averse to including actual code snippets, so you get very little immersion in the syntax. Also the organization of the contents is extremely arbitrary, such that if you read it in a straight line you'll encounter an example of a nested dictionary prior to learning basic dictionary operations, and list comprehensions before lists. Steer clear.
Python is a good language to learn and you can do most things (as a beginner) on an iPod I imagine. However, I would recommend getting an actual computer to go further and do more learning proper tools for development and exploring new libraries will probably be difficult to do on an iPod (not to mention trying to write large programs). Also I would recommend this book http://www.amazon.com/Python-Programming-Absolute-Beginner-Edition/dp/1435455002%3FSubscriptionId%3DAKIAILSHYYTFIVPWUY6Q%26tag%3Dduckduckgo-d-20%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D1435455002 I get it for everyone I know when they want to learn python.
how about something like Head First Programming -- "A learner's guide to programming, using the Python language".
This is a great series but I've only skimmed this one.
Here's an amazon link: http://www.amazon.com/Head-First-Programming-Learners-Language/dp/0596802374
I think you are good to go !
Last advice: even if you are not primarily a developer, try to read how to code well. For example, this book is gold: Clean Code: A Handbook of Agile Software Craftsmanship)
Fluent Python is the best for this purpose in my opinion:
https://www.amazon.com/Fluent-Python-Concise-Effective-Programming/dp/1491946008/ref=sr_1_1?ie=UTF8&amp;qid=1526406807&amp;sr=8-1&amp;keywords=fluent+python
yes, for the first time. But now I have a ready-made .py file. and copy paste into my new package, change a few names and presto, i got one working. Even if one doesn't have the one ready, copy paste from an existing package. tweak few things for ur package. To get started, see the expert python programming book's packaging chapter, and you can get started.
I did this about a year ago, diving right into python and having to go somewhere after the beginning tutorials/books. Some great resources have been idiomatic python and Intermediate and Advanced Software Carpentry in Python
There is also Expert Python Programming which discusses not only some of the more recent/advanced features of python like co-routines etc, but also using the tools in the python ecosystem.
I'm actually writing a Python book for non-programmers on this exact topic. Automate the Boring Stuff with Python
It will be free to download under a Creative Commons license when published. You can read the description (and later the book) from here: http://automatetheboringstuff.com/
Thead Head First series has a "learning how to program" general book that uses Python for all the code. I'd agree that's it's a better idea to start with Python 2 than with 3.
edit: link for the book. Also, for something a bit more serious and quite complete check out "Core Python Programming" by Wesley Chun.
> so the book that is a reference on 2.6 and 3 at the same time is a lot more useful!
Try Python Essential Reference (4th Edition).
Mine would be to learn some C for a better understanding of Python internals. Also, go through this book.
Something that a friend of mine, Python dev, suggested to get:
Expert Python Programming by Tarek Ziadé
Link correctly: http://amzn.com/0132350882. Thanks, anyway.
All I could recommend you are the texts I picked up in college. I haven't looked for any other resources. That being said:
http://www.amazon.com/Computer-Organization-Design-Fifth-Architecture/dp/0124077269
This text is really only useful after learning some discrete math, but is THE book to learn algorithms:
http://www.amazon.com/Introduction-Algorithms-3rd-MIT-Press/dp/0262033844
This one wasn't given to me in college, but at my first job. Really opened my eyes to OOD & software architecture:
http://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612
Never liked that book tbh. If it works for you that's fine. Buit for me its tone is way too strict, condescending and most of the time it never explains why some things have to be done the way they are. It's as if the author forces his coding style on you and doesn't bother to give context.
I enjoyed "Automate the Boring Stuff with Python" much, much more.
I've used this for 2 weeks, covers some basics and has practice problems and questions at the end of every chapter.
https://www.amazon.com/Problem-Solving-Algorithms-Structures-Python/dp/1590282574/ref=sr_1_2?ie=UTF8&amp;qid=1498904735&amp;sr=8-2&amp;keywords=python+algorithms+data+structures
Solutions can be found: http://interactivepython.org/courselib/static/pythonds/index.html
If you really want to practice algorithms and data-structures I'd suggest sites like hackerrank or the book: https://www.amazon.com/Cracking-Coding-Interview-Programming-Questions/dp/0984782850/ref=pd_sim_14_20?_encoding=UTF8&amp;pd_rd_i=0984782850&amp;pd_rd_r=4YMFH5B5NS49VN6CYF9R&amp;pd_rd_w=EKQqU&amp;pd_rd_wg=TCGRX&amp;psc=1&amp;refRID=4YMFH5B5NS49VN6CYF9R
https://projecteuler.net/about is also a good site, I've done about 40 problems there in the last week.
I'm freshening up on Python for work, and these are my materials:
Mastering Python Design Patterns https://www.amazon.com/dp/1783989327/ref=cm_sw_r_cp_awd_kiCKwbSP5AQ1M
Learning Python Design Patterns https://www.amazon.com/dp/1783283378/ref=cm_sw_r_cp_awd_BiCKwbGT2FA1Z
Fluent Python https://www.amazon.com/dp/1491946008/ref=cm_sw_r_cp_awd_WiCKwbQ2MK9N
Design Patterns: Elements of Reusable Object-Oriented Software https://www.amazon.com/dp/0201633612/ref=cm_sw_r_cp_awd_fjCKwb5JQA3KG
I recommend them to OP.
[](Python Crash Course: A Hands-On, Project-Based Introduction to Programming https://www.amazon.com/dp/1593276036/ref=cm_sw_r_cp_api_j4nKybJRD4G8T)
This is by far one of the best books I've seen out there not only because it explains python really well but because it has 3 practice projects in the second half of the book.
Python in Practice is nice because it not only covers some advanced python techniques, but it also covers general design programs such as flyweights, adapters and abstract factories.
be aware the code samples provided are python 3, however you can generally figure out how to implement the examples in python 2.
Expert Python Programming by Tarek Ziade. Tarek is the individual responsible for spearheading the overhaul of Python packaging over the last couple years.
Yes, but also buy Cracking the Coding interview
You may want to read Clean Code !
Pick up the book “Automate the boring stuff”
Amazon
Free Online Version
And steal a project from there. The draw of python is you can make something useful fairly early on in the learning process.
Edit: I’de go with web scraping. Providing everyone with how to implement the shell functionality described in the book, and see what they come up with as far as a useful web scraper as your open ended requirement.
In case you're unaware, or anyone else is loo8for a more substantial book, Fluent Python covers Pythonic usage through 3.5, that should at least get you most of the way there.
A "." has been left in the URL. fixed link
Take the period off the end of the link. link fixed
Read Effective Python and Clean Code, in that order.
Clean Code by Robert C. Martin
Have a look at Pro Python by Marty Alchin (if you're learning Python 2), or Python in Practice if you're learning Python 3.
You might look at Game Programming, the L Line, The Express line to Learning
You can get it used fairly cheap. You wouldn't know from the title, but it only uses Python. It has 'Practice Exams' at the end of each chapter, usually with 2 questions that ask you to augment programs in the book.
ThinkPython
Python Essential Reference
Wait a second...!
http://www.amazon.com/Python-Data-Analysis-Wes-McKinney/dp/1449319793
I'm onto you...
Have a look at Python Cookbook, it might just right for you.
Books. Beginning Python and Learning Python
This book. It contains recipes on how to write idiomatic python code.
These two books were bigly for me:
In my personal opinion any python book list that doesn't include Fluent Python is pure garbage.
I started learning Python a few months ago, this book here helped me a lot. Gave you some "projects" to work on to learn each new function, method, etc.
Edit: formatting
https://www.amazon.co.uk/Python-Crash-Course-Hands-Project-Based/dp/1593276036/ref=sr_1_1?keywords=Python+crash+course&qid=1562178878&s=books&sr=1-1
I also recommend a book Python crash.
http://www.amazon.com/Python-Crash-Course-Project-Based-Introduction/dp/1593276036
http://mathesaurus.sourceforge.net/r-numpy.html
https://www.amazon.com/Python-Data-Analysis-Wrangling-IPython/dp/1449319793
https://www.amazon.com/Python-R-Users-Ajay-Ohri/dp/1119126762
These are just the first few hits not a personal endorsement.
> Write a simple decorator
Google, "write a decorator", do that.
I don't have that shit memorized, why would I? Same with "sort this thing" questions, in fact these are exactly* the questions that get asked all the time, and they kind of suck because they test the kinds of things one can Google in an instant, and come from the flawed, "Computer Science is the degree you need to be a software developer" mindset that's effectively ruined degrees as indicators of competence for our field, which requires a performance to demonstrate competence.
/u/Darkmere has a better question, by 100x. Better versions of your questions (the flawed method of conducting interviews) can be found in any number of books, Cracking the Coding Interview is my personal favorite, because it doesn't try to claim this is a good idea, but equips you with the best form of the terrible argument.
And because I'm snarky, maybe you should add, "Format a comment properly on Reddit." to your list of interview questions.
Can I offer some food for thought?
On Clean Code, Robert C Martim said that functions should have, at most, 5 parameters. After that, it's a mess.
You should probably look into ways of reducing the number of parameters. Maybe 3 or 5 of those are related to a single object, with related functions.
Just a suggestion.
PS: Also, I think you'll get a Pylint error about too many instance variables, or something like that.
Python Crash Course.
Yes.
subprocess
is a standard library (i.e. "baked in" to Python).pexpect
is a separate install, but not at all painful. For my own reasons, I'm installing it the hardest possible way and it's literally 3 commands.If this is something you want to mess with, check out Automate the Boring Stuff.
Think about the AAA (Arrange Act Assert) principle
https://docs.telerik.com/devtools/justmock/basic-usage/arrange-act-assert
several test scenarii in the same test is a bad practice
given that1
given that2
given that3
And what about this ?
The func names are useless
def test_calc_total2():
given that
def test_calc_total3():
given that
Did you heard about clean code ?
https://www.amazon.fr/Clean-Code-Handbook-Software-Craftsmanship/dp/0132350882
You should express the intent of your test in the name:
https://dzone.com/articles/7-popular-unit-test-naming
for instance:
0 is neutral for addition
a step toward parametrised test https://docs.pytest.org/en/2.9.0/parametrize.html