Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. onCsdfeu
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Canada
    Posts
    100
    Rep Power
    12

    Perl in Python ?


    Just a quick question that popped up in my head last night.

    Is there anyh way to import Perl modules ? Or, like, ANY other language's modules or equivalent ?

    I fail to see how it would be possible, but until some time ago I thought Python files couldn't be converted to executables so...
    Time is the greatest of teachers ; sadly, it kills all of its students.
    - Hector Berlioz
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    383
    Rep Power
    13
    Nope, there's not. You can write C modules for Python with something like Pyrex, though. In general, there's no way of doing what you want until something like Parrot gets finished.
    Debian - because life's too short for worrying.
    Best. (Python.) IRC bot. ever.
  4. #3
  5. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    I know there is support for calling perl code in Python using the 'perl' module packaged with ActiveStates ActivePython, whether or not this allows you to import perl module into Python remains to be see since i havnt used it.

    Mark
    programming language development: www.netytan.com Hula

  6. #4
  7. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Actually Strike there is already an environment designed to let you do this kind of thing i.e. multiple language interaction ... DotNET. Looking forward to Parrot though.

    Mark.
    programming language development: www.netytan.com Hula

  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    383
    Rep Power
    13
    .NET isn't pertinent to the discussion because there are no Python bindings for it. I don't even think there are Perl bindings for it.
    Debian - because life's too short for worrying.
    Best. (Python.) IRC bot. ever.
  10. #6
  11. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Beg to differ Strike, i believe there are at least two versions of Python for .NET and one Perl; Theres also one for parrot but i havnt used it yet.. still waiting for the Perl 6 to be released.

    http://starship.python.net/crew/mhammond/dotnet/
    http://aspn.activestate.com/ASPN/NET/
    http://aspn.activestate.com/ASPN/Downloads/PerlNET/More

    Mark.
    programming language development: www.netytan.com Hula

  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    383
    Rep Power
    13
    First link: that package is very experimental, not to mention very old. Hardly something to be considered usable for the general public.
    Second link: the only thing it mentions are "research protoypes" and it links to an "exploratory implementation" which is even older than the first link
    Third link: is a redirect to an implementation of something that allows ASPX to use Perl... not quite a full .NET platform for Perl.

    And if there's a .NET hook in Parrot ... well, unless I'm sorely mistaken Parrot isn't released yet. So, all of this stuff is very beta and not recommended for general use.
    Debian - because life's too short for worrying.
    Best. (Python.) IRC bot. ever.
  14. #8
  15. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Experimental but useable since i've messed around with it a little in the past so Python has one useable .NET port for now and ActiveState are looking into the problem so i'm expecting to see something good there one day .

    The third... i have no idea what you're talking about, there is a basic Python version for parrot is all i was saying . Why port parrot to .NET hehe?

    If you download the souce-code you'll see a bit about Python in there along with some other languages

    Mark.
    programming language development: www.netytan.com Hula

  16. #9
  17. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Ok ok scratch that, theres was an entry on PythonWare a while ago about Python version for .NET coming soon called IronPython... which apparently runs faster than CPython!!!

    http://www.hole.fi/jajvirta/weblog/20031210T0901.html

    Infact this came up today as well which reminded me of when i'd first read about IronPython.

    http://www.deadlybloodyserious.com/P.../16.html#a1404

    Mark.
    programming language development: www.netytan.com Hula

  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2003
    Posts
    325
    Rep Power
    12
    If you search google for 'perthon' there is something that converts python to perl

    Tho better to steer clear of perl neway
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2003
    Location
    Canada
    Posts
    543
    Rep Power
    24
    http://perthon.sourceforge.net/

    lazy_yogi: Why are you telling people that it is better to just steer clear of perl? I'm not agreeing or disagreeing. I'm just curious.
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2001
    Location
    Houston, TX
    Posts
    383
    Rep Power
    13
    Originally Posted by MasterChief
    http://perthon.sourceforge.net/

    lazy_yogi: Why are you telling people that it is better to just steer clear of perl? I'm not agreeing or disagreeing. I'm just curious.
    Why steer clear of perl? This contains a decent summary of why
    Debian - because life's too short for worrying.
    Best. (Python.) IRC bot. ever.
  24. #13
  25. Mini me.
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Location
    Cambridge, UK
    Posts
    783
    Rep Power
    14
    Looks like Strike said it . The fact remains; there are a lot of useful perl scripts. The challenge to us all is to provide equivalent but better functionality. Any (clean) suggestions?

    I once had to tweak cvsweb for local use. I still have nightmares
  26. #14
  27. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Must be the only one here (besides chief) without a terminal dislike for perl .

    Anyway could you not use SOAP to bridge the language gap? Its a bit of a hack admitadly but it could work pretty well if somone wrote a module to make functions in a module/classes/variables accessable via another lang. Just an idea.

    Mark.
    programming language development: www.netytan.com Hula

  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2003
    Posts
    624
    Rep Power
    35
    .NET isn't pertinent to the discussion because there are no Python bindings for it.
    Actually, there are:
    http://zope.org/Members/Brian/PythonNet/

    Not ancient experimental ones either, they are even in active development and up to 1.0-beta3 release.

    Code:
    >>> import CLR
    >>> from CLR.System.Windows.Forms import MessageBox
    >>> MessageBox.Show("Hi There %s" % ("Fred"))
    --------------
    Anyway could you not use SOAP to bridge the language gap? Its a bit of a hack admitadly but it could work pretty well if somone wrote a module to make functions in a module/classes/variables accessable via another lang. Just an idea.
    See also:
    Pythons xmlrpclib and C#s www.xml-rpc.net
Page 1 of 2 12 Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo