Skip to content
My Python Examples
Branch: master
Clone or download
geekcomputers Merge pull request #487 from cclauss/print-function
Use print() function in both Python 2 and Python 3
Latest commit 5a9eca6 Mar 17, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.idea Added Wallpaper Script to obtain Beautiful Wallpapers. Nov 24, 2018
Assembler Use print() function in both Python 2 and Python 3 Jan 7, 2019
Compression_Analysis Added PSNR calculator for checking compression quality Oct 26, 2018
CountMillionCharacters-Variations raw_input() was removed in Python 3 Jan 8, 2019
Google_Image_Downloader updated and improved Oct 16, 2018
Koch Curve Creating a Snowflake Fractal in Python using Koch Curve Dec 5, 2017
Weather Scrapper Add weather.csv Oct 26, 2018
Windows_Wallpaper_Script Merge pull request #478 from chunleik/master Feb 3, 2019
XORcipher improvment Dec 22, 2017
async_downloader Add async downloading example Feb 6, 2018
bank_managment_system Bank managment system gui program Oct 2, 2018
brickout-game Update brickout-game.py Oct 28, 2018
communication Use print() function in both Python 2 and Python 3 Mar 12, 2019
game_of_life moved GOL to new dir, added sample.gif output of the code. Oct 5, 2017
insta_monitering added insta_monitering code Dec 20, 2018
linear-algebra-python Add files via upload Mar 8, 2018
nodepad Add files via upload Jan 30, 2018
other_pepole Update and rename myip.py to other_pepole/get_ip_gui Nov 17, 2017
primelib performance optimization of primelib.isPrime(number) Nov 14, 2018
rearrange-files Update rearrange-files.py Jan 13, 2019
video-operations slowmo and timelapse code by python3 Jan 18, 2019
.gitignore Change onLineCombinations using list comprehension Jan 28, 2018
.travis.yml Let's run some tests! Jan 25, 2018
Binary Coefficients.py Rename binary coefficients to Binary Coefficients.py Jan 20, 2019
Blackjack Game.py Rename Blackjack Game to Blackjack Game.py Jan 20, 2019
CountMillionCharacter.py Format code by PEP8 Sep 12, 2018
CountMillionCharacters-2.0.py Add files via upload Oct 11, 2018
Counting-sort.py Add files via upload Oct 11, 2018
Credit_Card_Validator.py
Cricket_score.py Merge pull request #407 from BhavKaran/master Oct 31, 2018
Decimal_To_Binary.py Added Decimal to Binary Converter Oct 19, 2018
EncryptionTool.py raw_input() was removed in Python 3 Jan 8, 2019
FTP in python Create FTP in python Aug 3, 2017
Google_News.py Fix IndentationError: unexpected indent Jan 7, 2019
GroupSms_Way2.py format string use format() and comply with PEP stands Jan 26, 2019
Guess_the_number_game.py Revert changes to Guess_the_number_game.py Mar 12, 2019
Guessing_Game.py Rename Guessing_Game to Guessing_Game.py Jan 20, 2019
LICENSE.md Create LICENSE.md Feb 26, 2018
Memory_game.py Rename Memory_game to Memory_game.py Jan 20, 2019
Merge-sort.py Merge Sort Implementation Oct 1, 2018
MobiusFunction.py Create MobiusFunction.py Feb 21, 2019
Monitor Apache Create Monitor Apache Aug 3, 2017
Organise.py Use print() function in both Python 2 and Python 3 Nov 28, 2018
PONG_GAME.py Rename PONG_GAME to PONG_GAME.py Jan 20, 2019
PORT SCANNER.PY changed raw_input() to input() for python3 Feb 20, 2019
Palindrome_Checker.py removed variable Jun 4, 2018
Polyline.py
Print_List_of_Even_Numbers.py Added in to the file to fix error Oct 8, 2018
Print_List_of_Odd_Numbers.py Prints list of odd numbers Oct 8, 2018
Program to print table of given number.py Rename Program to print table of given number to Program to print tab… Jan 20, 2019
QuadraticCalc.py Upload Quadratic Calculator Oct 2, 2017
README.md Update README.md Mar 4, 2019
ReadFromCSV.py Update ReadFromCSV.py Oct 2, 2018
Shivaansh.py Use print() function in both Python 2 and Python 3 Nov 28, 2018
SimpleCalculator.py
SimpleStopWatch.py Update SimpleStopWatch.py Nov 4, 2018
Streaming Tweets from Twitter to Database.py Rename Streaming Tweets from Twitter to Database to Streaming Tweets … Jan 20, 2019
TTS.py Text-to-Speech Dec 1, 2017
TicTacToe.py raw_input() was removed in Python 3 Jan 8, 2019
WikipediaModule.py Use print() function in both Python 2 and Python 3 Mar 12, 2019
backup_automater_services.py Add files via upload Oct 11, 2018
batch_file_rename.py Add files via upload Oct 11, 2018
calculator.py Add files via upload Oct 11, 2018
chaos.py Add files via upload Oct 11, 2018
check_file.py Add files via upload Oct 11, 2018
check_for_sqlite_files.py Add files via upload Oct 11, 2018
check_input.py Add files via upload Oct 11, 2018
check_internet_con.py Update check_internet_con.py Mar 12, 2019
chicks_n_rabs.py Add files via upload Oct 11, 2018
create_dir_if_not_there.py Add files via upload Oct 11, 2018
cricket_live_score.py Add files via upload Oct 11, 2018
daily_checks.py Add files via upload Oct 11, 2018
dec_to_hex.py Format code by PEP8 Sep 12, 2018
dice.py Add files via upload Oct 11, 2018
diceV2_dynamic.py Add files via upload Oct 11, 2018
dice_rolling_simulator.py raw_input() was removed in Python 3 Jan 8, 2019
dir_test.py raw_input() was removed in Python 3 Jan 8, 2019
env_check.py Use print() function in both Python 2 and Python 3 Nov 28, 2018
ex20.py Add files via upload Oct 11, 2018
factorial_perm_comp.py Add files via upload Oct 11, 2018
factors.py Update factors.py Oct 1, 2018
fileinfo.py fixed input function Mar 26, 2018
find_prime.py added prime number finding algo, using Sieve_of_Eratosthenes theory. Nov 19, 2017
folder_size.py Bugfix in folder_size.py. Remove indents in dictionary, and add *1024… Jan 28, 2017
four_digit_num_combination.py Modify format based on pylint Jan 29, 2018
ftp_send_receive.py receive_file() and send_file() Jan 9, 2019
get_info_remoute_srv.py PEP8 changes. Nov 15, 2016
get_likes_on_FB.py Use print() function in both Python 2 and Python 3 Nov 28, 2018
get_youtube_view.py Update get_youtube_view.py Nov 16, 2017
google.py Updated google.py Oct 8, 2018
helloworld.py
internet_connection_py3.py Use print() function in both Python 2 and Python 3 Mar 12, 2019
jee_result.py PEP8 changes. Nov 15, 2016
kmp_str_search.py added knuth-morris-pratt pattern in a string search module. Nov 12, 2017
lanzhiwang_index.md 增加索引文件 Sep 9, 2018
live_sketch.py Created a new file Oct 9, 2018
logs.py PEP8 formation Nov 15, 2016
magic8ball.py updated magic8ball.py, module doc added. Oct 19, 2017
meme_maker.py Colors are changed Sep 8, 2017
merge.py Use print() function in both Python 2 and Python 3 Nov 28, 2018
move_files_over_x_days.py added option to use command line arguments to script Dec 25, 2017
movie_details.py Revert change to movie_details.py Mar 12, 2019
multiplication_table.py Update multiplication_table.py Sep 8, 2018
nDigitNumberCombinations.py Propose an alternate solution Jan 8, 2019
new_script.py Use print() function in both Python 2 and Python 3 Nov 28, 2018
nmap_scan.py Use print() function in both Python 2 and Python 3 Nov 28, 2018
nslookup_check.py PEP8 format Nov 15, 2016
osinfo.py PEP8 format Nov 15, 2016
password_cracker.py Use print() function in both Python 2 and Python 3 Nov 28, 2018
ping_servers.py Use print() function in both Python 2 and Python 3 Nov 28, 2018
ping_subnet.py Use print() function in both Python 2 and Python 3 Nov 28, 2018
polygon.py Pygame script Nov 19, 2016
portscanner.py Use print() function in both Python 2 and Python 3 Nov 28, 2018
powerdown_startup.py Fixed some alignment of comments Sep 21, 2017
powerup_checks.py
prison_break_scrapper.py Added Prison Break Scrapper Sep 2, 2017
prog.py Added new program Dec 11, 2018
pscheck.py
psunotify.py Merge branch 'master' into master Dec 12, 2018
puttylogs.py
pythonVideoDownloader.py Updated to Python 3 Oct 5, 2018
python_sms.py Merge branch 'master' into master Dec 12, 2018
random-sentences.py Pythonized more Oct 23, 2017
randomloadingmessage.py Python script that chooses from 80 funny loading lines Oct 7, 2018
read_excel_file.py Read-Write Excel files with python Aug 24, 2018
recyclebin.py Merge branch 'master' into master Dec 12, 2018
replacetext.py Add replacetext file Oct 18, 2018
rock_paper_scissor_game.py Use print() function in both Python 2 and Python 3 Mar 12, 2019
rook.py Add script to show shortest path by rook in chess board Oct 12, 2018
sample.xlsx Read-Write Excel files with python Aug 24, 2018
script_count.py Merge branch 'master' into master Dec 12, 2018
script_listing.py Update script_listing.py Nov 5, 2016
sendemail.py Merge branch 'master' into master Dec 12, 2018
serial_scanner.py Update serial_scanner.py Jan 12, 2018
sha1.py sha1 hashing script Oct 30, 2018
sierpinski_triangle.py added sierpinski_triangle.py, an easy fractal generation code, using … Sep 23, 2017
site_health.py removed spaces and lines Oct 3, 2018
snake.py added snake.py Apr 29, 2018
spiralmatrix.py Create spiralmatrix.py Mar 23, 2018
spotlight.py raw_input() was removed in Python 3 Jan 8, 2019
sqlite_check.py Use print() function in both Python 2 and Python 3 Nov 28, 2018
sqlite_table_check.py Visual Update Nov 8, 2016
start-server.py check_file.py enhanced Apr 14, 2017
tar.py Create tar.py Jun 21, 2018
testlines.py Clean comments Jun 1, 2017
tf_idf_generator.py updated tf_idf_generator.py Sep 17, 2017
thread_signal.py
tik_tak.py modified code for readability and security Oct 15, 2018
timymodule.py tabs -> spaces and added __main__ Apr 28, 2017
tweeter.py raw_input() was removed in Python 3 Jan 8, 2019
two_num.py PEP8 Flake8 fixes Oct 2, 2018
webcam.py docs: Add Requirements Feb 18, 2017
wiki_random.py updated wiki_random.py, added module doc and few exception handing. Oct 19, 2017
work_connect.py Updated to Python 3 work_connect Oct 8, 2018
write_excel_file.py Read-Write Excel files with python Aug 24, 2018
xkcd_downloader.py Keep image extension for xkcd comics Oct 2, 2017
youtube-downloader fast.py fast youtube downloader with aria2c Feb 10, 2017
youtube.py additional condition Sep 19, 2018

