GithubHelp home page GithubHelp logo

darkarc / set-injection Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 156 KB

A very simple script for quickly generating text, given a collection of inputs.

License: GNU General Public License v3.0

Python 100.00%

set-injection's Introduction

Set Injection

This project is a very simple script for quickly generating text, given a collection of inputs.

Usage

This script requires either the python 2, or python 3 runtime.

To instruct the script to execute its rules on a particular file, simply call the script from the command line with the input file as an argument.

Windows

"Set Injection.py" <target file>

Diclaimer: This syntax -- and the script in general -- has not been tested on Windows.

Linux

python Set\ Injection.py <target file>

Configuration

There are two variables in the script which are of interest:

separateFiles = False

gen = [
    ['a', 'dog'],
    ['my', 'cow'],
    ['a', 'dragon']
]

gen defines the list of outputs. Each sub list will create a new output.

As one might expect, if separateFiles is set, each output will be a new file. If seperateFiles is left at its default value, each output will be appended to the output file.

Example

The default setup, is configured for function with Test.txt:

Hello {{0}} {{1}}

Which is translated to:

Hello a dog
Hello my cow
Hello a dragon

As you can see, the number inside of brackets correlates to the index of the value in the sub list. Thus, {{0}} is resolved to 'a', and {{1}} is resolved to 'dog' in the first output.

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.