anonymous-q
Posts: 1
Joined: Wed Mar 29, 2017 6:02 pm

Just a few Questions

Wed Mar 29, 2017 6:14 pm

Hi. I made this account solely for this question, and most likely will never use it again. But, I assure you the answers will not go unnoticed. I am a professional lurker. ;)

Is it possible to make an OS in Python, or have a Python program load up on boot? If so, is there any code I could use? How exactly do I do that?

Also, if anyone happens to know, could I use IBM's QISKit Python library to add quantum computing power to my project via IoT?

User avatar
DougieLawson
Posts: 35815
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Just a few Questions

Thu Mar 30, 2017 1:42 pm

1. No. OSes have a need for speed. Python is too slow compared to compiled or assembled programs.
2. Go and ask the very nice folks at IBM who get to play with that funky stuff and get paid for doing it.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

MarkyV
Posts: 97
Joined: Wed Sep 21, 2016 1:52 pm
Location: Buckingham, UK
Contact: Website

Re: Just a few Questions

Thu Mar 30, 2017 1:50 pm

The bit about running python on boot has been covered a few times here before - here is one of them : viewtopic.php?t=46125&f=63

Mark
My RaspberryPi Blog: http://thepimaker.online

BMS Doug
Posts: 3824
Joined: Thu Mar 27, 2014 2:42 pm
Location: London, UK

Re: Just a few Questions

Thu Mar 30, 2017 1:52 pm

anonymous-q wrote:Hi. I made this account solely for this question, and most likely will never use it again. But, I assure you the answers will not go unnoticed. I am a professional lurker. ;)

Is it possible to make an OS in Python, or have a Python program load up on boot? If so, is there any code I could use? How exactly do I do that?

Also, if anyone happens to know, could I use IBM's QISKit Python library to add quantum computing power to my project via IoT?
Having a python Program load at boot is fairly common, there are many ways of achieving it.

The easiest way to accomplish would be to use Pi Bakery to create a raspbian-lite sd card with the "On every boot: run python file" setting.
Doug.
Building Management Systems Engineer.

mfa298
Posts: 1387
Joined: Tue Apr 22, 2014 11:18 am

Re: Just a few Questions

Thu Mar 30, 2017 2:23 pm

anonymous-q wrote: Is it possible to make an OS in Python, or have a Python program load up on boot? If so, is there any code I could use? How exactly do I do that?
Whilst it might be possible to write an OS in python as a learning exercise I suspect that's not what you wanted, it's also going to be a huge task. The OS is the underlying system (technically just the Linux Kernel on the Pi) that provides an interface between software and hardware. i.e. assuming no hardware limitations a piece of code can be run on any system that runs the Linux kernel with minimal effort.

There are many ways to start a program on bootup, The best/most flexible way will be via systemd for which you should be able to find many examples on this forum. Other options include adding it to the rc.local script or using cron's @reboot target.

jahboater
Posts: 4607
Joined: Wed Feb 04, 2015 6:38 pm

Re: Just a few Questions

Fri Mar 31, 2017 8:41 am

mfa298 wrote: There are many ways to start a program on bootup, The best/most flexible way will be via systemd for which you should be able to find many examples on this forum. Other options include adding it to the rc.local script or using cron's @reboot target.
Or adding init=<myprogram> to /boot/cmdline.txt which would have no services or any other support (not even systemd is started). It is a common fix for boot problems, add init=/bin/sh and it will drop you into a root shell.

Return to “General discussion”