Image for post
Image for post
Photo by Shunya Koide on Unsplash

wxPython is a powerful cross-platform GUI toolkit for the Python language. In this post I will show how to replace dynamically the content of a window in wxPython.

Normally we create a GUI window with wxPython by putting all the required visual components inside a wx.Panel object and positioning them using sizers such as wx.BoxSizer. Usually each window (or “frame” according to the wxPython terminology) contains a single main panel. But how can we create several main panels with different GUI layouts for the same window and switch between them dynamically?

Image for post
Image for post

Before answering this question, here is the command line for installing wxPython:

pip install wxpython

The following code snippet demonstrate how to allow switching between panels in wxPython using the PanelSwitcher class which is derived from wx.BoxSizer. You can copy the code of PanelSwitcher from the snippet below into you project.


Serialization in Python is very easy. Here is how to do it

Image for post
Image for post
Photo by Joshua Sortino on Unsplash

What is serialization?

Serialization is the process of converting an object into a stream of bytes to store the object or transmit it to memory, a database, or a file. Its main purpose is to save the state of an object in order to be able to recreate it when needed. The reverse process is called deserialization.

https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/serialization/

Using Pickle

Pickle is a standard library of Python allowing serializing any Python object into a binary string or into a binary file. It also allows recreate a new object from the a serialized data.

The following code snippet demonstrates how to serialize some object into a binary string and de-serializing it into another…


Image for post
Image for post
Photo by Christian Fregnan

This tutorial describes how to transfer a Python environment from one Windows 10 computer into another Windows 10 computer. The packaged Python environment which is created this way, can be used on any Windows 10 computer where Python isn’t already installed and can be used for building an installation file for a Python application

1. Create a Local Virtual Environment with Conda

This tutorial requires that you use Anaconda or Miniconda Python distribution.

Anaconda is a free and open-source distribution of the Python programming language (and also R programming language) for scientific computing, that aims to simplify package management and deployment. Miniconda is a smaller version of Anaconda which includes a smaller number of packages.


Image for post
Image for post
Photo by Tony Webster from Minneapolis, Minnesota, United States

In this post I am going to guide you how to enable a secured communication between an Apache server and its clients using Transport Layer Security (TLS) which is a necessary requirement for basic cyber security.

Requirements

  1. Windows 10 development machine
  2. This guide assumes that you already have your own domain name (your-domain-name.com) hosted by some domain registrar. We will use a subdomain of this domain (app.your-domain-name.com) for our new server.
  3. We will install the Apache server on EC2 which is the Amazon’s service for running virtual machines. If you don’t have one, you will need to open an account in AWS (Amazon Web Services) in https://aws.amazon.com.

Before starting, here are the main steps

  1. Creating a virtual machine in AWS
  2. Connecting to the virtual machine using SSH
  3. Installing Apache server on the virtual machine
  4. Directing the sub domain to your AWS account
  5. Installing the security…

About

Oren Sifri

Software developer & architect. CTO at MedDev Soft

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store