A common task when working with files is to walk through a directory, that is, recursively get every file in every directory starting in some location. The Python 3 os module has several functions useful for working with files and directories. One in particular, os.walk() is useful for recursively going through a directory and getting the contents in a structured way. These examples will show you a couple options for walking a directory recursively.
In Python sometimes you need to figure out where a function lives on the hard disk, or what file is calling your function. The os module provides tools for getting file and directory information and the inspect module provides the ability to inspect the stack and see what module is calling your function.
In Ruby 2.3, they introduced a getpass method on the IO::console class. There are no dependencies since it part of the standard library, but it's only available in versions higher than 2.3. For older versions, we'll look at an alternative method. The getpass method is similar to gets except it will not echo back what you are typing in. This is good for getting a password without printint it to the screen when you type it in. This will demonstrate how to use the method. See the official documentation for IO::console#getpass for more details. We will also look using $stdin.noecho() to wrap Kernel.gets to get a password.
This tutorial covers how to use standard ANSI escape codes to colorize and style terminal output. We'll cover the basics of escape characters, using them to clear the screen and set foreground and background colors, and how to get them working in Windows using the colorama package.
The curses package is part of the Python standard library and is useful for creating text-based user interfaces and generally controlling the screen and keyboard input. The big problem is that it doesn't work out-of-the-box on Windows. This show you how to get curses working in Windows. This was tested in Windows 10 with Python 3.6.
ASCII art has a long history in the hacker culture. If you check out any Phrack article and there is almost guaranteed to be some form of ASCII art in there. In this example we are specifically talking about ASCII art fonts that can be used to make banner text for command-line applications, network services, documentation, web pages, etc.
When writing command line applications in Java, you may want to prompt the user for input or a password, process a file, or pipe the output of another process through your application. This tutorial will walk through the process of using standard input, output, and error in Java.
Bash scripts are commonly used to perform a variety of tasks. These examples describe various ways you can work with command line arguments.
Taking command line arguments is one of the first things you should learn how to do with a new language. In this tutorial we'll walk through a simple Java program that takes command line arguments. We'll look at how to check if any arguments were passed, access them directly by numerical index, and iterate through each argument provided.
Learn to work with binary data in Python 3.