Coder Social home page Coder Social logo

pysheeet's Introduction


pysheeet

Build Status Coverage License MIT

Introduction

Pysheeet was created with intention of collecting python code snippets for reducing coding hours and making life easier and faster. Any contributions are welcome. Please feel free to fork and send a pull request to this project.

What’s New In Python 3

This part only provides a quick glance at some important features in Python 3. If you're interested in all of the most important features, please read the official document, What’s New in Python.

Cheat Sheet

Advanced Cheat Sheet

Appendix

PDF Version

pdf

How to run the server

pysheeet's People

Contributors

be-rock avatar bejoygm avatar belm0 avatar blankoworld avatar caimaoy avatar crazyguitar avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar duncanbetts avatar ejdecena avatar esmail avatar foobarquaxx avatar gavinkaa avatar gswalden avatar hughplay avatar kimdre avatar naereen avatar neirbowj avatar pengyao avatar pheanex avatar saippuakauppias avatar shivnathtathe avatar sleinen avatar snyk-bot avatar ssarcandy avatar steelywing avatar timgates42 avatar vladislavzavadskyy avatar yazinsai 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  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

pysheeet's Issues

mismatch result in page 51

>>> def subgen():
...     try:
...         yield 9527
...      except ValueError:
...          print("get value error")
...
>>> def delegating_gen():
...     yield from subgen()
...
>>> g = delegating_gen()
>>> try:
...     next(g)
...     g.throw(ValueError)
... except StopIteration:
...     print("gen stop")
...
9527
get value error
gen stop

in my desktop Python 3.6.2 Anaconda, I run the code above in IPython, but the output dose not contain the first line '9527'.

Weird variable name

  • Line from app_test.py:
for h in htmls:
    u = "notes/" + h
    resp = static_proxy(u)
  • What is u and h?
  • From reading app.py i realized that variable u is path.
  • Maybe, you need to give variables meaningful names?

Cheatsheet for string manipulations

Is someone will attend this issue I'm newbie here i just want to learn and someone will mentor me about programming it will much appreciated

Iterator 404

Hi
The iterator page is not there, is it deleted or being updated ?

Thanks

Migrate alll codes to just python 3

Can we migrate all code snippets in this repo to python 3 to not confuse the new user to use the deprecated python 2.x. Its just a suggestion as of now.

New version of fundamental cheat sheets

Make brief explanations become part of cheat sheets.

  • Style
  • From Scratch
  • Future
  • Unicode
  • List
  • Set
  • Dictionary
  • Function
  • Classes and Objects
  • Generator
  • Typing
  • Files and I/O

make the glossary a bit clearer

in two cases you do g = ... while in once case you want to explain

calling the generator function returns a generator

and in the other you mean

(x for x in seq) is a generator expression evaluating directly to a generator.

i think you should make this clear.

fib error

image

the function fib has error,others is right

Default to Python 3 compatibility

Thank you for maintaining this great resource!

With Python 2 End of Life planned for about 19 months from now, it should be possible to run any snippet found on pysheets under the latest version of Python (3.6.5 today) unmodified. For example, all occurrences of print should be functions instead of statements. This is not to say that the snippets should not run under Python 2, but that the priority should be Python 3 compatibility.

Dictionary changes

It might be worth adding a section on how the handling of dictionaries has changed between 2 and 3 in the New in Python3 cheatsheet

Building a PDF via Sphinx fails

There seem to be a lot of unicode issues. I have no clue how to fix them, but having a PDF would be neat.

git clone https://github.com/crazyguitar/pysheeet
cd pysheeet/docs
make latexpdf
! Package inputenc Error: Unicode char 中 (U+4E2D)
(inputenc)                not set up for use with LaTeX.

See the inputenc package documentation for explanation.
Type  H <return>  for immediate help.
 ...

l.1677 ...G{l+s+s1}{中文}\PYG{l+s+s1}{\PYGZsq{}}

In Remove <>

In the Python 3 part is

a != "Python2"
True
The result should be False or the check should be a != "Python3"

K.

DateTime Column is not coded properly

Hi

This page has the following code for the ORM

https://www.pythonsheets.com/notes/python-sqlalchemy.html

class TestTable(Base): __tablename__ = 'Test Table' id = Column(Integer, primary_key=True) key = Column(String, nullable=False) val = Column(String) date = Column(DateTime, default=datetime.utcnow)

The proper way to code the DateTime column is

class TestTable(Base): __tablename__ = 'Test Table' id = Column(Integer, primary_key=True) key = Column(String, nullable=False) val = Column(String) date = Column(DateTime(), default=datetime.utcnow)
If you use the code from your example and have two DateTime columns coded this way then SQLalchemy will raise this error on the second column. sqlalchemy.exc.ArgumentError: Column must be constructed with a non-blank name or assign a non-blank .name before adding to a Table.

Translation for korean

How awesome is this!

I wanna spread these great notes to korean, So I would like to translate this into korean after fork.

Are there some rules for translation contributing? And, when I’m done, can I link the korean repository to this README later?

Thank you!

NameError: abort()

flake8 testing of https://github.com/crazyguitar/pysheeet on Python 2.7.13

$ flake8 . --count --select=E901,E999,F821,F822,F823 --show-source --statistics

./app.py:42:21: F821 undefined name 'abort'
    if key is None: abort(404)
                    ^

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.