Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
65 user(s) are online (58 user(s) are browsing Forums)

Members: 1
Guests: 64

davec555, more...

Support us!

Headlines

 
  Register To Post  

python and threads
Quite a regular
Quite a regular


See User information
Hi all,

I have this issue with python on AOS4:

I try to add thread that does a loop, but the programs doesn't continues unless the thread is killed (ctrl-c).
The same code on linux does that it should (enters the loop, "appended ..." message is printed. main program sleeps 10 seconds, quit=1->thread dies...)

Any ideas?
The code(replace "!" with spaces, indentation is crucial in python):


#!/usr/bin/python
import sys
import time
import threading
import os

def mloop():
!!while not quit:
!!!!print "loop"
!!!!print time.time()
!!!!os.system("sleep 2")
!!!!print time.time()
!!print "exiting thread"

quit=0
t = threading.Thread(target=mloop)
t.start()
print "appended mloop"
os.system('sleep 10')
quit=1
os.system('sleep 2')

Resized Image
"the expression, 'atonal music,' is most unfortunate--it is on a par with calling flying 'the art of not falling,' or swimming 'the art of not drowning.'. A. Schoenberg
Go to top
Re: python and threads
Quite a regular
Quite a regular


See User information
@Jack

Ok, appears that python was compiled without threading support. At least that seems to be the reason for the problem...
So putting this on hold for a while.
No amiga audio player has context areas like Amarok (where the lastfm client is bultin and even offline music can be scrobbled while in context area the tracks/artist are clickable and bring up the relevant lastfm pages) so I don't see the point in making a plugin.
I'll try to make the proxy work when it'll be possible and meanwhile I'll see how can I make an "external scrobbler" based on the proxy's code which can support apps like AmigaAmp and Tunenet via AREXX and submit the offline tracks to lastfm.
Once the proxy will function, viewer app can be set to AmigaAmp or Tunenet while the web interface can be used for context-sensitive browsing.

Jack

Resized Image
"the expression, 'atonal music,' is most unfortunate--it is on a par with calling flying 'the art of not falling,' or swimming 'the art of not drowning.'. A. Schoenberg
Go to top
Re: python and threads
Just can't stay away
Just can't stay away


See User information
Hi @Jack

No amiga audio player has context areas ...

I was curious about this module:
import audioop
dir(audioop)...
help(audioop)...


Is this module definitions used to controlling any audio player or just particular ones? Or, is it just a mixer controller? It's kind of lean on context.

Go to top
Re: python and threads
Quite a regular
Quite a regular


See User information
@Snuffy

Quote:

I was curious about this module:
import audioop
dir(audioop)...
help(audioop)...


Not exactly, but thanks anyway, from http://docs.python.org/lib/module-audioop.html :

Quote:

The audioop module contains some useful operations on sound fragments. It operates on sound fragments consisting of signed integer samples 8, 16 or 32 bits wide, stored in Python strings. This is the same format as used by the al and sunaudiodev modules. All scalar items are integers, unless specified otherwise.


Jack

Resized Image
"the expression, 'atonal music,' is most unfortunate--it is on a par with calling flying 'the art of not falling,' or swimming 'the art of not drowning.'. A. Schoenberg
Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 2 ( 0 members and 2 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project