Giter Site home page Giter Site logo

slovenian-python's Introduction

Slovenian Python (Piton) 🐍

A simple python transpiler written in Rust. It introduces Slovenian translations for keywords and some built-in function.

Keywords

| Slovenian   | English   |
|-------------|-----------|
| definiraj   | def       |
| za          | for       |
| v           | in        |
| dokler      | while     |
| vključi     | import    |
| iz          | from      |
| vrni        | return    |
| natisni     | print     |
| obseg       | range     |
| kot         | as        |
| vnos        | input     |
| če          | if        |
| drugače     | else      |
| drugačeče   | elif      |
| in          | and       |
| ali         | or        |
| razred      | class     |
| preveri     | assert    |
| zlomi       | break     |
| nadaljuj    | continue  |
| izbriši     | del       |
| razen       | except    |
| Ne          | False     |
| Da          | True      |
| končno      | finally   |
| globalno    | global    |
| je          | is        |
| Nič         | None      |
| nelokalen   | nonlocal  |
| ne          | not       |
| brez        | pass      |
| dvigni      | raise     |
| poskusi     | try       |
| z           | with      |
| dajaj       | yield     |

How does it work

I built a simple tokenizer that splits keywords while keeping parts like string intact. Then I loop through all keywords and translate them using a hashmap.

How to use

If you want to use this program it is very simple download the .exe from Releases tab and if you want to use it anywhere add the file to Path. To run the code you must have Python installed on your system. Then you can simply run

piton [PATH]

Other options:

-t, --transpile PATH
                        Create a python file from .spy
-r, --run PATH      Run the .spy program
-p, --preview PATH  Preview transpiled .spy program
-h, --help          Get help (output this screen)

Syntax highlighting

If you want some basic syntax highlighting you can istalll VS Code extension from this repo. Go to releases and download the latest version. Then open extensions panel and click the 3-dots and select Install from VSIX.... Then select the downloaded file.

Example

vključi random kot r

ugib = int(vnos("Vnesi št od 1-10: "))

naključna = r.randrange(1, 10)

dokler ugib != naključna:
    če ugib > naključna:
        natisni("Preveč")
    drugače:
        natisni("Premalo")
    ugib = int(vnos("Vnesi št od 1-10: "))
natisni(f"Bravo, naključna št je bila {naključna}")

Contributing

If you find any bugs or issues open an Issue or make a pr.

slovenian-python's People

Contributors

anzlc avatar

Stargazers

chocoearly44 avatar Jakob Tadej Vrtacnik avatar  avatar

Watchers

Lucian avatar  avatar

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.