README.md

My Python Examples

I do not consider myself a programmer. I create these little programs as experiments to play with the language, or to solve problems for myself. I would gladly accept pointers from others to improve, simplify, or make the code more efficient. If you would like to make any comments then please feel free to email me at craig@geekcomputers.co.uk.

These scripts contain important functions which help reduce human workload. Code documentation is aligned correctly when the files are viewed in Notepad++.

  • batch_file_rename.py - This batch renames a group of files in a given directory, once you pass the current and the new extensions.

  • create_dir_if_not_there.py - Checks to see if a directory exists in the users home directory, if not then create it.

  • Fast Youtube Downloader - Downloads YouTube videos quickly with parallel threads using aria2c

  • Google Image Downloader - Query a given term and retrieve images from the Google Image database.

  • dir_test.py - Tests to see if the directory testdir exists, if not it will create the directory for you.

  • env_check.py - This script will check to see if all of the environment variables required are set.

  • fileinfo.py - Shows file information for a given file.

  • folder_size.py - Scans the current directory and all subdirectories and displays the size.

  • logs.py - This script will search for all *.log files in the given directory, zip them using the program you specify, and then date stamp them.

  • move_files_over_x_days.py - Moves all files over a specified age (in days) from the source directory to the destination directory.

  • nslookup_check.py - This simple script opens the file server_list.txt and then does an nslookup for each one to check the DNS entry.

  • osinfo.py - Displays some information about the OS on which you are running this script.

  • ping_servers.py - This script, depending on the arguments supplied, will ping the servers associated with that application group.

  • ping_subnet.py - After supplying the first 3 octets this file scans the final range for available addresses.

  • powerdown_startup.py - This file goes through the server list and pings the machine, if it is up it will load the putty session, if it is not it will notify you.

  • puttylogs.py - This file zips up all the logs in the given directory.

  • script_count.py - This file scans the scripts directory and gives a count of the different types of scripts.

  • [get_youtube_view.py] - This is very simple python script to get more views for your youtube videos.Some times I use for repeating my favorite songs by this scripts.

  • script_listing.py - This file will list all the files in the given directory, and go through all the subdirectories as well.

  • testlines.py - This simple script opens a file and prints out 100 lines of whatever is the set for the line variable.

  • tweeter.py - Allows you to tweet text or a picture from the terminal.

  • serial_scanner.py contains a method called ListAvailablePorts which returns a list with the names of the serial ports that are in use in the computer. This method works only on Linux and Windows (can be extended for mac osx). If no port is found, an empty list is returned.

  • get_youtube_view.py - A simple python script to get more views for your YouTube videos. Useful for repeating songs on YouTube.

  • CountMillionCharacter.py And CountMillionCharacter2.0.py - Gets character count of a text file.

  • xkcd_downloader.py - Downloads the latest XKCD comic and places them in a new folder called "comics".

  • timymodule.py - A great alternative to Pythons 'timeit' module and easier to use.

  • calculator.py - Uses Python's eval() function to implement a calculator.

  • Google_News.py - Uses BeautifulSoup to provide Latest news headline along with news link.

  • cricket_live_score - Uses BeautifulSoup to provide live cricket score.

  • youtube.py - Takes a song name as input and fetches the YouTube URL of the best matching song and plays it.

  • site_health.py - Checks the health of a remote server

  • SimpleStopWatch.py - Simple Stop Watch implementation using Python's time module.

You can’t perform that action at this time.