f



Python

Is anyone working with the Risc OS version of Python, and particularly with
the interface to the WIMP? I am having some difficulty, and would like to
hear from someone who has made it work.

-- 
 __  __  __  __      __ ___   _____________________________________________
|__||__)/ __/  \|\ ||_   |   / Acorn StrongArm Risc_PC
|  ||  \\__/\__/| \||__  |  /...Internet access for all Acorn RISC machines
___________________________/ dhwild@argonet.co.uk
0
dhwild (153)
2/24/2004 9:23:53 AM
comp.sys.acorn.misc 5707 articles. 0 followers. michael104 (366) is leader. Post Follow

17 Replies
621 Views

Similar Articles

[PageSpeed] 9

In message <4c85aed9a7dhwild@argonet.co.uk>
          David H Wild <dhwild@argonet.co.uk> wrote:

> Is anyone working with the Risc OS version of Python, and
> particularly with the interface to the WIMP? I am having some
> difficulty, and would like to hear from someone who has made it
> work.

I've done some playing around with Python, and the WIMP - mainly
toolbox stuff. It's not a lot, but I might be able to help.


Simon

0
simon5740 (9)
2/25/2004 7:50:45 PM
In article <55146c864c.simon@velvet.callan.demon.co.uk>,
   Simon Callan <simon@callan.demon.co.uk> wrote:
> > Is anyone working with the Risc OS version of Python, and
> > particularly with the interface to the WIMP? I am having some
> > difficulty, and would like to hear from someone who has made it
> > work.

> I've done some playing around with Python, and the WIMP - mainly
> toolbox stuff. It's not a lot, but I might be able to help.

Thank you; I was afraid that I wasn't going to get any replies. I'll send
you an email in the next day or two.


I'm only trying to do simple stuff at the moment, but I can't get David
Boddie's examples to work properly.

-- 
 __  __  __  __      __ ___   _____________________________________________
|__||__)/ __/  \|\ ||_   |   / Acorn StrongArm Risc_PC
|  ||  \\__/\__/| \||__  |  /...Internet access for all Acorn RISC machines
___________________________/ dhwild@argonet.co.uk
0
dhwild (153)
2/25/2004 10:07:45 PM
In article <4c86789f6ddhwild@argonet.co.uk>, David H Wild
<URL:mailto:dhwild@argonet.co.uk> wrote:
> I'm only trying to do simple stuff at the moment, but I can't get David
> Boddie's examples to work properly.
Did you download the latest archive Python-2/3-additions-2003-08-03_v2/zip?
This is an update from last October because the first version of these
examples did not set the Wimpslot correctly.

Regards,

Dietmar

0
dietmar (27)
2/26/2004 7:26:37 PM
In message <ant2619370b02%2U@schwertberger.freenet.de>
          Dietmar Schwertberger <dietmar@schwertberger.de> wrote:

> In article <4c86789f6ddhwild@argonet.co.uk>, David H Wild
> <URL:mailto:dhwild@argonet.co.uk> wrote:
> > I'm only trying to do simple stuff at the moment, but I can't get David
> > Boddie's examples to work properly.
> Did you download the latest archive Python-2/3-additions-2003-08-03_v2/zip?
> This is an update from last October because the first version of these
> examples did not set the Wimpslot correctly.
> 
> Regards,
> 
> Dietmar
> 
Anyone know if RISC OS Python supports threading? I'm getting:

*python btdownloadcurses/py
Traceback (most recent call last):
  File "btdownloadcurses/py", line 6, in ?
    from BitTorrent.download import download
  File "BitTorrent.download/py", line 9, in ?
    from StorageWrapper import StorageWrapper
  File "BitTorrent.StorageWrapper/py", line 5, in ?
    from threading import Event
  File "ADFS::Aardvark.$.!BOOT.Resources.!Python.Lib.threading/py", line 6, in ?
    import thread
ImportError: No module named thread
*

Alex.
-- 
E-mail: alex@archifishal.co.uk
WWW:    http://www.archifishal.co.uk/
MSN:    archifishal@gmx.co.uk
0
nospam1325 (337)
2/29/2004 10:30:45 AM
In article <fa148884c%alexandm@aardvark.archifishal.co.uk>,
Alex Macfarlane Smith <URL:mailto:nospam@archifishal.co.uk> wrote:
> Anyone know if RISC OS Python supports threading? I'm getting:

Definitely not. RISC OS Python is based on Acorn/Norcroft C and its
libraries. I'm not aware of a multithreading library for these.


Regards,

Dietmar

