Giter Site home page Giter Site logo

HI about pytocs HOT 8 CLOSED

uxmal avatar uxmal commented on September 1, 2024
HI

from pytocs.

Comments (8)

uxmal avatar uxmal commented on September 1, 2024

I tried reaching you on gitter but got no reply.

Pytocs is a translating tool that translates Python source code to C#. This is done by giving pytocs either the name of a Python source file or the name of a file system directory containing Python files. The tool then generates, for each python file, a corresponding translated C# file.

The README.md file contains the instructions for how to build and use the command line version of Pytocs. You can also use the pytocs GUI shell (provided by @SWATOPLUS) if you prefer working that way.

from pytocs.

iammobina avatar iammobina commented on September 1, 2024

from pytocs.

uxmal avatar uxmal commented on September 1, 2024

Here is what happens when I compile the pytocs.sln solution and use the resulting command line program pytocs.exe (which is on my $PATH) to translate a Python file:

C:\tmp\test>copy con test.py
def foo(a, b):
    return a + b
^Z
        1 file(s) copied.

C:\tmp\test>pytocs test.py

C:\tmp\test>type test.py.cs

public static class test {

    public static object foo(object a, object b) {
        return a + b;
    }
}

C:\tmp\test>

I captured this output from cmd.exe. Could you do the same thing on your end to show me exactly how you are using the tool?

from pytocs.

SWATOPLUS avatar SWATOPLUS commented on September 1, 2024

@iammobina Could you send your source file filecontroller.py ? Maybe this file contains some code which is currently unsupported by pytocs. If you send this file, I will test it and try to fix this issue.

from pytocs.

uxmal avatar uxmal commented on September 1, 2024

@SWATOPLUS has a point: although Pytocs should be able to parse most Python 2.x and Python 3.x code, there may naturally be bugs in the Python parser. However, I've seen this error before and most of the time it's because the pytocs command line tool isn't being used correctly.

from pytocs.

iammobina avatar iammobina commented on September 1, 2024

from pytocs.

uxmal avatar uxmal commented on September 1, 2024

I copied the code above to a file, calling it test.py, commented out lines 328-347, consisting mostly of numbers, commas, asterisks and the '->' symbol, and ran pytocs like this on the command line:

D:\dev\tmp>pytocs -r .
AST cache is at: C:\Users\jkl\AppData\Local\Temp\pytocs\ast_cache
100% (1 of 1)   SPEED:   250/s   AVG SPEED:   166/s       Finished loading files. 18 functions were called.
Analyzing uncalled functions.
100% (1 of 1)   SPEED:     0/s   AVG SPEED:     1/s
---------------- Analysis symmary ----------------
- total time: 00:00:00
- modules loaded: 1
- semantic problems: 1
- failed to parse: 0
- number of definitions: 1199
- number of cross references: 1143
- number of references: 703
- resolved names: 596
- unresolved names: 3
- name resolve rate:  99%

D:\dev\tmp>

I've attached the Python file and the resulting C# file (packed in a zip file).

@iammobina: please try doing exactly what I did above, making sure that pytocs.exe is on your PATH.
test.zip

from pytocs.

uxmal avatar uxmal commented on September 1, 2024

Closing due to inactivity. If your issue isnt resolved, reopen.

from pytocs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.