Cpy – A C-like scripting language, Cpy provides you a way to write Python codes in C syntax

Cpy is a general-purpose object-oriented scripting language with a C-like syntax. It is easy to learn, powerful, has lots of modules: string, regex, socket, http, multithread, multiprocess…

printf("Hello Cpy!\n");

Cpy official website: http://www.ideawu.com/cpy/
Google code: https://github.com/ideawu/cpy

Views: 10797

7 Responses to "Cpy"

  • Hello,

    Lovely project. I’m trying to switch from C and Perl to Python but I hate the syntax. This is a great way to workaround this inconvenience. Anyway, why following line produces compile error?

    print json.dumps( dict, indent=4 );

    line 31:30 mismatched input u’=’ expecting ‘)’
    Traceback (most recent call last):

    This is valid python statement. Is there cpy way to handle it ? Reply
    @Tester: Hi, Cpy does not support named argument, C doesn’t either. Write it as

    print json.dumps(dict, 4) Reply
    @ideawu: Hi, it compiles but does not work as expected and produced code is exactly the same.
    I tryed this for workaround in produced Python code because it not compiles in cpy:
    print json.dumps(dict,,,,,,,4)
    SyntaxError: invalid syntax

    Maybe it is good to have a way to embed/inline pure python code directly. Let say p{…. code …}p Reply
  • agree with alexy. it’s hard to say C grammar is superior(less expressive). Reply
  • just why? why bother c-like grammar? it’s like two bad things together: c grammar & python speed Reply
    its good for example to people like me. I’m already used to C syntax and I don’t have time to learn python . Reply
    @alexy: C grammar = GOOD, Python speed = BAD. Reply

Leave a Comment