Welcome To Snipplr

Everyone's Recent Python Snippets

« Prev 1 2 3 4 5 ... 19
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
1 1919 posted 10 months ago by johnwalsh1
Clone any Github user's collection of public repositories
0 2012 posted 1 year ago by rootVIII
Useful for debugging
0 261 posted 1 year ago by wayneweicheng
Name this script whatever you want, and run it via Workbench Scripting shell
0 278 posted 3 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 410 posted 3 years ago by Broadnet
Calculates the lcm of 2 or more numbers (based on a self-made algorithm)
0 203 posted 4 years ago by amirteymuri
Used to convert lists to string
0 282 posted 4 years ago by onlyforbopi
This shows how to convert values from a dictionary and make them a list.
0 315 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 257 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 234 posted 5 years ago by ManishChandraReddy
Display the google chrome bookmarks to html and then save to database.
1 427 posted 5 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 236 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 266 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 216 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 196 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 261 posted 6 years ago by tionazo
Get all links from a website from: http://www.pythonforbeginners.com/code/regular-expression-re-findall
0 496 posted 6 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 213 posted 6 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 309 posted 6 years ago by alces
What kind of program is this?
0 209 posted 6 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 255 posted 6 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 503 posted 6 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 229 posted 6 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 236 posted 6 years ago by alces
his simple patch solves the problem when building on windows with usernames with non-ascii letters.
0 278 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 243 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 190 posted 6 years ago by dsonbill
How to connect to FB via fbconsole
0 217 posted 6 years ago by rikesh_kisnah
Gets system, machine, OS and networking information and either writes it to a file or returns the data as a string.
0 193 posted 6 years ago by JordanRowles
These logging functions will be improved and added into the SocketServer_Server.py to log information from programs on machines on the same network, but not directly connected to each other.
0 218 posted 6 years ago by JordanRowles
« Prev 1 2 3 4 5 ... 19