Run a python script from a web service - Raspberry Pi General

Just wrote my first python script for the automation phat on my pi zero! Can’t wait to try it out later.
What’s the easiest way to run a python script from a web service and view printed outputs?

Related

Java on Galaxy S

How can i install Java to my Galaxy S for working some websites that they need it???
for Browser there is no plugin available yet
but if you want to run say Java games application or software made for Java, then there is a software that can convert it from java into android apps
but it's not free
I'm going on the assumption that the OP was referring to Java SE 'applets' commonly used on the web, such as used for games like Minecraft or RuneScape.
I can't see any software in the immediate future allowing compatibility for this unless somebody voluntarily hacks something together although for what it's worth I had a look over to see what ARMEL compiled packages the Debian repository has:
http://packages.debian.org/experimental/openjdk-6-jre may work in a chrooted Debian environment if anybody wants to try it assuming all the dependencies are available for ARMEL too. I have no idea if this would work and I may have a go at attempting it some time myself. This of course probably isn't what you want but it technically would mean you could run your Java applets in a browser - just not the browser you'd probably want.

Javascript pc emulator. Neat!

So i was wandering around google this morning and stumbled upon this. I am not affiliated with the creater in anyway.
I dont know how to use this, but I wanted to put it here, incase some dev knows what to do with it. Or can use it.
I found it here.
Company main page
http://bellard.org/
Link to go straight to the emulator.
http://bellard.org/jslinux/index.html
It runs in your stock tab browser. Let it load. Takes bout two minutes.
Here is the info:
Javascript PC Emulator - Technical NotesBy*Fabrice Bellard
*- May 14, 2011
This PC emulator is written in Javascript. The emulated hardware consists in the following devices:
* 32 bit x86 compatible CPU
* 8259 Programmble Interrupt Controller
* 8254 Programmble Interrupt Timer
* 16450 UART
* Real Time Clock.The code is written in pure Javascript using the*W3C Typed Arrays
. A slightly slower fallback mode is implemented for browsers missing this support. For the exact list of supported browsers, see the*FAQ
. In any case, a fast Javascript engine is needed to have good performance.
CPU EmulationSome of the code is inspired from my x86 dynamic translator present in*QEMU
, but there are important differences because here it is an interpreter. The CPU is close to a 486 compatible x86 without FPU. The lack of FPU is not a problem when running Linux as Operating System because it contains a FPU emulator. In order to be able to run Linux, a complete MMU is implemented. The exact restrictions of the emulated CPU are:
* No FPU/MMX/SSE
* No segment limit and right checks when accessing memory (Linux does not rely on them for memory protection, so it is not an issue. The x86 emulator of QEMU has the same restriction).
* No CS/DS/ES/SS segment overrides. FS/GS overrides are implemented because they are needed for Thread Local Storage in Linux.
* A few seldom used instructions are missing (BCD operations, BOUND, ...).
* No single-stepping
* No real mode
* No 16 bit protected mode (although most 16 bit instructions are present because they are needed to run 32 bit programs).Most of these restrictions are easy to remove, but I decided to implement the strict minimum to be able to use a recent Linux kernel and its user applications.
I added some tricks which are not present in QEMU to be more precise when emulating unaligned load/stores at page boundaries. The condition code emulation is also more efficient than the one in QEMU.DevicesCurrently there is no synchronization between the PIT frequency and the real time, so there is a variable drift between the time returned by Linux (try the "date" command) and the real time.
The UART (serial port) does not support FIFO mode. Perhaps it could help to improve the display speed.
There is no network emulation at this point.
A clipboard device (seen as*/dev/clipboard*in the emulator) was added to allow exchange of data between the emulator and the outside world.Javascript terminalAlthough I could have reused the excellent*termlib
, I decided to write my own because I was curious to see how it could be done. The main problem is the key handling which is different among browsers and OSes, as described*here
.Linux distributionI compiled a 2.6.20 Linux kernel (I guess any other version would work provided there is still an FPU emulator). The Linux kernel configuration, patch and the source code of the Linux starter (kind of BIOS) are available:*linuxstart.tar.gz
.
The disk image is just a ram disk image loaded at boot time. It contains a filesystem generated with*Buildroot
containing*BusyBox
. I added my toy C compiler*TinyCC
*and my unfinished but usable emacs clone*QEmacs
.
JavascriptI happen to be interested by the implementation of Javascript engines these days - but I don't know yet if I will write my own any time soon ! Anyway, this emulator was a way to learn how to write optimized code for recent Javascript engines, in particular Jaeger Monkey (for Firefox 4) and V8 (for Chrome).
A troubling thing is that the PC emulator is about 2 times slower using V8 than Jaeger Monkey (I used the 32 bit version for both). I have no precise explanation yet because I only looked at the Jeager Monkey code so far.What's the use ?I did it for fun, just because newer Javascript Engines are fast enough to do complicated things. Real use could be:
* Benchmarking of Javascript engines (how much time takes your Javascript engine to boot Linux ?). For this particular application, efficient handling of 32 bit signed and unsigned integers and of typed arrays is important.
* Learning to use command line Unix tools without leaving the browser.
* Client side processing using an x86 library, for example for cryptographic purposes. For such application, the x86 emulator can be modified to provide an API to load x86 dynamic libraries and to provide a*js-ctypes
*like API to call the C/C++ functions from javascript.
* A more advanced version would allow to use old DOS PC software such as games.
Hit the thanks button if this has helped you in any way!
Don't Panic
If this has been posted before or is un needed or not wanted please post so, and thread will close
Don't Panic

