Introduction In this code snippet, we are going to demonstrate how to read JSON data from file into a Python dictionary data structure. String to JSON The function json.loads can be used to load JSON data from string to dictionary. To load the data from file, we need to convert the file to string. Let
Introduction JSON (Java Script Object Notation) is one of the most popular text formats on the web due to its simplicity, lightweight and adoption. It is used to structure data exchange between web services. You may check the following article for implementing a simple web service using Python. JSON is a subset of the JavaScript
Introduction Converting a list of lists to a dictionary can be useful in certain situations. We can think of a Python list of lists as a database table where the outer list represent the table and the inner lists represent the rows. A database table has a primary key and the rest of the fields
Appium for iOS In this post, we are going to explain the necessary steps required to implement a basic iOS simulator and real device based test automation using Appium and Python. I assume that the reader is familiar with the following… Mac OS basics iOS basics (ex. Xcode, singing certificates, etc) Appium automation framework Python
Introduction Working from the command line or the terminal can not be avoided if we want to streamline tasks or if we want to implement any sort of automation. In automation, we may need to open a browser to a specific URL or retrieve data from an end point. Opening a browser from the terminal
Introduction This is a frequently asked question in Python despite its simplicity. In the code snippets below, we will provide straightforward examples to demonstrate how to embed a list within another list at the beginning, middle and end. Let us start with the first case… Python insert list into list at beginning The list object
Introduction Unicode in Python is not a beginner level topic. To get a better understanding, proper introduction is required. For the sake of this post, we are only going to provide few code snippets to demonstrate the conversion of unicode to string and visa versa. For detailed information about Unicode in Python, it is recommended
Table of contents One item at a time Pickle object serialization Write string to file Write json to file Write lines Using print List to string References Save list to file in Python Saving data structures such as lists to permanent storage for later retrieval is a common practice in computer programming. This technique is
Introduction Today, we are going to talk about directories, files and paths in Python. If you are in rush and only need to know the syntax, here is how to get the current working directory… For more information, continue reading… Python provides dedicated cross platform modules to interface with the operating system and file system.
Introduction This is going to be a compact post. Did the title catch your attention? Actually, It was intentional as we could have named it list comprehensions in Python. Looping in Python is awesome, if you are curious, you may check this post for more details about loops. In this post, we are only going