Skip to main content

Uglify C code

Project description

Uglifyc

This python script uglifies a C file by moving the charachters in char_list to the right (10 spaces to the right of the longest line)

Installation

Install it via pip

pip install uglifyc

It can be run 2 ways:

uglifyc [input] -o [output]
uglifyc [input(s)]

This last one will output to [file]_uglified.c

And the input can also be overwritten (not reccommended)

uglifyc [input(s)] --overwrite

[input(s)] means many files can be changed

Examples

Input

#include <stdio.h>
struct student {
    char name[50];
    int roll;
    float marks;
} s;

int main() {
    printf("Enter information:\n");
    printf("Enter name: ");
    fgets(s.name, sizeof(s.name), stdin);

    printf("Enter roll number: ");
    scanf("%d", &s.roll);
    printf("Enter marks: ");
    scanf("%f", &s.marks);

    printf("Displaying Information:\n");
    printf("Name: ");
    printf("%s", s.name);
    printf("Roll number: %d\n", s.roll);
    printf("Marks: %.1f\n", s.marks);

    return 0;
}

Output

#include <stdio.h>                                 
struct student                                    {
    char name[50]                                 ;
    int roll                                      ;
    float marks                                   ;
} s                                               ;

int main(                                       ) {
    printf("Enter information:\n"                );
    printf("Enter name: "                        );
    fgets(s.name, sizeof(s.name), stdin          );

    printf("Enter roll number: "                 );
    scanf("%d", &s.roll                          );
    printf("Enter marks: "                       );
    scanf("%f", &s.marks                         );

    printf("Displaying Information:\n"           );
    printf("Name: "                              );
    printf("%s", s.name                          );
    printf("Roll number: %d\n", s.roll           );
    printf("Marks: %.1f\n", s.marks              );

    return 0                                      ;
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

uglifyc-0.1.5.tar.gz (2.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page