Welcome To Snipplr


Everyone's Recent Python Snippets



« Prev 1 2 3 4 5 ... 18
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
2 38529 posted 6 years ago by johnwalsh1
Clone any Github user's collection of public repositories
0 30264 posted 6 years ago by rootVIII
Useful for debugging
0 3967 posted 7 years ago by wayneweicheng
Name this script whatever you want, and run it via Workbench Scripting shell
0 4067 posted 8 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 4503 posted 8 years ago by Broadnet
Calculates the lcm of 2 or more numbers (based on a self-made algorithm)
0 3709 posted 9 years ago by amirteymuri
Used to convert lists to string
0 4128 posted 9 years ago by onlyforbopi
This shows how to convert values from a dictionary and make them a list.
0 4142 posted 9 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 4126 posted 10 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 3769 posted 10 years ago by ManishChandraReddy
Display the google chrome bookmarks to html and then save to database.
1 4925 posted 10 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 1978 posted 11 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 4112 posted 11 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 3962 posted 11 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 3721 posted 11 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...
1 4116 posted 11 years ago by tionazo
Get all links from a website from: http://www.pythonforbeginners.com/code/regular-expression-re-findall
0 5379 posted 11 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 3920 posted 11 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.
1 4622 posted 11 years ago by alces
What kind of program is this?
0 3601 posted 11 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 3956 posted 11 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 4629 posted 11 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 3647 posted 11 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 4180 posted 11 years ago by alces
his simple patch solves the problem when building on windows with usernames with non-ascii letters.
0 3930 posted 11 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 3983 posted 11 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 3629 posted 12 years ago by dsonbill
How to connect to FB via fbconsole
0 3766 posted 12 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.
1 3871 posted 12 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 4079 posted 12 years ago by JordanRowles
« Prev 1 2 3 4 5 ... 18