Skip to content
This repository has been archived by the owner on Apr 25, 2023. It is now read-only.

GachiLord/Python2Pseudocode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python2Pseudocode

Python2Pseudocode - is a cli-tool which converts python code to pseudocode for code2flow site.

num_list = [1,2,3]
num_sum = 0
for i in num_list:
    num_sum += i
print(num_sum/(len(num_list)-1))

Converts to

begin;

/num_list,num_sum,i/;

num_list = \[1,2,3\];

num_sum = 0;


while(i in num_list){
num_sum += i;

}

/ num_sum÷(len(num_list)-1) /;


end;

By code2flow converts to

Installation

cd 'Python2Pseudocode_dir' 
pip install -e .

Usage

To get pseudocode of file run 'portable_build.py' or run it:

py2ps file_path

If you want to convert functions(in current file) to procedures run it:

py2ps file_path procedural

This option is experemental. At the moment, it works with code like this:

def get_avr_arithmetic(num_list):
    num_sum = 0

    for i in num_list:
        num_sum += i

    return num_sum/(len(num_list)-1)
print(get_avr_arithmetic([[1,2,3]]))

About

Python to PseudoCode(flow2code) translator

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages