Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Pycharm remote development

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Requirements: the implementation is developed on Windows10 and runs on centos7.

Configure the connection of pycharm

Tools-- > Deployment-- > Configuration... -- > the plus sign in the upper left corner

Choose a name by yourself. After selecting SFTP,OK, you will go to the configuration page.

First configure the contents of the Connection.

The connection used to add the server.

Enter the IP you want to connect to in the SFTP host and test it on the right.

Next, configure the contents of the Mappings

Configure the location in Linux where the code is stored.

View the location of the configuration project code on the Linux server

At this point, pycharm will have an extra interface.

Find the code.

In pycharm, set it to the Python environment on the Linux server

In file-> setting, add the configuration and click the settings icon in the upper right corner.

Find add remote.

Add the path, user name, and Python environment of the Linux server

Then pycharm loads the environment on Linux

After that, you can see on the interface that there is an extra Python environment after ssh.

Synchronize the code and execute the program

Upload the code to the server, otherwise the code file will not be synchronized on the server.

You can see an extra file on the right.

Use pycharm to run normally, and that's fine.

The above operation is to upload a file separately.

You can upload the entire directory to the server, right-click the project name, upload in the project on the left, and upload the entire directory.

Note:

After deleting a local file, even if the entire directory structure is uploaded synchronously, the existing code file on the server will not be deleted, so you need to manually delete the specified file in the directory structure on the right. Changes to the contents of the file can be synchronized.

After that, when you run this file again, it will run on the server side. If you want to change it back, just change the running environment of Python.

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.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report