smallsurething

Learn How to Code and Make Games in Python

Cx Freeze Tutorial

  • Home
  • Origin of Python Software
  • Python Nominated in Top 5 software
  • Games Developed With Python
  • Video Games Vs. Video Slots

HomePython

Posts in category: Python

Private methods and attributes in Python

July 3, 2019
by EvanDempsey Python

Unlike Java, which enforces access restrictions on methods and attributes, Python takes the view that we are all adults and should be allowed to use the code as we see fit. Nevertheless, the language provides a few facilities to indicate which methods and ...

Read More

Multi-line strings in Python

June 26, 2019
by EvanDempsey Python

At some point, you will want to define a multi-line string and find that the obvious solutions just don’t feel clean. In this post, I’m going to take a look at three ways of defining them and give you my recommendation. Concatenation The first way of do ...

Read More

How to obfuscate Python source code

May 15, 2019
by EvanDempsey Python

A lot of the Python code you will come across is open source. The whole point is to distribute it freely, share knowledge and let people play around with it and learn from it. Sometimes, though, you might want to prevent the end-user from reading the c ...

Read More

Python descriptors made simple

May 10, 2019
by EvanDempsey Natural Language ProcessingPython

Descriptors, introduced in Python 2.2, provide a way to add managed attributes to objects. They are not used much in everyday programming, but it’s important to learn them to understand a lot of the “magic” that happens in the standard library and third-p ...

Read More

A quick guide to nonlocal in Python 3

April 10, 2019
by EvanDempsey PythonScientific Computing

Python 3 introduced the nonlocal  keyword that allows you to assign to variables in an outer, but non-global, scope. An example will illustrate what I mean. Python >>> def outside():<br /> msg ...

Read More

List, Dict and Set Comprehensions By Example

March 23, 2019
by EvanDempsey PythonScientific Computing

One type of syntactic sugar that sets Python apart from more verbose languages is comprehensions. Comprehensions are a special notation for building up lists, dictionaries and sets from other lists, dictionaries and sets, modifying and filtering them in t ...

Read More

Python Regular Expression Basics

February 4, 2018
by EvanDempsey Python

Regular expressions is one of those topics that confuse even advanced programmers. Many people have programmed professionally for years without getting to grips with them. Too often, people just copy and paste Regexes from StackOverflow or other websites ...

Read More

The two ways to sort a list in Python

September 28, 2017
by EvanDempsey Python

Today I’m going to take a look at another element of the language that tends to trip up Python beginners – the difference between sorted(my_list)  and my_list.sort(). The built-in function sorted sorts the list that is passed into it, and returns a new ...

Read More

The bool function in Python

September 17, 2017
by EvanDempsey Python

Python’s built-in bool  function comes in pretty handy for checking the truth and falsity of different types of values. First, let’s take a look at how True and False are represented in the language. True and False are numeric values In Python intern ...

Read More

How to integrate New Relic with Django, Apache and mod_wsgi

August 25, 2017
by EvanDempsey Python

I just finished setting up New Relic application monitoring on Recommendify. It was a little bit of a painful process and it wasn’t properly described in their docs, so I’m going to note the steps I went through here. Hopefully it will help somebody else ...

Read More
  • 1
  • 2
  • Next
  • Last

© 2020 Phlox Agency. All rights reserved.

Shopping Basket