![]() How to read from files, how to write data to them, what file seeks are, and why files should be closed. Working With File I/O in Python – Learn the basics of working with files in Python.Write More Pythonic Code by Applying the Things You Already Know – There’s a mistake I frequently make when I learn new things about Python… Here’s how you can avoid this pitfall and learn something about Python’s “enumerate()” function at the same time.Interfacing Python and C: The CFFI Module – How to use Python’s built-in CFFI module for interfacing Python with native libraries as an alternative to the “ctypes” approach.Please enable JavaScript to view the comments powered by Disqus. A better Python REPL: bpython vs python – A quick video that demonstrates bpython, an awesome alternative Python interpreter. ![]() But when you peek behind the scenes of the underlying Context Manager protocol you’ll see there’s little “magic” involved. Context Managers and the “with” Statement in Python – The “with” statement in Python is regarded as an obscure feature by some.The 4 Major Ways to Do String Formatting in Python – Remember the Zen of Python and how there should be “one obvious way to do something in Python”? You might scratch your head when you find out that there are *four* major ways to do string formatting in Python.A Python Riddle: The Craziest Dict Expression in the West – Let’s pry apart this slightly unintuitive Python dictionary expression to find out what’s going on in the uncharted depths of the Python interpreter.This short screencast tutorial gives you a real-world example where this might come in handy. Using get() to return a default value from a Python dict – Python’s dictionaries have a “get” method to look up a key while providing a fallback value.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |