Code Monkey home page Code Monkey logo

pycat's Introduction

pycat

This is an attempt to re-implement ye old favorite cat in an effort to learn a thing or three.

Setup

This project uses poetry to manage itself.

Notes

  • this is a really naive implementation, and I mean that all of this is sitting in a big for-loop in one function. my original thought was to make one function for each flag, but then how would I deal with combinations of flags? maybe I need to build a function for each flag that returns a list of strings, and pass that to a function that prints to stdout? then it feels like an order-of-operations kind-of-problem, which could be more approachable?

  • yep, breaking out input mutations was the right choice (at least it looks that way so far). the path taken is:

    • loop over files passed
    • for each file, progressively modify the input in-place (overwrite the input with the new state) based on flags passed
  • figuring out how to deal with nonprintables is hard. Thought it'd be easier by using repr(char), but no such luck. currently looking at existing implementations to see what I can learn:

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.