TOP
SSV Software Systems Register  Register
Log in to check your private messages  Log in to check your private messages
Startseite FAQ Search Mitglieder Profile  Log in 
SSV Support-Forum
Python Support …

 
Post new topic   Reply to topic    SSV-Forum Forum Index >>> eSOM/3517
<<< Previous topic - Next topic >>>  
Display posts from previous:   
Author Message
kdw



Joined: 05 May 2006
Posts: 1460

PostPosted: 01.10.2012, 17:05    Post subject: Python Support … Reply with quote

Hallo Forum.

Für das Linux des eSOM/3517 steht ab sofort auch eine Python-Portierung zur Verfügung. Es wird Python 2.6.1 benutzt. Der gesamte Port nimmt ca. 25 Mbytes des Flash-Speichers in Anspruch.

Gruß KDW
Back to top
View user's profile Send private message
kdw



Joined: 05 May 2006
Posts: 1460

PostPosted: 01.10.2012, 17:06    Post subject: XML-Daten auswerten … Reply with quote

Hallo Forum.

Durch die Python-Implementierung wird jetzt auch XML unterstützt. Ein XML SAX Parser lässt sich zum Beispiel mit wenigen Handgriffen erstellen.

Das unter http://www.pythonsnippet.com/snippets/xml-sax-parserreader gezeigte Beispiel läuft mit der eSOM/3517 Portierung ohne Probleme.

Gruß KDW
Back to top
View user's profile Send private message
kdw



Joined: 05 May 2006
Posts: 1460

PostPosted: 20.06.2013, 11:44    Post subject: CGI per Python … Reply with quote

Hallo Forum.

Mit Hilfe der vorinstallierten Python-Laufzeitumgebung kann man auch CGI-Programme für den eSOM/3517-lighttpd-Webserver erstellen.

Zuvor muss allerdings der lighttpd-Konfigurationsdatei /etc/lighttpd/lighttpd.conf mitgeteilt werden, dass Python-Skriptdateien mit der Endung *.py als CGI-Programme zu behandeln sind. Erweitern Sie diese Konfigurationsdatei um die beiden folgenden Python-bezogenen Einträge:

Code:
static-file.exclude-extensions = (".cgi", ".sh", ".php", "py")
cgi.assign = (".cgi" => "", ".sh" => "/bin/sh", ".php" => "/usr/bin/php", ".py" => "/usr/bin/python"


Erstellen Sie dann eine Datei mit dem Namen hello-cgi.py und speichern Sie den folgenden Python-Code in dieser Datei:

Code:
#!/usr/bin/python

print "Content-type: text/html"
print
print "<html><head>"
print "<title>Hello World from Python</title>"
print "</head><body>"
print "Hello World!"
print "</body></html>"


Übertragen Sie diese Datei in das Verzeichnis /www/cgi-bin. Starten Sie nun auf Ihrem PC einen Webbrowser und adressieren Sie:

Code:
http://192.168.0.140/cgi-bin/hello-cgi.py


Der Browser müsste Ihnen nun das „Hello World!“ des Python-Skripts anzeigen.

Gruß KDW
Back to top
View user's profile Send private message
kdw



Joined: 05 May 2006
Posts: 1460

PostPosted: 14.09.2014, 07:32    Post subject: Erste Schritte … Reply with quote

Hallo Forum.

Für alle, die noch nicht ganz so viel Python-Erfahrung besitzen, findet man unter

http://www.tutorialspoint.com/python/index.htm

ein sehr gutes Nachschlagewerk.

Gruß KDW
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    SSV-Forum Forum Index >>> eSOM/3517 All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

SSV Software Systems GmbH

Dünenweg 5
30419 Hannover

Fon: +49(0)511  ·  40 000-0
Fax: +49(0)511  ·  40 000-40

sales@ssv-embedded.de


Impressum    ·    Datenschutz    ·    AGB

© 2023 SSV SOFTWARE SYSTEMS GmbH. Alle Rechte vorbehalten.

ISO 9001:2015