[Disscusion]Gentoo Webtop

So work is happening to accomplish replacing the webtop with a gentoo base img.
My proposition is to create a very slim gentoo so you guys can add as you please
So im making this post to hear from you guys what you would like to see in the Gentop.
So far my idea would be very basic.
Openbox + terminal + conky
and of course a browser.
So tell me, if this was your gentop. what would be there!?
In addition to your suggested items for a "gentop", I'd like to see more file viewers that take advantage of the lapdock screen resolution, like PDF, (Open)Office docs, even EPUBs.
I would add in some sort of rdp, vnc and ssh clients.. I could really use those. Thanks for all the hard work you do
Sent from my MB860 using XDA App
Could you guys prepare a version with synaptic and lxde? Im sure there are people interested in the fastest webtop experience possible, but have 0 skill in linux encoding. With that, we can customize as we please with easy visual reference.
About ssh clients -- it should be mentioned that there is already an "rsync" backup for android freely available in the Android market. It installs rsync and dropbear ssh clients. So with a terminal app, your webtop will have access to cli versions of rsync and ssh. Then just do a symlink from the installed apk into /system/xbin/ and presto instant ssh and rsync.
Would we still have a phone view within gentoo like we have in webtop?
If not, would the phone screen remain accessible while docked?
How would this handle incoming phone calls?

Droidspace: A Python Environment for Android and Chrome

Droidspace is a newly published, open source, shell based IDE. It allows you to use Python and HTML5 to hack Android and Chrome. The latest version includes...
Python3 Interpreter
Chrome based interface (hack your droid from a regular laptop)
Extensible shell
Hacker's text editor (based on ACE)
HTTPS support for untrusted networks
Very simple API for casting your own creations onto the browser
SL4A based Android API (supports webviews)
Video and audio streaming
Simple, pure Python extension system
Intuitive threading (nothing blocks unless you want it to)
Droidspace is designed to allow you to very easily and rapidly develop software on an Android device, with the option of using HTML5 to build user interfaces that can be rendered by the device directly or cast into some instance of Chrome running on the same local network. Though all the bits are there, Droidspace is not well suited to developing standalone products for publication.
Droidspace Philosophy, Article 0: Magic is essential. Portability isn't.
The project is hosted by GitHub and is GPL licensed. I can't post links here, but you can find it easily on Google. If you have any questions, I'd be happy to help.
Cheers
carl_smith said:
Droidspace is a newly published, open source, shell based IDE. It allows you to use Python and HTML5 to hack Android and Chrome. The latest version includes...
Python3 Interpreter
Chrome based interface (hack your droid from a regular laptop)
Extensible shell
Hacker's text editor (based on ACE)
HTTPS support for untrusted networks
Very simple API for casting your own creations onto the browser
SL4A based Android API (supports webviews)
Video and audio streaming
Simple, pure Python extension system
Intuitive threading (nothing blocks unless you want it to)
Droidspace is designed to allow you to very easily and rapidly develop software on an Android device, with the option of using HTML5 to build user interfaces that can be rendered by the device directly or cast into some instance of Chrome running on the same local network. Though all the bits are there, Droidspace is not well suited to developing standalone products for publication.
Droidspace Philosophy, Article 0: Magic is essential. Portability isn't.
The project is hosted by GitHub and is GPL licensed. I can't post links here, but you can find it easily on Google. If you have any questions, I'd be happy to help.
Cheers
Click to expand...
Click to collapse
Great ! ... ... I'll give it a try soon ... :good:

make a project executable on raspberry pi

Hi guys
I have created a project which consists of a main GUI interface that incorporates four games, where one of the games opens another GUI which also incorporates four other small games, and all the scripts are found in one folder, also the games are aimed towards autistic children. For the project i used python 3, with pygame for the games and Tkinter for the GUI's .
My main issue is that i would like to make the whole project run directly from the raspberry desktop, without having the user open a terminal or the python script, and having been going round in circles as how i can maybe make this happen and cannot seem to find or not looking in the right direction, my raspberry pi is running on raspbian.
I would appreciate if anyone could direct/suggest me on what would be the best thing to do or else to point me to any step by step tutorials so as to make the project easily accessible for autistic children. Thanks.
druid65 said:
Hi guys
I have created a project which consists of a main GUI interface that incorporates four games, where one of the games opens another GUI which also incorporates four other small games, and all the scripts are found in one folder, also the games are aimed towards autistic children. For the project i used python 3, with pygame for the games and Tkinter for the GUI's .
My main issue is that i would like to make the whole project run directly from the raspberry desktop, without having the user open a terminal or the python script, and having been going round in circles as how i can maybe make this happen and cannot seem to find or not looking in the right direction, my raspberry pi is running on raspbian.
I would appreciate if anyone could direct/suggest me on what would be the best thing to do or else to point me to any step by step tutorials so as to make the project easily accessible for autistic children. Thanks.
Click to expand...
Click to collapse
Make your script executable with the command:
chmod +x script_file_name
Then create a desktop icon for it by following these steps:
1. Create a "somename.desktop" file in your user's Desktop directory. (like /home/pi/Desktop)
2. The contents of the file is as follows.
[Desktop Entry]
Type=Application
Name=Somename-which-represent-your-application
Exec=/path/to/your/executable/script/file
Icon=/path/to/your/icon/file
Terminal=false
3. After this, if you double click on the icon on Desktop, the application starts automatically.
Got this from the raspberry pi forum written by the user Srinivas.

Categories

Resources