Skip to content

radomirbosak/random-ast

Repository files navigation

random-ast

Generates random python 3.6 scripts

random-ast screenshot

Resources:

Usage

python3 randast.py

Don't forget to activate the virtualenv before running the program

pipenv shell

Installation

pipenv install

Supported syntax

  • Literals
    • number
    • string
    • formatted value
    • joined string
    • bytes
    • list
    • tuple
    • set
    • dict
    • ellipsis
    • True, False and None
  • Variables
    • simple
    • starred
  • Expressions
    • unary operations
    • binary operations
    • bool operations
    • comparisons
    • function call
    • inline if expression
    • attribute access
    • index subscripting
    • slice subscripting
    • advanced slicing
    • list comprehension
    • set comprehension
    • generator expression
    • dict comprehension
  • Statements
    • assignment
    • annotated assignment
    • augmented assignment
    • print
    • raise
    • assert
    • delete
    • pass
    • import
    • import from
  • Control flow
    • blocks of code
    • if block
    • for loop
    • while loop
    • break
    • continue
    • try blocks
    • context managers
  • Function and class definitions
    • function definition
    • lambda function
    • return statement
    • yield, yield from
    • global, nonlocal
    • class definition
  • Async and await
    • async function definition
    • await expression
    • async for loop
    • async context managers

About

Generate random python programs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages