In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you how to use Python RStudio editor, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to understand it!
Demand one
Experienced Pythoner does not rely on the integrated development environment and requires immersive programming.
Real experts often do not need interactive programming environment, they prefer immersive programming, these experts used to choose text editors such as Vim or Sublime Text to solve problems. For example, in the past, when Sublime Text (Sublime Text was written in Python) was very popular, many Python developers installed several plug-ins on Sublime Text, added a REPL and code highlighting to get to work. On the other hand, some students who are just learning Python tend to use integrated development environments such as PyCharm,Visual Studio to assist programming.
Senior Python developers believe that too many code intelligent prompts will interrupt their own ideas, prompting some unneeded information will reduce their efficiency, immersive programming is the ideal choice, the code itself has a very powerful feedback mechanism, adding too many auxiliary functions is just icing on the cake.
Demand two
The senior Pythoner is an omnipotent warrior who is free from operation and maintenance and needs to be in charge of the server.
They like to save the world by themselves, from Web development, automated testing, automated operation and maintenance, crawler development, data warehouse, task scheduling, machine learning, and hardware development. Just developing a certain module will not satisfy their appetite, and they will never be willing to be a screw in a certain link. Because of its concise syntax design, Python has a very low barrier to entry, which makes experts in different development fields begin to try to use Python to recreate wheels.
Operation engineer An once made a docker-py to control the API of Docker to support the scheduling and monitoring of hundreds of containers on the server; data engineer B now uses Airflow to control the process of ETL to ensure that under the impact of Hadoop and Spark every day, the governance of the data warehouse can be orderly. Web engineer C has also used Django to rapidly develop consumer-oriented websites to respond to changing user needs. Crawler engineer D is using Scrapy to crawl information from major news sites and social media to meet the needs of search engines. The hardware engineer E uses OpenCV to debug a face detection function on the raspberry pie to debug the core function at a lower cost. Test engineer F is using Selenium to automate tests on various clients to detect Bug in various situations. In more cases, ABCDEF is likely to be the same person (known as a wholly occupied engineer).
Contrast
In fact, all Pythoner needs is an immersive programming environment and an instant pipeline to the server.
However, Sublime Text only satisfies the * point; Jupyter only satisfies the second point. Until the advent of RStudio, the two were combined.
Let's compare the similarities and differences between the three:
How to use RStudio correctly
The process for using RStudio correctly is as follows:
1. Install RStudio
Install RStudio on the server using a root account (and open port 8787). If many people work together, it is recommended not to install using Docker. If you still want it, here is a tutorial.
two。 Account registration
Set the account password for logging in to RStudio, and the default user directory (it is recommended that you do not give root permission).
Adduser FinanceR # set the new user name passwd FinanceR # set the user's password mkdir / home/FinanceR # initialize the workspace chmod-R FinanceR / home/FinanceR # empower the workspace
3. Open the editor
Access the server's port 8787 through a browser: e.g.123.456.789.1:8787
4. Project management
Click the New Project button in the upper left corner, create a new Project and introduce Git or SVN for version control, and pull the remote code.
5. Create a new file
Creating a new empty folder and saving as a .py suffix file will provide Python code highlighting, and saving as a .SQL suffix will provide SQL code highlighting. (html,c++ is also optional)
6. Code execution
Execute the python code through ctrl + alt + s (source), and you can view the execution result in console.
7. In charge of the server
If you need to log in to the server, select Tool- "Shell in the menu bar to directly solve the deep-seated problem on the server side.
8. Code troubleshooting
When there are some problems in the program, when the code is a little complex, you can search your code snippet globally through ctrl + shift + f (find).
9. File search
In fact, you find that sometimes the local csv file path is wrong. 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 setting
I feel that the default preferences do not satisfy my taste. You can set keyboard shortcuts, Vim mode, highlight, font, snippet and other details in your preferences. I personally prefer solarized dark's dark green theme.
Summary
On the one hand, write the code on the server, pull and submit the Git/SVN or deploy the Docker image directly on the server, so as to avoid the problem that the code written under Windows/Mac can not run on the server, that is to say, the code of the development environment and test environment is consistent with the environment all the time. On the other hand, through Web IDE, you can go directly to the server site in any browser, whether it's a Chrome OS, Windows XP or even a raspberry pie. In fact, RStudio has replaced Atom, Sublime Text, Jupyter, and so on as my main editor, and now many Python engineers are learning how to use it.
The above is all the content of this article "how to use the RStudio Editor for Python". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.