Python Inside

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Closed
Blackbelt Offline
Junior Member
Posts: 4
Joined: Oct 2003
Reputation: 0
Location: North Carolina
Post: #1
i noticed that a ported version of python is included in the xbmc source. this is great as python is a simple and powerful object oriented scripting language. so how is python used by xbmc? are scripts used as a part of the application or is the intent only to execute external utility scripts?

the ability to tweak scripts and see the results without recompiling and downloading to the xbox would sure be nice...
find
Hullebulle Offline
Posting Freak
Posts: 1,966
Joined: Sep 2003
Reputation: 0
Post: #2
you can select the scripts like a program or movie and start it. Smile

too bad that i have no idea of python.

read the xbmc online-manual, faq and search the forums before posting! do not e-mail the xbmc-team asking for support!
read/follow the forum rules! note! team-xbmc never have and never will host or distribute ms-xdk binaries/executables!
find
Zealot Offline
Junior Member
Posts: 7
Joined: Oct 2003
Reputation: 0
Location: Ottawa, Ontario
Post: #3
i'm really wondering the same thing. i've looked through the forums and docs on the xbmp site, and i couldn't find a definite answer.

does xbmc have a full embedded python interpreter, or is it a limited set of functionality? is there socket support? like, would i be able to build a web service / client in python?
find
Hullebulle Offline
Posting Freak
Posts: 1,966
Joined: Sep 2003
Reputation: 0
Post: #4
Quote:does xbmc have a full embedded python interpreter, or is it a limited set of functionality?
full

Quote:is there socket support?
yes

Quote: like, would i be able to build a web service / client in python?
yes

read the xbmc online-manual, faq and search the forums before posting! do not e-mail the xbmc-team asking for support!
read/follow the forum rules! note! team-xbmc never have and never will host or distribute ms-xdk binaries/executables!
find
burriko Offline
Senior Member
Posts: 199
Joined: Oct 2003
Reputation: 0
Post: #5
can any of the devs give a bit more info on this? as it sounds very interesting.
how do the scripts interact with xbmc? how exactly do you execute scripts? i tried selecting a small test script in xbmc, but it didn't seem to have any effect.
find
darkie Offline
Team-XBMC Developer
Posts: 529
Joined: Sep 2003
Reputation: 0
Post: #6
first of all 'python 2.3' is embedded into xbmc and you the need to do the following to get it working

extract the directories from python.rar (cvs\xbmc\python\python.rar)
to "xbmc home dir\python\"
and if you want some examples you should extract scripts.rar(cvs\xbmc\scripts\scripts.rar)
to "xbmc home dir\scripts\"

you will now have the next directory structure in xbmc
xbmc
  python
      lib
      temp
      www
  scripts
      medusa

you execute scripts thrue the myscripts gui which is under settings->scripts.
currently there is no interaction with xbmc, for example you can't see any output from the python interpreter (this will be added because it's the only way to see where the script stops when an error occours)

included in scripts.rar are the next files
Quote:chat-server.py: runs a chat server on port 4000
download_apleasure_zip.py: downloads a file from ftp and places it in your xbmc home dir
download_xskit303_exe.py: downloads another file from ftp
echo_server_port_50007.py: runs an echo server on port 50007
mp3.py: only used for testing and doesn't work
url_fetcher_asyncore.py: used for testing and doesn't work
weather.py: used for testing and doesn't work

medusa\start_medusa: runs an ftp / web and chat server on the ports 8021, 8080 and 8888
if you need any documentation or need more scripts examples you can try the official python website http://www.python.org

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,595
Joined: Sep 2003
Reputation: 9
Location: Sweden
Question    Post: #7
darkie, as the coder of xbmc's python interpreter can you tell us all a little more about the techical aspects behind it, things like; is it loaded into a pragma section?, is it or will it be loaded by default?, how much ram does it use?, once the python interpreter is loaded into memory will/can it be unloaded when not used anymore or is reboot nessesary?, once a python script is loaded into memory will/can it be unloaded when not running anymore?, where are you planning to take this development wise?, and how do you plan to implement it in the gui, now & later?

...and other things like that, tia [Image: cool.gif]

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find
windragz Offline
Junior Member
Posts: 17
Joined: Oct 2003
Reputation: 0
Location: Australia
Post: #8
a dream becomes to be a reality!!
yes, yes. i want develop some webservice, so dear python dev implementator tell us anything is possibile about this wonderful part Smile

it's clear that i'm excited? Big Grin

windragz
it difficult to break 2048 bit as try to find a sock at morning, it's just matter of time.
find
Frodo Offline
Team MediaPortal
Posts: 509
Joined: Sep 2003
Post: #9
>is it loaded into a pragma section?
yes it is

>is it or will it be loaded by default?
no

>how much ram does it use?
when loaded about 350kbyte

> once the python interpreter is loaded into memory will/can it be unloaded when not used anymore
no, sorry?,

>once a python script is loaded into memory will/can it be unloaded when not running anymore?
yes
frodo
find
Gamester17 Offline
Team-XBMC Forum Moderator
Posts: 10,595
Joined: Sep 2003
Reputation: 9
Location: Sweden
Sad    Post: #10
(frodo @ oct. 11 2003,09:46 Wrote:> once the python interpreter is loaded into memory will/can it be unloaded when not used anymore
no, sorry?
why? i mean it must be possible somehow, or isn't? this will be a challange for all you devs to figure out [Image: wink.gif]

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
find
Thread Closed