Python for STEEM: How to beem
busy·@felixxx·
0.000 HBDPython for STEEM: How to beem
>This is meant as the first part to a series of tutorials. The goal is to produce a hands-on guide for people who want to jump straight into developing tools for STEEM. ### In this part, I will try to guide you through the process of installing beem. [beem](https://github.com/holgern/beem) is a Python library for STEEM and is based on [steem-python](https://github.com/steemit/steem-python), which is based on [piston-lib](https://github.com/xeroc/piston-lib). While steem-python is the official lib, I chose beem, because it is updated more frequently. ( At this time, the last update to steem-python is 9 months old) While it is possible to install Python and beem on Windows, I will start by setting up a virtual machine, which I will install Linux on. In my opinion, this has multiple benefits, the main one being that it will encapsulate your development environment; Whatever abomination you code up, it will not be able to wreck your main operating system - In the worst case, you can stop the virtual machine and start it again. I believe this method to be the easiest for most people. If you want to install beem on a different system, this is not the right guide for you. If you can figure it out on your own, you can jump a chapter ahead. ## VMware #### There is a free version of VMware, which is ideal for our purposes: https://www.vmware.com/products/workstation-player.html Make sure to download the Workstation **Player**, as only that is free to use. Install this, make sure to uncheck the regular updates nonsense. ## Ubuntu #### I will go with Ubuntu 18.04.3 LTS, as that seems to be the most popular choice at the moment. https://ubuntu.com/download/desktop Open VMware, create a new virtual machine using a Ubuntu 18.04.3 LTS image. - 10 GB HDD, 2 GB RAM is enough, perhaps less - You do not need VMware tools - Set a password. I bricked my first Linux ever, by trying to set it up with a blank password. It does not have to be especially secure. ## beem #### If you are new to Linux - don't panic ! I don't get it either. Before doing anything, remove Amazon from you 'Favourites' menu. If your keyboard layout is not English, you need to go to 'Region and Languages' and **add a new** keyboard layout, which makes no sense, and is very confusing. - ``ctrl``+``alt``+``t `` opens a new terminal. - ``sudo apt-get update`` Apparently, this will update your system. It is always recommended. Once you have a running bot for STEEM, this might completely ruin your day, though. ___ _**Note**: ``ctrl+c``, ``ctrl+v`` do not work like they do in Windows. This is just to confuse everybody._ ___ - ``sudo apt-get install build-essential libssl-dev python-dev`` - yes - ``sudo apt install python3-pip`` - yes - ``sudo pip3 install beem`` - yes ## Test #### The easiest way to test, if it went right, is to: ``beempy --help`` beempy is a wallet that is built on beem. If you see a list of help topics, you have successfully set up beem. To test your first own script, create a new file: ``gedit beemtest.py`` This will open a text editor. ``` from beem.blockchain import Blockchain blockchain = Blockchain() print(blockchain.get_current_block_num()) ``` paste the above 3 lines of code and save the file. ```python3 beemtest.py``` This will execute your script and should print the current head-block number on your screen. ## Congratulations #### If it did not work as intended, comment below. I hope @flipstar gets to test this. Also mentioning @revisesociology for good measure. ## [-> Part 2](https://steemit.com/busy/@felixxx/pyhton-for-steem-2-json)
👍 wilsonblue5, theodosiskatq, steeming-hot, alexvan, andyjaypowell, backinblackdevil, solarwarrior, schamangerbert, redes, chops.support, eikejanssen, fw206, isnochys, remlaps, condeas, luegenbaron, schlunior, yeaho, satren, raorac, yaraha, crimo, schlank, schlooster, wallvater, mittwochsquickie, busy.pay, schlees, cardboard, cfminer, profitcheck, tipu.curator, katharsisdrill, freiheit50, felixxx, bluerobo, tipu, deadlyvesy, losi, stayoutoftherz, furioslosi, the.circle, arabisouri, nissla, linuxbot, stratton.npc, director.rar, freebornsociety, morph, sportschain, jagoe, kicchudop1434, derfelix, ssekulji, kam.ila, diana.feuerberg, capx, mblain, sharelovenothate, nako1337, phusionphil, saamychristen, cryptofunk, con-dom, pamahdoo, olegw, z3r0d4yz, semperenglish, juanmiguelsalas, redtravels, sorin.cristescu, tinoschloegl, mindscapephotos, detlev, svarozich, twinner, steemvpn, wishmaiden, uwelang, jamesbattler, tomhall, crokkon, louis88, slobberchops, bingbabe, tomsalem, ace108, moon32walker, mytechtrail, ocdb, smartsteem, rimicane, miroslavrc, steemlondon, tombstone, drifter1, diana.catherine, joele, papabab, ebargains, ansharphoto, elevator09, robi, jagged, roomservice, sustainablyyours, zneeke, podnikatel, hdmed, devcoin, estream.studios, therealwolf, szabolcs, hannesl, zipsardinia, isi3, smartmarket, lordjames, thevote, ajanphoto, steem.services, minerthreat, aro.steem, steemjet, mrnightmare89, tech4all, steemjetmedia, new-steemit, steemtank, wolfinator, elizabethharvey, steemdapps, treepi, the.curator, epicdice, dhanagc, thebilpcointrain, develcuy, dropahead, upme, sagarthukral, xmrking, mister-meeseeks, cryptoxicate, bilpcoin.pay, buildawhale, celinavisaez, saulvs, leroy.linientreu, obvious, lulafleur, lifeofroman, k3ldo, tonkatonka, themonetaryfew, fabianklauder, saboin, oaldamster, yoogyart, jeffjagoe, flipstar, darrenfj, theycallmedan, steemchiller, craigahamilton, revisesociology, revise.leo, hiroyamagishi, pereu4ivatel, ili0braz, mattsanthonyit, schererf, steem.test, james.steem, helli, alpha.steem, opmonis, resteemme, resteemmebot, player01, player02, player03, matt-a, arcange, laissez-faire, raphaelle, afrog, maxsieg, yogi,