Deploying a python/ruby code on a decentralized network - python

I was studying about DApps and I found most of them are written using Solidity and JS. Also, I found that there's a web3.py library for people who love python (and I didn't search for the same thing in ruby programming language). But, I have a question, is there any decentralized system like heroku? I mean, writing a piece of code (e.g. Sinatra/Flask based API) and then deploy on that network?
Regards.

I think that you're asking: is there an application that will let me build applications and deploy them to the network?
You might take a look at Truffle. You can develop and deploy applications in Javascript.
However, if you like Python (like I do), I just released an open source tool called Ezo. It's in alpha, so patience please. :) It's a command-line tool for building off-chain event responders (or oracles) for Ethereum. Here's an article on how to use it.
You'll also want to download and install Ganache to simulate a working Ethereum EVM. You'll likely lean on it a lot during any development you may do. Good luck.

Related

Python (back-end) and Kotlin (front-end) for Android

Ok I was doing some data science in python over the weekend and I got to looking at python for mobile development. I was curious as to if it's possible to use both Python (back-end) and use Kotlin (front-end) together?
I know python is a non GUI unless you use kivy or flask. However I was thinking if it's possible can you cross python and Kotlin together.
There is a lot apps that use python as the backend, and another language for the front end. I have done some research and found that Kivy (unstable from my research) can be used for mobile development. However for Android Kotlin is the preferred choice by Google.
Which throws me off because Google uses python for the backend. So when you look at the Google Apps on the Play Store, are they using python and java in mobile apps?
The app I am planning which will be released to Google Play on my developer page will be a Data Driven app. So things would go much smoother if I could combine the two.
Has anyone tried using python and Kotlin? However, would I be stuck with Python and Kivy?
The language used to program frontend vs backend don't matter, the only thing that matters is how the two communicate (assuming when you say backend you mean like a server and not like a game engine). Traditionally, applications will communicate with a backend using a REST API. So long as both sides abide by the same rules for talking to each other, it doesn't matter what language they were programmed in, known as a communication protocol.
The situation that you presented of a Kotlin frontend with a Python backend is definitely being used in production environments, and you shouldn't be afraid to do so either.
See also this related question, though I personally wouldn't recommend using Python to write an Android application because I believe natively supported first-class languages are going to produce more performant, reliable apps than non-native second/third-class languages (I haven't done more than find that SO question, so take my opinion with a grain of salt)

Python "Cloud Computing" service?

I'm currently working on a project which allows me to generate complex terrains. I'm taking inspiration from the following article:
https://hal.archives-ouvertes.fr/hal-02326472/file/2019-orometry.pdf
I have contacted the authors of the project and I am allowed to use their code and modify it so that's not the problem. As the code is quite complex and uses a lot of python packages (such as numpy), I don't want to completely recode the project in the language I'm currently working with (Kotlin)
Is there any way I can use/modify the code of the project and use it as a service so that I can interact with it using a REST Api (the code would be hosted by a third-party like Heroku or something in the likes of that)? I'm not that experienced using/programming these sort of infrastructures and I don't really know where to start, so any help is appreciated.

Python or Node.js for a Web app which interfaces with a USB devices?

