Welcome To Snipplr


Everyone's Recent Python Snippets



« Prev 1 2 3 4 5 ... 19
Take attribute data stored in a CSV and insert it into an SVG based on unique ID field. The final bit of code adds an 'onmouseover' effect to animate the map in javascript.
0 723 posted 3 months ago by ralentina
scraping geographical coordinates from an online directory (for a mapping project), using Beautiful Soup. Data exported into csv.
1 666 posted 3 months ago by ralentina
Always gives me perfect date. Sample Output Current Day is: 1 Current Month is: 2 Current Year is: 2020 Current Hour is: 17 Current Minute is: 3 Current Second is: 8 Current Microsecond is: 556483
0 687 posted 5 months ago by johnwalsh1
Clone any Github user's collection of public repositories
0 757 posted 9 months ago by rootVIII
Useful for debugging
0 133 posted 1 year ago by wayneweicheng
Name this script whatever you want, and run it via Workbench Scripting shell
0 150 posted 2 years ago by acosonic
 Just try the following Python Sample SMS Code scripts and you will find that sending SMS to your contact via this programming script is fun! 
1 244 posted 3 years ago by Broadnet
Calculates the lcm of 2 or more numbers (based on a self-made algorithm)
0 107 posted 3 years ago by amirteymuri
Used to convert lists to string
0 166 posted 3 years ago by onlyforbopi
This shows how to convert values from a dictionary and make them a list.
0 163 posted 4 years ago by GabrielTheodoulos
arr[::-1] does a list slice to reverse the array str(x) for x in arr[::-1] casts the ints in the array as strings map(str, arr[::-1]) does the same thing by using map to cast the ints " ".join() joins the resulting strings with a space
1 141 posted 4 years ago by denisemauldin
The try ... except statement has an optional else clause, which, when present, must follow all except clauses. It is useful for code that must be executed if the try clause does not raise an exception. For example:
0 126 posted 4 years ago by ManishChandraReddy
Display the google chrome bookmarks to html and then save to database.
1 230 posted 4 years ago by Gauravwagh11
check email address whether valid or not by checking list of MX servers and send email command - will work as long as the SMTP server of target domain not be protected / the VRVY not be disabled in MX server.
1 114 posted 5 years ago by brm
One day I got to wondering if it was possible to get a Python script to modify itself. After a few searches I found a solution that I present here. I did not write this code, but feel that it should be "paid forward" so others know that it is possibl...
1 143 posted 5 years ago by BustACode
I am tired of having to go through text and adding quotation marks and commas to strings or just commas after numbers... f-that. Fixed.
0 120 posted 5 years ago by joshuaherman
A simple Python censor script that takes 2 arguments. One is for the text you want to censor and the other is the list of words that should not be viewed.
0 104 posted 5 years ago by arielinfante
Overview In an earlier post "OS.walk in Python", I described how to use os.walk and showed some examples on how to use it in scripts. In this article, I will show how to use the os.walk() module function to walk a directory tree, and the fnma...
0 142 posted 5 years ago by tionazo
Get all links from a website from: http://www.pythonforbeginners.com/code/regular-expression-re-findall
0 298 posted 5 years ago by tionazo
A simple program to calculate the area and perimeter of a circle and to calculate the area and volume of a sphere. Source is commented,
0 108 posted 5 years ago by Tharix
Flatten a list of lists (or tuple of tuples, list of tuples, etc.) to any depth of nesting using no mutable objects.
0 175 posted 5 years ago by alces
What kind of program is this?
0 102 posted 5 years ago by lancer229
Author: jsinix([email protected]) This script is written to expedite the process of initial system configuration (specifically Ubuntu). These initial things include basic setup, securing the system(firewall), updating it etc. I have not test...
0 123 posted 5 years ago by jsinix
To store you item into mysql database. 1. I say you have been have mysql database and the table what field is the same in item class that you wang to be stored 2. I just ensure you item insert into mysql, do not ensure the performance 3. To...
0 279 posted 5 years ago by zwidnypublic
Utiliza os dados do site: http://www.portaltransparencia.gov.br/downloads/servidores.asp Escolha um mês e ano, baixe o .zip, descompacte e na pasta descompactada, execute.
0 121 posted 5 years ago by torresbernardo
Usage: 1. save the snippet as *fabfile.py* 2. and run: **$ fab -H myhost1,myhost2...** or set *env.roledefs['myrole'] = ['myhost1', 'myhost2', ...]* in *fabfile.py* and run this way: **$ fab -R myrole**
0 117 posted 5 years ago by alces
his simple patch solves the problem when building on windows with usernames with non-ascii letters.
0 150 posted 6 years ago by composite
for Cron: # run $ crontab -e # then add this */1 * * * * export DISPLAY=:0.0 && /home/username/path/to/script.py > /dev/null # then save. # This cron job will run every minute
0 141 posted 6 years ago by pantuts
Tiny python closure for combining redis keys with "format". Uses a closure so it does not remake the base key each use.
0 97 posted 6 years ago by dsonbill
How to connect to FB via fbconsole
0 110 posted 6 years ago by rikesh_kisnah
« Prev 1 2 3 4 5 ... 19