Welcome To Snipplr


Everyone's Recent Python Snippets



« Prev 1 2 3 4 5 ... 19
  1. FAV

    MySql workbench add created and modified columns for CAKEPHP

    Name this script whatever you want, and run it via Workbench Scripting shell
    Python 4 views posted 2 years ago by acosonic
  2. FAV

    Python Sample SMS Code - SMS Messaging API

     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! 
    Python 12 views posted 2 years ago by Broadnet
  3. FAV

    least common multiple

    Calculates the lcm of 2 or more numbers (based on a self-made algorithm)
    Python 9 views posted 3 years ago by amirteymuri
  4. FAV

    Convert List to String

    Used to convert lists to string
    Python 7 views posted 3 years ago by onlyforbopi
  5. FAV

    Dictionary Values to a List

    This shows how to convert values from a dictionary and make them a list.
    Python 5 views posted 3 years ago by GabrielTheodoulos
  6. FAV

    Python Reverse Array

    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
    Python saved by 4 people 13 views posted 3 years ago by denisemauldin
  7. FAV

    Try Except Else

    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:
    Python 5 views posted 4 years ago by ManishChandraReddy
  8. FAV

    Google chrome bookmarks to html and then to database

    Display the google chrome bookmarks to html and then save to database.
    Python saved by 4 people 9 views posted 4 years ago by Gauravwagh11
  9. FAV

    Email verifying

    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.
    Python saved by 1 person 5 views posted 4 years ago by brm
  10. FAV

    Python - Self-Modding Code

    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...
    Python saved by 1 person 6 views posted 4 years ago by BustACode
  11. FAV

    Format that Crap to an Array

    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.
    Python 7 views posted 4 years ago by joshuaherman
  12. FAV

    Python Censorship

    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.
    Python 7 views posted 4 years ago by arielinfante
  13. FAV

    Buscar ficheros en el ordenador

    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...
    Python 7 views posted 5 years ago by tionazo
  14. FAV

    Get all links from a website

    Get all links from a website from: http://www.pythonforbeginners.com/code/regular-expression-re-findall
    Python 28 views posted 5 years ago by tionazo
  15. FAV

    Circle and sphere calculator

    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,
    Python 5 views posted 5 years ago by Tharix
  16. FAV

    Flatten a list of lists (any depth) in Python

    Flatten a list of lists (or tuple of tuples, list of tuples, etc.) to any depth of nesting using no mutable objects.
    Python 4 views posted 5 years ago by alces
  17. FAV

    Void main char argv os subprocess

    What kind of program is this?
    Python 5 views posted 5 years ago by lancer229
  18. FAV

    Automate System Setup

    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...
    Python 5 views posted 5 years ago by jsinix
  19. FAV

    Scraped item to mysql in scrapy

    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...
    Python 19 views posted 5 years ago by zwidnypublic
  20. FAV

    Analisar dados dos servidores do Governo Federal

    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.
    Python 3 views posted 5 years ago by torresbernardo
  21. FAV

    Update timezone data on RedHat-like servers using fabric

    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**
    Python 5 views posted 5 years ago by alces
  22. FAV

    Fir npm install with gyp for windows if your name is contains non-english characters.

    his simple patch solves the problem when building on windows with usernames with non-ascii letters.
    Python 6 views posted 5 years ago by composite
  23. FAV

    Python: check battery stat and run through cron

    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
    Python 9 views posted 5 years ago by pantuts
  24. FAV

    Python formatKey for Redis

    Tiny python closure for combining redis keys with "format". Uses a closure so it does not remake the base key each use.
    Python 5 views posted 5 years ago by dsonbill
  25. FAV

    Facebook script

    How to connect to FB via fbconsole
    Python 8 views posted 5 years ago by rikesh_kisnah
  26. FAV

    SystemInformation.py

    Gets system, machine, OS and networking information and either writes it to a file or returns the data as a string.
    Python 8 views posted 5 years ago by JordanRowles
  27. FAV

    SocketServer_Logging.py

    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.
    Python 8 views posted 5 years ago by JordanRowles
  28. FAV

    SocketServer_Client.py

    Client code for sending information to the logging server.
    Python 4 views posted 5 years ago by JordanRowles
  29. FAV

    SocketServer_Server.py

    A server that receives information from programs (Name, DateTime, LogType, Data) and writes it to a file with the syntax: LogFile_{program_name}_{ISO-Date}.log
    Python 4 views posted 5 years ago by JordanRowles
  30. FAV

    Merge Multiple Word Documents into Single Doc using REST API in Python

    This REST example uses pycurl library to send HTTP request and handle HTTP response so you need to install it to use this example. Once input Word documents are uploaded, you can use the following URI to merge documents on Aspose for Cloud or any sup...
    Python 5 views posted 5 years ago by johansonkatherine
« Prev 1 2 3 4 5 ... 19