Eleven IPython keyboard tips/shortcuts to Move Around Easily. Ctrl-p or up-arrow: Access command history in backward Ctrl-n or down-arrow: Access command history in forward Ctrl-a: Move cursor to beginning of line Ctrl-e: Move cursor to end of line Ctrl-f: Move cursor forward one character Ctrl-b: Move cursor back one character Ctrl-l: Clear screen Ctrl-r: reverse history […]
Python
3 Ways to Write Text to a File in Python
If you are interested in writing text to a file in Python, there is probably many ways to do it. Here is three ways to write text to a output file in Python. The first step in writing to a file is create the file object by using the built-in Python command “open”. To create and […]
7 Tips to Play With File Names, Directory Names, and Paths in Python
Python’s OS.path module have a lots of commands/methods that are greatly useful for all things files/directories/paths. Here are seven tips for playing with files, directories, and paths using Python os.path. These commands will help you check if a given path is a directory or not? find given path is a file? check if a file […]
Mastering Lists in Python Using List Comprehensions
Ever faced the problem of creating a unique lists in Python? or Accessing only specific elements of lists in Python? Python’s “List Comprehensions” offers you the immense power to create and use lists. Here is a brief introduction to understand and getting started on using List Comprehensions in Python. Python’s List Comprehensions Example 1 The […]
Running Python Command Line and Getting Arguments
When you are writing a python program and want to run the Python script as a command from the terminal, you may want to get the arguments to the python program from command line. For example, you might want to execute the Python script and use its arguments. Python myPythonWithArguments.py input1 input2 Python’s sys module’s […]