A tutorial on Python using the Rstudio editor

Source: Internet
Author: User
Tags svn sublime text sublime text editor jupyter in python

Overview

Senior Python engineers can choose from a number of editors, such as Rodeo, Spider, eclipse,vim,visual studio,atom,sublime text,jupyter and so on, but now why many senior Pythoner all start hugging rstudio? To answer this question, first of all, what do we need to know about the needs of Python engineers?

Demand for a

Senior Pythoner does not rely on an integrated development environment and requires immersion programming.

Real masters often do not need an interactive programming environment, they are more inclined to immersion programming, these experts often choose vim or sublime text editor to solve the problem. For example, the previous Sublime text (Sublime text is written in Python) is very hot, many Python developers are Sublime Text installed several plug-ins, add a REPL and code highlighting began to work. Some students who just started learning Python tend to use an integrated development environment such as pycharm,visual Studio to help with programming.

Senior Python developers believe that too much code intelligence tips will interrupt their own ideas, suggesting that some unwanted information will reduce their efficiency, immersion programming is the ideal choice, the code itself has a very strong feedback mechanism, adding too much auxiliary function is just to gild the lily.


Demand Two

The veteran Pythoner is an all-around warrior with no movement and needs to be in charge of the server.

They like a person to save the world, from web development, automated testing, automated operation, task scheduling, machine learning, hardware development all have to do their own independent, only to develop a module is unable to satisfy the appetite, and will never be willing to do only a link on the screws. Python's simple syntax design makes the threshold for entry very low, making it possible for experts in different areas of development to start using Python to reinvent the wheel.

Operational engineer A once made a docker-py to control the Docker API to support the dispatch and monitoring of hundreds of containers on the server; Data Engineer B now uses airflow to control the ETL process to ensure that the data warehouse is impacted by the power of Hadoop and spark every day. The governance of the library can be organized. Web Engineer C has also used Django to quickly develop consumer-facing Web sites in response to a three-day change in user demand. Reptile Engineer D is using Scrapy to crawl the latest information from major news sites and social media to meet the needs of search engines. The hardware engineer E uses OPENCV on the raspberry pie to debug a face detection function to perform the core function debugging at a lower cost. Test Engineer F is using Selenium to automate tests on a variety of clients to detect bugs in a variety of situations ... In more cases, ABCDEF is likely to be the same person (known as an all-accounted engineer).

Contrast

In fact, Pythoner only needs an immersive programming environment and an instant pipeline to the server.

However, Sublime Text only satisfies the 1th; Jupyter only satisfies the 2nd. Until the advent of the Rstudio, the two have been combined.

Below we compare the similarities and differences of these three:

Serial number function Sublime Text jupyter rstudio
1 vim mode Yes No Yes
2 Custom Layout Yes No Yes
3 custom shortcut keys Yes No Yes
4 Folder Management Yes Yes
5 Global Search Yes No Yes
6 function Jump Yes No Yes
7 Multi-line Edit Yes Yes
8 multi-format output No Yes Yes
9 Chart Output No Yes Yes
Ten Markdown Preview Yes Yes
One Terminal no Yes Yes
12 Version Control Yes No Yes
13 Project Management Yes No Yes
Spark Connection No Yes Yes
15 Plug-in System Yes Yes
Web Access No Yes Yes
17 Rights Management No Yes Yes
18 Variable Management No no Yes
19 + languages Highlight Yes Yes
20 Cluster Management No Yes Yes
21 Real-time Save Yes Yes
More than 22 people edit no No Yes
23 Document Publishing Yes No Yes
How to use Rstudio correctly

The process for proper use of Rstudio is this:

1. Install Rstudio

Use the root account on the server to install Rstudio (and open port 8787), if there is more than one person to recommend not to install with Docker, if you still want, here are the corresponding tutorials.

2. Account Registration

Set the account password for the login Rstudio login, and the default user directory (do not recommend root permission).

AddUser Financer # set new user name
passwd Financer # Set the user's password
Mkdir/home/financer # Initialize Workspace
Chmod-r Financer/home/financer # to empower the work space
3. Open Editor

Access the server's 8787 port through the browser: e.g 123.456.789.1:8787.

4. Project Management

Click the New Item button in the upper left corner to create a new project and introduce Git or SVN as version control to pull the remote code.


5. New File

A new empty folder saved as a. py suffix file will provide the Python code highlighting, saved as the. SQL suffix will provide SQL code highlighting. (and html,c++ Optional)

6. Code Execution

Execute the Python code with CTRL + ALT + S (source) to view the execution results in the console.

7. In charge of the server

If you need to log on to the server, select tool-in the menu bar to go to the server side to directly resolve deep-seated problems.

8. Code Troubleshooting

When the program has some problems, and the code is a bit complicated, you can search for your code snippet globally by CTRL + SHIFT + F (Find)

9. File Search

In fact, we you find that sometimes the local CSV file path is wrong and want to find a file in the project, you can use CTRL + SHIFT +. To retrieve the file name globally (similar to find/|grep file name)

10. Preference Settings

Feel the default preferences do not satisfy your individual appetites, you can set shortcuts, vim mode, highlighting, fonts, snippet, and more in your preferences. I personally prefer the dark green theme of solarized dark.

Summarize

On the one hand, write the code on the server, pull the submit GIT/SVN directly on the server or deploy the Docker mirror, thus avoiding the problem that the code written under Windows/mac can't run on the server, that is, the code and Environment of the development environment and the test environment have always been consistent. On the other hand, you can go directly to the server site via the Web IDE in any browser, whether it's a chrome OS, Windows XP, or even a raspberry pie. In fact, Rstudio as my main editor 90% replaces Atom, Sublime Text, Jupyter, and so on, and now many Python engineers are learning how to use it.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.