0
dietmar (27)
2/29/2004 1:14:10 PM
In article <fa148884c%alexandm@aardvark.archifishal.co.uk>,
Alex Macfarlane Smith  <alex@archifishal.co.uk> wrote:
>Anyone know if RISC OS Python supports threading? I'm getting:
>
>*python btdownloadcurses/py
>Traceback (most recent call last):
>  File "btdownloadcurses/py", line 6, in ?
>    from BitTorrent.download import download
>  File "BitTorrent.download/py", line 9, in ?
>    from StorageWrapper import StorageWrapper
>  File "BitTorrent.StorageWrapper/py", line 5, in ?
>    from threading import Event
>  File "ADFS::Aardvark.$.!BOOT.Resources.!Python.Lib.threading/py", line 6, in ?
>    import thread
>ImportError: No module named thread

As already answered, no it doesn't but...

If threads are not essential you may be able to use dummy_thread as a
'brain-dead substitute': import dummy_thread as thread or even just copy
dummy_thread.py to thread.py (?).

I had TinyHTTPProxy working with this for a while, until I discovered how to
omit the ThreadingMixIn in the first place.

	nhoJ

-- 
John P Baker
0
ccjpb (39)
2/29/2004 3:17:48 PM
In article <HtuqHo.HJ7@bath.ac.uk>, JP. Baker
<URL:mailto:ccjpb@shark.cse.bris.ac.uk> wrote:
> In article <fa148884c%alexandm@aardvark.archifishal.co.uk>,
> Alex Macfarlane Smith  <alex@archifishal.co.uk> wrote:
> >Anyone know if RISC OS Python supports threading? I'm getting:
> >
> >*python btdownloadcurses/py
> >Traceback (most recent call last):
> >  File "btdownloadcurses/py", line 6, in ?
> >    from BitTorrent.download import download
> >  File "BitTorrent.download/py", line 9, in ?
> >    from StorageWrapper import StorageWrapper
> >  File "BitTorrent.StorageWrapper/py", line 5, in ?
> >    from threading import Event
> >  File "ADFS::Aardvark.$.!BOOT.Resources.!Python.Lib.threading/py", line 6, in ?
> >    import thread
> >ImportError: No module named thread
> 
> As already answered, no it doesn't but...
> 
> If threads are not essential you may be able to use dummy_thread as a
> 'brain-dead substitute': import dummy_thread as thread or even just copy
> dummy_thread.py to thread.py (?).
> 
> I had TinyHTTPProxy working with this for a while, until I discovered how to
> omit the ThreadingMixIn in the first place.
I don't know much about BitTorrent. If it uses one thread per stream,
it should be possible to make it use only a single thread/stream.
Would not be high performance, but it could work.



Regards,

Dietmar

0
dietmar (27)
2/29/2004 8:53:56 PM
Dietmar Schwertberger wrote:

>In article <fa148884c%alexandm@aardvark.archifishal.co.uk>,
>Alex Macfarlane Smith <URL:mailto:nospam@archifishal.co.uk> wrote:
>  
>
>>Anyone know if RISC OS Python supports threading? I'm getting:
>>    
>>
>
>Definitely not. RISC OS Python is based on Acorn/Norcroft C and its
>libraries. I'm not aware of a multithreading library for these.
>  
>
Are you aware that the UnixLib in the current GCCSDK trunk has pthread 
support ? Would that help making threading available in Python ?

John.
0
this (338)
3/1/2004 7:55:06 AM
In article <4042ebd0$0$253$4d4efb8e@news.be.uu.net>, John Tytgat
<URL:mailto:this@is.invalid> wrote:
> Are you aware that the UnixLib in the current GCCSDK trunk has pthread 
> support ? Would that help making threading available in Python ?
Yes I know (I don't know whether it works under both TaskWindow and WIMP,
though).
I think the main UnixLib problem (non-expandable WimpSlot) is solved
in more recent versions. This was a no-go with previous versions.


With some effort it should be possible to convert RISC OS Python to
UnixLib, but it's rather unlikely as I don't have the time do do so...


Regards,

Dietmar

0
dietmar (27)
3/1/2004 7:49:14 PM
In message <ant0119140b02%2U@schwertberger.freenet.de>
          Dietmar Schwertberger <dietmar@schwertberger.de> wrote:

> In article <4042ebd0$0$253$4d4efb8e@news.be.uu.net>, John Tytgat
> <URL:mailto:this@is.invalid> wrote:
> > Are you aware that the UnixLib in the current GCCSDK trunk has pthread 
> > support ? Would that help making threading available in Python ?
> Yes I know (I don't know whether it works under both TaskWindow and WIMP,
> though).
> I think the main UnixLib problem (non-expandable WimpSlot) is solved
> in more recent versions. This was a no-go with previous versions.

Fair enough, but we've done considerable work in these areas.

