Pfcreator is a handy tool built with Rust and Zig that simplifies the creation of lab practical records. It automates the process of compiling code, running it, and neatly organizing the results into a .docx
file. You can customize the look of your record using a straightforward format.toml
configuration file.
Note
Pfcreator currently supports only .cpp
and .py
.
- Automatically runs your
.cpp
or.py
code files. - Creates a well-structured
.docx
practical record. - Lets you customize the formatting with a
format.toml
file. - Uses a
questions.txt
file to organize your practical questions.
- Run the installer via
curl -fsSL https://raw.githubusercontent.com/UndiedGamer/pfcreator/refs/heads/main/install.sh | sh
- Source your shell profile (
.bashrc
,.zshrc
, etc.) or create a new terminal instance to use thepfcreator
command.
- Enable Windows Subsystem for Linux (WSL).
- Open Ubuntu or your distro of choice in Windows Terminal or from Start Menu.
- Follow Linux steps.
Important
WSL ships with gcc/g++ but it does not ship with python, you might have to install python inside WSL.
- Code Files: Put all your
.cpp
or.py
files into a single folder.
Important
Pfcreator works with either .cpp
(C++) or .py
(Python) files at a time, not both simultaneously.
-
questions.txt
: In the same folder, create a file namedquestions.txt
. Write each practical question, followed by a line of---
to separate them. Like this:Question 1 --- Question 2 --- Question 3
-
format.toml
: Also in the same folder, create aformat.toml
file to define how your record should look. Here's an example:[header] size = 14 # Font size (optional, default is 12) bold = true # Bold text (optional, default is false) text = "Task {n}" # {n} will be the question number align = "center" # Text alignment (optional, default is left) [question] size = 17 bold = true text = "Q) {question}" # {question} will be taken from questions.txt [solution] size = 12 text = "{solution}" # {solution} will be your code [solution.title] size = 14 bold = true underline = true text = "Code:" [output] size = 12 text = "{output}" # {output} will be the program's output [output.title] size = 14 bold = true underline = true text = "Output:" # Optional footer [footer] size = 10 text = "Made by Hemanth" align = "right"
-
Open your terminal and go to the folder with your files.
-
Run this command:
pfcreator <file_extension> <folder_path>
- Replace
<file_extension>
withcpp
orpy
(depending on your code files). - Replace
<folder_path>
with the path to your folder.
For example:
pfcreator cpp my_cpp_practical
or
pfcreator py my_python_practical
- Replace
Your .docx
practical record will be created inside the folder you specified (my_cpp_practical
or my_python_practical
in the examples).
These are special tags in your format.toml
that Pfcreator replaces:
{n}
: The question number.{question}
: The question fromquestions.txt
.{solution}
: Your code.{output}
: The output of your code.
Note to self: add windows deprecation in future section here