I'm looking to develop a web app that controls Concept2 rowing gym equipment connected to the users computer via USB. I'm trying to decide what approach I should take in developing something like this.
Control of these devices has been achieved in the past both in python:
(https://github.com/uvd/PyRow)
and using node/jQuery:
(https://github.com/tijmenvangulik/ErgometerJS).
An SDK and documentation is provided by the developers of Concept2 gym equipment. DLL and CSafe commands are used to interface with the machines monitors.
(https://www.concept2.com/service/software/software-development-kit)
I'm looking for recommendations on how I should this tackle this project. At the moment python seems like the best approach however I have no idea how I can run these python files through a website interacting with the java script front end.
Any advice or pointers is appreciated.
David
You task looks like a simple SCADA solution with web interface.
You choice depends on whether you have experienced developers, who are able to use modern frameworks like Vue.js, Angular, React and others or not.
Really, in your particular case - monitoring equipment over web, you don't necessary need to invest a lot in your front-end - depends on your target audience. Is it a single service engineer? If yes, probably your front-end should be minimalistic, you can use Python with Twisted for static web server and build your frontend on bootstrap plus jquery. This is a fast win solution and you can implement it even if you've never worked with web.
More complex approach, requiring more engineering, is Python + Flask.
If you feel ready for modern frameworks, like Vue, React, Angular, then, possibly, you'd better look at NodeJs as a backend. They are better integrated with NodeJs and its package manager npm. You will need it to build the project on your server side; also some people treat it as a solid solution, when using the same language (javascript) for both backend and frontend. As for me, it doesn't really matter a lot.

Push updates to python desktop apps

I'm working in a small CG animation company that does need small tools for production and CG artists. I'm coming from an animator's background, so my knowledge of code is extremely basic, but I'm learning.
Here is the situation: I write python tools, most are using PySide for GUI. Now I need to regularly and easily deploy tools and updates to the machines in our studio (about 20 computers).
We do want to do things the right way and are willing to learn, but the amount of information is quite overwhelming for I am a neophyte.
I keep reading about various scary keywords that seem to be the answer I'm looking for, such as DevOps, CI/CD, Docker, Kubernetes...
We are setting up a Gitlab instance on our local server, and now I'm asking what would be the most suitable way to easily deploy my scripts and their requested environment easily onto the company's computers (MacOs, Windows, and Linux), and how should I package them.
I hope my question isn't vague but if so, please tell me and I'll try to be more precise.
Thanks a lot
pyupdater seems to do just what you're trying to do.
have a look at pyupdater.org and this demo.

Python Vs Ruby On Rails : on Size

I am planning to do a small web application that will be distributed as a single installable. I have plans to develop this application in either Python/Django or Ruby On Rails. (I am a Java/C++ programmer, hence both these languages are new to me).
My main concern is about the size and simplicity of final installable (say setup.exe). I want it to be small in size and also should be able to pack all required components in it.
Which one among Python/Django and Ruby On Rails is suitable for me?
I personally prefer Python/django. Size is small given u have necessary things installed.
With disk space at the current price, size shouldn't matter. Give both a try and figure out which will be easier for you to learn and maintain. Despite the fact that people believe that when you know one language, you know all, that's only true as long as you write code on the "hello world" level.
One option with Ruby on Rails is to go with a JRuby deployment which would allow you to pack it all into a single .war file. This would require the person deploying the web application to have a java web application server (Jetty is probably the smallest and easiest to bundle).
With Rails, you are generally going to have to install Ruby and any required ruby gems. The Ruby install is going to be machine specific- different for Windows/Linux. Everything else should be easily scripted. If you go with an Apache Passenger (mod_ruby) solution, you will need to get that installed as well.
In reality, I haven't run into many server applications with simple, compact installs.
I just used heroku to deploy a blog written in Rails, and it was a fantastically easy experience. If you're interested in simplicity, it's probably the most simple deploy I've ever experienced.
I don't think you can get them both. I'm sorry to say this but you have to choose which one is more important to you.
Django application is smaller in size because many things is already provided out of the box, but deployment is not as easy.
On the other hand, RoR apps deployment is easier (both Ruby MRI or JRuby) but the application's size is naturally larger given you have to install other gems and Ruby On Rails plugins.
If you are experienced with Java and concerned about deploying Django and Rails apps, I'd recommend you give JRuby a try. This will give you several benefits from a Java-perpective:
You can call Java-classes and components from your Ruby/Rails app
You can use a familiar IDE such as Netbeans
You can package and deploy our entire Rails app as a single WAR-file with all dependencies included
With the cheeseshop, any python application can be made installable with a single command. I'm a big fan of Django, but it will require you to hook into an external webserver, as the built in server is for development only. You might look for something that has a more robust builtin web server if you want something you can just plunk down and start running. Twisted might meet your needs, though there's a bit more of a learning curve on that. I'm not sure how other python or ruby apps stand up on this front.

Categories

Resources