Python released on Morphos
  • Order of the Butterfly
    Order of the Butterfly
    Yomgui
    Posts: 348 from 2004/8/31
    From: Québec - Canada
    Hi,

    I've just released Python (2.4) in a shared library form (python.library)

    The archive can be downloaded here: http://wikipeg.free.fr/download/utils/python-2.4-mos_5c-20050501.lha

    More information about it here (sorry, only a french version, translation in english when I have more spare time ;-)): http://wikipeg.free.fr/wikini/wakka.php?wiki=Python

    There is a patch for this release (20050502) on the same page. Corrections: upper() method of string fixed, os.fstab() result fixed

    PS: just one thing: Developer directory is not usable yet. sorry. :-(

    [ Edited by Yomgui on 2005/5/4 11:46 ]
    And now... next project!
  • »02.05.05 - 11:59
    Profile Visit Website
  • Paladin of the Pegasos
    Paladin of the Pegasos
    tokai
    Posts: 1289 from 2003/2/25
    From: binaryriot
    Congrats for finishing it!

    Hope someone can help you with the english site. :) Atm. I don't know what I could use the lib for . But I made a quick port of phyton once myself (w/o need on my own), so i know it's quite some complex project to make a shared library out of it.

    Arent there e.g. bittorrent clients out there which are using phyton? Wonder if they could be used now.


    okay.. next: downloading the archive :P

    regards,
    tokai
  • »02.05.05 - 12:28
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    Yomgui
    Posts: 348 from 2004/8/31
    From: Québec - Canada
    module "socket" works pretty well on my Peg1+Miami 3.2 (classic)... I've not tested with others TCP/IP stacks.

    You can found many and many working scripts on web ;-)
    And now... next project!
  • »02.05.05 - 12:42
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    marcik
    Posts: 268 from 2003/4/12
    From: Kielce/Krakow,...
    Just tryed oryginal BT client. Downloaded sources for sourcefore, type python setup.py and this worked ok. But it fails when I want to run it:

    Ram Disk:BitTorrent-4.0.1/build/scripts-2.4> python btdownloadgui.py --url http://www.torrent.to/torrent/cache/49959-197-DVDFabPlatinumv2.83.Shared.by.[www.torrent.to].rar.torrent
    Traceback (most recent call last):
    File "btdownloadgui.py", line 24, in ?
    import threading
    File "SYS:libs/python2.4/threading.py", line 6, in ?
    import thread
    ImportError: No module named thread

    BTW. Great work. Waiting for Bledner now :)
  • »02.05.05 - 12:48
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Yomgui
    Posts: 348 from 2004/8/31
    From: Québec - Canada
    >ImportError: No module named thread

    It's normal... there is no thread module yet, because I've not ported the multithreading system yet :-(

    There is an other bug : upper method of string doesn't work (???), the lower() does.

    try this:

    >>> "tEsT".upper()
    tEsT
    >>> "tEsT".lower()
    test
    >>>

    [ Edited by Yomgui on 2005/5/2 13:57 ]

    [ Edited by Yomgui on 2005/5/2 14:00 ]
    And now... next project!
  • »02.05.05 - 12:50
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    marcik
    Posts: 268 from 2003/4/12
    From: Kielce/Krakow,...
    Ahh, ok. But I hope you have it in yours ToDo list? Having BT client running would be very nice thing :-).
  • »02.05.05 - 12:53
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Yomgui
    Posts: 348 from 2004/8/31
    From: Québec - Canada
    sure! it's in it. But it's very complex to do. Python has an POSIX architecture... not very compliant with Morphos arch :-o


    hmm... an other thing: there is no GUI module (no Tkinter module support). because there is no port of TCL/TK on Morphos.

    [ Edited by Yomgui on 2005/5/2 14:02 ]
    And now... next project!
  • »02.05.05 - 12:58
    Profile Visit Website
  • Butterfly
    Butterfly
    killlbilll
    Posts: 95 from 2004/5/19
    Great work, Yomgui :)

    Any timeframe on the threads implementation? I would love to have Bittorrent & Bittornado on mos =)
    [ pegasos ii / g4 | morphos1.4.4 ]
  • »02.05.05 - 13:10
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Yomgui
    Posts: 348 from 2004/8/31
    From: Québec - Canada
    I've read a little bit BT python source code. I've seen that it uses the gtk module for GUI.... but gtk'll not be ported soon ;-)

    For the thread pb, check the Python Library documentation here about dummy_thread:

    http://docs.python.org/lib/module-dummythread.html
    And now... next project!
  • »02.05.05 - 14:02
    Profile Visit Website
  • Butterfly
    Butterfly
    killlbilll
    Posts: 95 from 2004/5/19
    GUI is not very important for bittorrent imho :) Ansi would suffice.
    [ pegasos ii / g4 | morphos1.4.4 ]
  • »02.05.05 - 14:08
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Yomgui
    Posts: 348 from 2004/8/31
    From: Québec - Canada
    @killbill:
    [correction]

    There is a dummy_threading module too, so search in BT source code the sentence "import threading" and change it by this:

    try:
    ....import threading as _threading
    except:
    ....import dummy_threading as _threading

    (replace dots by spaces)


    [ Edited by Yomgui on 2005/5/2 15:45 ]
    And now... next project!
  • »02.05.05 - 14:18
    Profile Visit Website
  • Leo
  • Order of the Butterfly
    Order of the Butterfly
    Leo
    Posts: 417 from 2003/8/18
    Hum... zlib is missing as well :(

    Leo.
    Nothing hurts a project more than developers not taking the time to let their community know what is going on.
  • »02.05.05 - 17:52
    Profile Visit Website
  • Yokemate of Keyboards
    Yokemate of Keyboards
    magnetic
    Posts: 2129 from 2003/3/1
    From: Los Angeles
    Yomgui

    Excellent. thanks for the port. Now will it be possible for say FREEVO to be ported to MOS? Since its python afaik?

    tia
    magnetic
    Pegasos 2 Rev 2B3 w/ Freescale 7447 "G4" @ 1ghz / 1gb Nanya Ram
    Quad Boot: MorphOS 2.7 | Amiga OS4.1 U4 | Ubuntu PPC GNU/Linux | OS X 10.4
  • »02.05.05 - 18:01
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    Yomgui
    Posts: 348 from 2004/8/31
    From: Québec - Canada
    @Leo: z.library is not public. For a next MOS release ;-)
    But it's not needed to run many scripts.
    And now... next project!
  • »03.05.05 - 09:11
    Profile Visit Website
  • Leo
  • Order of the Butterfly
    Order of the Butterfly
    Leo
    Posts: 417 from 2003/8/18
    @Yomgui: at least needed by Bittorrent...

    Leo.
    Nothing hurts a project more than developers not taking the time to let their community know what is going on.
  • »03.05.05 - 11:02
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    MarK
    Posts: 641 from 2004/1/25
    From: Prague, The Cz...
    hi all,

    is there a plan to port also all the modules? modules are the python's biggest strength, and i know ppl, who works in python under linux and would like to be able to work also under morphos...

    bye, MarK.
  • »04.05.05 - 08:18
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Yomgui
    Posts: 348 from 2004/8/31
    From: Québec - Canada
    @MarK :

    Yes, there is a plan to be able to develop your own C modules and import them dynamicaly. But Posix shared libs and Amiga shared libs haven't same "concepts". And on Posix, they melt everything without any shared concept (global variables not sem protected, give files pointers or memory allocated blocks between thread and do close() or free() on it... and a native port of any posix code is a nightmare !)
    And now... next project!
  • »04.05.05 - 10:51
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    DiskDoctor
    Posts: 306 from 2009/4/17
    From: Rzeszow, place...
    Hi,

    What about other modules? E.g. what do I need to compile it on MOS 2.4?

    Do I need gcc or it is included in MOS2.4? To what extent can I compile libraries using setup.py scripts?

    And most important thing - do you suggest any GUI toolkit? (like wxpython, tk, qt etc.)
    Was: Mac Mini PPC running MorphOS 2.4
    Now: Amiga Forever 2010 with AmiKit and AmigaSYS
    Not used: Icaros Desktop 1.2 (reason: no wifi)
    Planned soon: an OS4 system
    Shortly then: a MOS notebook (wifi is a must-have)
  • »25.10.09 - 14:49
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Yomgui
    Posts: 348 from 2004/8/31
    From: Québec - Canada
    @DiskDoctor: that's fun: I've just released few minutes before your post Python 2.5.4

    Get it from here:
    http://www.yomgui.fr/yiki/doku.php/en:dev:python:start

    About building modules: after your C module is written, you need to create a setup.py script. Check official documentation for that (http://www.python.org/doc/2.5.4/ext/building.html).

    I've configured distutils for gcc. look inside libs:python2.5/distutils if you need to change for another compiler.
    Normally you don't have to change anything in this module by yourself.

    GUI toolkit = PyMUI! the release date is near!

    (PyMUI = http://yellowblue.free.fr/yiki/doku.php/dev:pymui:start (french only))

    NOTE: set the enviromental variable PYTHONINCLUDEDIR with the pathname on python includes.
    If you follow the install manual on my wiki, type this shell command in a console:

    Code:
    setenv save PYTHONINCLUDEDIR usr:local/include/python


    [ Edited by Yomgui on 2009/10/25 19:09 ]
    And now... next project!
  • »25.10.09 - 15:58
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    DiskDoctor
    Posts: 306 from 2009/4/17
    From: Rzeszow, place...
    @Yomgui

    I have questions:

    1. How to install python2.5 (I am pretty new at MorphOS, also do not want to fall into Linux installing soap opera, unless mandatory)
    2. How to make both python2.4 and 2.5 environments separate? (e.g. which python.library in System:Libs?)
    3. What about PIL intallation?
    4. Any schedule for PyMUI yet?
    5. What is the way of creating standalone MUI apps in python? (I know the solution in Linux, Windows and OSX already)
    6. Any "special" MorphOS way of using source distros e.g. instead of python setup.py install, is there anything I should change?
    Was: Mac Mini PPC running MorphOS 2.4
    Now: Amiga Forever 2010 with AmiKit and AmigaSYS
    Not used: Icaros Desktop 1.2 (reason: no wifi)
    Planned soon: an OS4 system
    Shortly then: a MOS notebook (wifi is a must-have)
  • »07.11.09 - 09:31
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    DiskDoctor
    Posts: 306 from 2009/4/17
    From: Rzeszow, place...
    @Yomgui

    Never mind. A matter of adjusting to the new system. It's not that bad :-)

    Quote:


    1. How to install python2.5 (I am pretty new at MorphOS, also do not want to fall into Linux installing soap opera, unless mandatory)
    2. How to make both python2.4 and 2.5 environments separate? (e.g. which python.library in System:Libs?)
    3. What about PIL intallation?
    4. Any schedule for PyMUI yet?
    5. What is the way of creating standalone MUI apps in python? (I know the solution in Linux, Windows and OSX already)
    6. Any "special" MorphOS way of using source distros e.g. instead of python setup.py install, is there anything I should change?


    Python2.5 and PIL -a matter of carefully copying the respective files. Unfortunately python.library is hardcopied in python binary so changing names to python-2.4.4 and python-2.5.4 won't work (unless you hex edit the file which I'll eventually do). So for now, only ONE python version is accessible per system run (since the library can be loaded once, also has to be named python.library)

    While I await PyMUI, I'll try to install some additional modules myself. Btw please, update the link at python.org. Also my concern is, do such sites like http://www.monkeyhouse.eclipse.co.uk/amiga/python/ provide any useful information?
    Was: Mac Mini PPC running MorphOS 2.4
    Now: Amiga Forever 2010 with AmiKit and AmigaSYS
    Not used: Icaros Desktop 1.2 (reason: no wifi)
    Planned soon: an OS4 system
    Shortly then: a MOS notebook (wifi is a must-have)
  • »07.11.09 - 10:31
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12058 from 2003/5/22
    From: Germany
    > Any schedule for PyMUI yet?

    There has been a public alpha once:

    https://morph.zone/modules/newbb_plus/viewtopic.php?topic_id=5655&forum=51
  • »07.11.09 - 10:57
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    DiskDoctor
    Posts: 306 from 2009/4/17
    From: Rzeszow, place...
    Yeah... but the file is missing.

    Anyway I managed to write the first Excel reader PoC. The app reads out an xls file and outputs a PIL picture with the table. Unfortunately I still need zlib under MorphOS, maybe I'll find some workaround...

    Anyway while waiting for PyMUI, I will look into building standalone distros on MorphOS :-) BTW anybody has access th this previous aplha rlease?? I'd be grateful.
    Was: Mac Mini PPC running MorphOS 2.4
    Now: Amiga Forever 2010 with AmiKit and AmigaSYS
    Not used: Icaros Desktop 1.2 (reason: no wifi)
    Planned soon: an OS4 system
    Shortly then: a MOS notebook (wifi is a must-have)
  • »07.11.09 - 19:38
    Profile
  • Yokemate of Keyboards
    Yokemate of Keyboards
    Andreas_Wolf
    Posts: 12058 from 2003/5/22
    From: Germany
    > waiting for PyMUI

    v0.1 is released now.
  • »10.11.09 - 11:47
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    Yomgui
    Posts: 348 from 2004/8/31
    From: Québec - Canada
    1) Yeah, I've just released everything yesterday!
    I've made English translation this morning and a news on AmigaImpact and MorphZone, I'm waiting for modo to validate it now ;-)

    2) Please forget any previous and old posts about PyMUI. Nothing related now.

    3) DiskDoctor: yes you've put the finger on a bug: not possible to have two python.library...

    Normally, the AmigaOS exec design is made in such way that libraries are versionned. So, an update of a lib shall be done by changing the version number and not the library name.

    But the fact that functions entry points are located at static posistion, hard-coded in .h files (pouah!) causes that the order and posistion of these functions shall not be changed during the life time of the library.

    This is the problem: The 2.5.4 library is not compatible with the 2.4.x and below. I've changed many functions and the overall way to support the Python functions pool.

    Be sure that I will not change the lib func order (FD's) for 2.x releases.
    But be aware that there is a risk of incompatibility for the 3.x (I don't know yet... I'll try my best).

    So for now, I thing it could be possible to have 2.5 and 2.4 on the same system... I need to check something at home. I'll reply here if it works ;-)

    4) be aware that r39 of Python works as well as r41 except that zlib module missing in r39 archive, but can be found on the same page. And there are also a bug fix fixed in r41 (see on my bugtracker: http://yellowblue.free.fr/bugtracker/view.php?id=18)

    5) RTFM as always 8-)
    And now... next project!
  • »10.11.09 - 12:54
    Profile Visit Website