Coder Social home page Coder Social logo

python-snippets's Introduction

Python Snippets

These Snippets can make your life a lot easier than expected, use it wisely.


Snippets TO LEARN

  • string_import.py example to show import module from string
  • classtools.py assorted class utilities and tools
  • formats.py various specialized string display formatting utilities.
  • mydir.py a module that lists the namespaces of other module
  • mymap.py different ways of implementing map
  • myzip.py different ways of implementing zip
  • permute.py implemented permute
  • reloadall.py transitively reload nested module
  • scramble.py a iterable scrambler
  • streams.py give me reader, writer and a converter
  • timer.py Homegrown timing tools for function calls.
  • timer2.py Homegrown timing tools for function calls.
  • timer3.py Homegrown timing tools for function calls.
  • classtree.py Climb inheritance tree using namespace links, displaying higher superclasses with indentation for height
  • listinstance.py Mix-in class that provides a formatted print() or str()
  • listinherited.py Mix-in class that provides a formatted print() or str() (Use dir() to collect both instance attr and names inherited from its classes)
  • listinherited2.py Same as listinherited.py, but more formatted
  • listtree.py Trace the entire class and all its object's attrs at and above self
  • mapattrs.py Map all attributes on or inherited by an instance to the instance or class from which they are inherited.

Contributing

Open an issue or a pull request to suggest changes or additions.

Authors

Abdul Moiz

License

CC0
To the extent possible under law, Abdul Moiz has waived all copyright and related or neighboring rights to Snippets.

⬆️ Back To Top

python-snippets's People

Contributors

akshatbhatter1 avatar arpit045-boop avatar gokul2406 avatar kshitizkk avatar progrmoiz avatar saket04 avatar tanmaynagdeve avatar tarunmishra007 avatar vinayduggal7 avatar wwj718 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

python-snippets's Issues

Remove `permute.py`?

def permute(seq):

In[22]: from itertools import permutations
In[23]: for p in permutations('maths'):
   ...:     print(''.join(p))
   ...: 
maths
matsh
mahts
mahst
masth
masht
mtahs
mtash
mthas
mthsa
mtsah
mtsha
mhats
mhast
mhtas
mhtsa
mhsat
mhsta
msath
msaht
mstah
mstha
mshat
mshta
amths
amtsh
amhts
amhst
amsth
amsht
atmhs
atmsh
athms
athsm
atsmh
atshm
ahmts
ahmst
ahtms
ahtsm
ahsmt
ahstm
asmth
asmht
astmh
asthm
ashmt
ashtm
tmahs
tmash
tmhas
tmhsa
tmsah
tmsha
tamhs
tamsh
tahms
tahsm
tasmh
tashm
thmas
thmsa
thams
thasm
thsma
thsam
tsmah
tsmha
tsamh
tsahm
tshma
tsham
hmats
hmast
hmtas
hmtsa
hmsat
hmsta
hamts
hamst
hatms
hatsm
hasmt
hastm
htmas
htmsa
htams
htasm
htsma
htsam
hsmat
hsmta
hsamt
hsatm
hstma
hstam
smath
smaht
smtah
smtha
smhat
smhta
samth
samht
satmh
sathm
sahmt
sahtm
stmah
stmha
stamh
stahm
sthma
stham
shmat
shmta
shamt
shatm
shtma
shtam

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.