The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> Programming Languages
> Python Programming
|
Perl in Python ?
Discuss Perl in Python ? in the Python Programming forum on Dev Shed. Perl in Python ? Python Programming forum discussing coding techniques, tips and tricks, and Zope related information. Python was designed from the ground up to be a completely object-oriented programming language.
|
|
 |
|
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

February 17th, 2004, 11:11 AM
|
 |
onCsdfeu
|
|
Join Date: Jul 2003
Location: Canada
Posts: 100
Time spent in forums: 2 h 16 m 21 sec
Reputation Power: 10
|
|
|
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
|

February 17th, 2004, 11:48 AM
|
|
Contributing User
|
|
Join Date: Dec 2001
Location: Houston, TX
Posts: 383
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 12
|
|
|
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.
|

February 17th, 2004, 12:11 PM
|
 |
Hello World :)
|
|
Join Date: Mar 2003
Location: Hull, UK
|
|
|
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
|

February 17th, 2004, 12:17 PM
|
 |
Hello World :)
|
|
Join Date: Mar 2003
Location: Hull, UK
|
|
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.
|

February 17th, 2004, 01:24 PM
|
|
Contributing User
|
|
Join Date: Dec 2001
Location: Houston, TX
Posts: 383
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 12
|
|
|
.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.
|

February 17th, 2004, 04:03 PM
|
 |
Hello World :)
|
|
Join Date: Mar 2003
Location: Hull, UK
|
|
|

February 17th, 2004, 04:15 PM
|
|
Contributing User
|
|
Join Date: Dec 2001
Location: Houston, TX
Posts: 383
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 12
|
|
|
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.
|

February 17th, 2004, 04:50 PM
|
 |
Hello World :)
|
|
Join Date: Mar 2003
Location: Hull, UK
|
|
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.
|

February 17th, 2004, 05:06 PM
|
 |
Hello World :)
|
|
Join Date: Mar 2003
Location: Hull, UK
|
|
|

February 17th, 2004, 08:43 PM
|
|
Contributing User
|
|
Join Date: Mar 2003
Posts: 325
Time spent in forums: 7 h 58 m 36 sec
Reputation Power: 11
|
|
|
If you search google for 'perthon' there is something that converts python to perl
Tho better to steer clear of perl neway
|

February 17th, 2004, 08:58 PM
|
|
Contributing User
|
|
Join Date: Feb 2003
Location: Canada
|
|
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.
|

February 17th, 2004, 10:46 PM
|
|
Contributing User
|
|
Join Date: Dec 2001
Location: Houston, TX
Posts: 383
Time spent in forums: 1 h 41 m 27 sec
Reputation Power: 12
|
|
|

February 18th, 2004, 04:19 AM
|
 |
Mini me.
|
|
Join Date: Nov 2003
Location: Cambridge, UK
|
|
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 
|

February 18th, 2004, 05:34 AM
|
 |
Hello World :)
|
|
Join Date: Mar 2003
Location: Hull, UK
|
|
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.
|

February 23rd, 2004, 08:51 AM
|
|
|
Quote: | .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"))
--------------
Quote: | 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
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|