> With some effort it should be possible to convert RISC OS Python to
> UnixLib, but it's rather unlikely as I don't have the time do do so...

....it should be virtually no effort at all. Unixlib supports (just
about) a superset of SharedCLibrary functionality, so should "just" be
a matter of recompiling.  Alterntatively, I happen to know that it will
cross compile with relatively little effort using my porting tools.
Whether it's a good idea or not is a different issue.


-- 
Peter Naulls - peter@chocky.org        | http://www.chocky.org/
----------------------------------------------------------------------------
GCC for RISC OS                        | http://hard-mofo.dsvr.net/gcc/
0
peter4500 (2516)
3/1/2004 8:32:25 PM
In article <d71203894c.peter@chocky.org>, Peter Naulls
<URL:mailto:peter@chocky.org> wrote:
> In message <ant0119140b02%2U@schwertberger.freenet.de>
>           Dietmar Schwertberger <dietmar@schwertberger.de> wrote:
> > With some effort it should be possible to convert RISC OS Python to
> > UnixLib, but it's rather unlikely as I don't have the time do do so...
> 
> ...it should be virtually no effort at all. Unixlib supports (just
> about) a superset of SharedCLibrary functionality, so should "just" be

I don't think that SharedCLibrary to Unixlib would be a problem, but
the replacement of TCPIPLibs incl. unixlib (note the small 'u') could
require some work.

The distributed 26 bit version of TCPIPLibs required many #ifdefs, not
only due to incompatibilities to Unix but also due to incompatibilities
to the (Shared)CLibrary.
With the introduction of the 32 bit version the number of RISC OS specific
#ifdefs decreased significantly.

Does anybody have experience in porting a Unix networking application from
the Acorn libraries to Unixlib? Many changes required?
I don't think it would be too complicated, but still I don't have the time
at the moment. Maybe later this year...


> a matter of recompiling.  Alterntatively, I happen to know that it will
> cross compile with relatively little effort using my porting tools.
> Whether it's a good idea or not is a different issue.
I'm not familiar with these. What would be the disadvantages?
(using dlk for dynamically loading libraries could be a problem...)


Regards,

Dietmar

0
dietmar (27)
3/1/2004 10:55:49 PM
In message <ant0122491cb2%2U@schwertberger.freenet.de>
          Dietmar Schwertberger <dietmar@schwertberger.de> wrote:

> In article <d71203894c.peter@chocky.org>, Peter Naulls

> The distributed 26 bit version of TCPIPLibs required many #ifdefs, not
> only due to incompatibilities to Unix but also due to incompatibilities
> to the (Shared)CLibrary.
> With the introduction of the 32 bit version the number of RISC OS specific
> #ifdefs decreased significantly.

I think the best thing here would be to go back to the original Unix
sources wrt these issues.  Unixlib is of course supposed to work
seamlessly with these.

> > a matter of recompiling.  Alterntatively, I happen to know that it will
> > cross compile with relatively little effort using my porting tools.
> > Whether it's a good idea or not is a different issue.
> I'm not familiar with these. What would be the disadvantages?
> (using dlk for dynamically loading libraries could be a problem...)

Hard to say in advance, but there's always the chance of something
subtle.  The Unixlib binary will of course be bigger.


-- 
Peter Naulls - peter@chocky.org        | http://www.chocky.org/
----------------------------------------------------------------------------
Drobe - http://www.drobe.co.uk/        | The Premier RISC OS News Site
0
peter4500 (2516)
3/1/2004 11:32:02 PM
In article <ce8413894c.peter@chocky.org>, Peter Naulls
<URL:mailto:peter@chocky.org> wrote:
> In message <ant0122491cb2%2U@schwertberger.freenet.de>
>           Dietmar Schwertberger <dietmar@schwertberger.de> wrote:
> 
> > In article <d71203894c.peter@chocky.org>, Peter Naulls
> 
> > The distributed 26 bit version of TCPIPLibs required many #ifdefs, not
> > only due to incompatibilities to Unix but also due to incompatibilities
> > to the (Shared)CLibrary.
> > With the introduction of the 32 bit version the number of RISC OS specific
> > #ifdefs decreased significantly.
> 
> I think the best thing here would be to go back to the original Unix
> sources wrt these issues.  Unixlib is of course supposed to work
> seamlessly with these.

The required #ifdef changes could be found out by trial and error.
If the #ifdef is wrong, the compiler stops.

Additionally a suitable config.h file would be needed. On Unix this is
created by a configure script. For RISC OS the config.h has to be written
manually. Which Unix platform is Unixlib most compatible to? This
platform's file could be used as starting point.
The definitions are mainly regarded to header files (e.g. HAVE_FCNTL_H),
availability of functions (e.g. HAVE_FTRUNCATE), data type availability
(e.g. HAVE_LONGLONG), data type properties (e.g. SIZEOF_VOID_P) and
subsitution of data types (e.g. #define socklen_t int).


Regards,

Dietmar

0
dietmar (27)
3/2/2004 8:41:40 PM
In message <ant0220400b02%2U@schwertberger.freenet.de>
          Dietmar Schwertberger <dietmar@schwertberger.de> wrote:

> In article <ce8413894c.peter@chocky.org>, Peter Naulls
> <URL:mailto:peter@chocky.org> wrote:

> > I think the best thing here would be to go back to the original Unix
> > sources wrt these issues.  Unixlib is of course supposed to work
> > seamlessly with these.
> 
> The required #ifdef changes could be found out by trial and error.
> If the #ifdef is wrong, the compiler stops.

For the SharedCLibrary, yes.  For Unixlib, there's reasonable grounds
to argue that Unixlib's headers are wrong.  Of course, considerable
work has gone into them, so this will only be true in a small number of
instances.  In short, there probably won't be any problems, and I've
already indicated that should already compile with Unixlib.

> Additionally a suitable config.h file would be needed. On Unix this is
> created by a configure script. For RISC OS the config.h has to be written
> manually. Which Unix platform is Unixlib most compatible to? This
> platform's file could be used as starting point.

That's easy - the one created for RISC OS by my cross compiling tools
when running in the Unix environment of your choice.

-- 
Peter Naulls - peter@chocky.org        | http://www.chocky.org/
----------------------------------------------------------------------------
AcornSearch - http://www.drobe.co.uk/  | Relevant RISC OS searches
0
peter4500 (2516)
3/2/2004 9:56:56 PM
In article <e6a58e894c.peter@chocky.org>, Peter Naulls
<URL:mailto:peter@chocky.org> wrote:
> In message <ant0220400b02%2U@schwertberger.freenet.de>
>           Dietmar Schwertberger <dietmar@schwertberger.de> wrote:
> > Additionally a suitable config.h file would be needed. On Unix this is
> > created by a configure script. For RISC OS the config.h has to be written
> > manually. Which Unix platform is Unixlib most compatible to? This
> > platform's file could be used as starting point.
> 
> That's easy - the one created for RISC OS by my cross compiling tools
From this and your former posting I assume that you already have a config.h.
Is that true?
(The former posting:
 "Alterntatively, I happen to know that it will cross compile with
  relatively little effort using my porting tools.")


> when running in the Unix environment of your choice.
The Unix environment of my choice does not yet exist...


Regards,

Dietmar

0
dietmar (27)
3/2/2004 11:29:38 PM
In message <ant0223381cb2%2U@schwertberger.freenet.de>
          Dietmar Schwertberger <dietmar@schwertberger.de> wrote:

> In article <e6a58e894c.peter@chocky.org>, Peter Naulls
> <URL:mailto:peter@chocky.org> wrote:

> From this and your former posting I assume that you already have a config.h.
> Is that true?

I believe so, but it would be best for you to tell me what version of
python you want it against, and I can make it for you.

> > when running in the Unix environment of your choice.
> The Unix environment of my choice does not yet exist...

This includes Cygwin under Windows, if you have that available.  Mac OS
X doesn't quite work yet, because no one's gotten round to fixing
endian issues in the linker.  Or of course any only Linux box will do.


-- 
Peter Naulls - peter@chocky.org        | http://www.chocky.org/
----------------------------------------------------------------------------
Unix Programs on RISC OS               | http://www.chocky.org/unix/
0
peter4500 (2516)
3/2/2004 11:38:43 PM
In article <47f797894c.peter@chocky.org>, Peter Naulls
<URL:mailto:peter@chocky.org> wrote:
> In message <ant0223381cb2%2U@schwertberger.freenet.de>
>           Dietmar Schwertberger <dietmar@schwertberger.de> wrote:
> 
> > In article <e6a58e894c.peter@chocky.org>, Peter Naulls
> > <URL:mailto:peter@chocky.org> wrote:
> 
> > From this and your former posting I assume that you already have a config.h.
> > Is that true?
> 
> I believe so, but it would be best for you to tell me what version of
> python you want it against, and I can make it for you.
Quite simple: Whatever version will be current.


> > > when running in the Unix environment of your choice.
> > The Unix environment of my choice does not yet exist...
> 
> This includes Cygwin under Windows, if you have that available.  Mac OS
I've a minimal Cygwin available for running PostgreSQL.
The above solution would be easier for me...
I'll contact you when I'll have some spare time.


Regards,

Dietmar

0
dietmar (27)
3/3/2004 9:30:34 PM
Reply: