Skip to content

Commit 2258f55

Browse files
committed
增加示例工程
1 parent b934ca6 commit 2258f55

File tree

31 files changed

+479
-0
lines changed

31 files changed

+479
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"expendKeys":[
3+
"/src/html",
4+
"/src/shell",
5+
"/src/c#",
6+
"/src/js",
7+
"/src/css",
8+
"/include",
9+
"/src/c",
10+
"/src/vue/components",
11+
"/src/python/utils",
12+
"/",
13+
"/scripts",
14+
"/src/vue",
15+
"/src/python",
16+
"/src"
17+
],
18+
"lastAccessTime":1661222250.1999269,
19+
"openList":[
20+
"/src/python/main.py",
21+
"/src/python/utils/calc.py",
22+
"/src/python/time_echo.py"
23+
],
24+
"selectFilePath":"/src/python/main.py",
25+
"type":"python"
26+
}
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Python-Web-IDE
2+
-----------
3+
> 一个简易的在线Python的IDE
4+
> 基于Vue3 + Python3.10 + Tornado6.1实现
5+
> 前后端分离
6+
7+
## 功能说明
8+
- 支持工程、文件、文件夹的增删查改
9+
- 支持Python代码基本补全
10+
- 支持Python代码(GUI不支持)运行管理和输出
11+
- 支持Markdown文件的编辑和预览
12+
13+
## 更新说明
14+
- 基于Vue3+Python3.10的全新实现
15+
- 引入markdown编辑器
16+
- 引入图标vscode-icons
17+
- 更改编辑器主题
18+
19+
## 编译和运行
20+
### 环境
21+
- Node: 16.13.2
22+
- Npm: 8.1.2
23+
- Python: 3.10
24+
- Tornado: 6.1
25+
26+
### 前端
27+
```bash
28+
# 安装依赖
29+
npm install 或者 yarn install
30+
31+
# 开发运行(默认端口是8080)
32+
npm run serve
33+
34+
# 打包编译(默认打包的路径在dist目录,后端程序已经配置从该目录加载资源)
35+
npm run build
36+
```
37+
38+
### 后端
39+
```bash
40+
# 假定已经安装好Python环境(建议使用虚拟Python环境并激活)
41+
42+
# 进入后端目录
43+
cd server
44+
45+
# 安装依赖
46+
pip install -r requirements.txt
47+
48+
# 运行(运行端口为10086)指定端口可以使用参数 --port=10010
49+
# 如果前端页面是独立运行的,不可指定后端端口(除非修改前端代码)
50+
python server.py
51+
52+
# 访问 (工程保存在projects/ide里面)
53+
# 开发运行前端的情况: localhost:8080
54+
# 打包好前端的情况: localhost:10086
55+
```
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/usr/bin/env python3
2+
# Software License Agreement (BSD License)
3+
#
4+
# Copyright (c) 2022, Vinman, Inc.
5+
# All rights reserved.
6+
#
7+
# Author: Vinman <[email protected]>
8+
9+
import os
10+
from setuptools import setup, find_packages
11+
12+
setup(
13+
name='pytest',
14+
version='1.0.0',
15+
author='Vinman',
16+
description='just for test',
17+
packages=find_packages(),
18+
author_email='[email protected]',
19+
install_requires=[],
20+
long_description='just for test',
21+
license='BSD',
22+
zip_safe=False
23+
)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
using System;
2+
3+
namespace csharp_demo
4+
{
5+
class Program
6+
{
7+
static void Main(string[] args)
8+
{
9+
Console.WriteLine("Hello World");
10+
}
11+
}
12+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
CC=gcc
3+
CFLAGS=-c -Wall -g
4+
5+
OBJS=main.o utils.o
6+
7+
main:$(OBJS)
8+
$(CC $^ -o main
9+
10+
%.o:%.cpp
11+
$(CC) $^ $(CFLAGS) -o $@
12+
clean:
13+
rm *.o main
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
# Software License Agreement (MIT License)
3+
#
4+
# Copyright (c) 2022, Vinman, Inc.
5+
# All rights reserved.
6+
#
7+
# Author: Vinman <[email protected]>
8+
*/
9+
10+
#include <stdio.h>
11+
#include "utils.hpp"
12+
13+
int main(int argc, char *argv[]) {
14+
Utils util;
15+
int a = 100;
16+
int b = 36;
17+
printf("%d + %d = %d\n", util.add(a, b));
18+
printf("%d - %d = %d\n", util.sub(a, b));
19+
return 0;
20+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/*
2+
# Software License Agreement (MIT License)
3+
#
4+
# Copyright (c) 2022, Vinman, Inc.
5+
# All rights reserved.
6+
#
7+
# Author: Vinman <[email protected]>
8+
*/
9+
10+
#include "utils.hpp"
11+
12+
int Utils::add(int a, int b) {
13+
return a + b;
14+
}
15+
16+
int Utils::sub(int a, int b) {
17+
return a - b;
18+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/*
2+
# Software License Agreement (MIT License)
3+
#
4+
# Copyright (c) 2022, Vinman, Inc.
5+
# All rights reserved.
6+
#
7+
# Author: Vinman <[email protected]>
8+
*/
9+
10+
#ifndef __UTILS_H_
11+
#define __UTILS_H_
12+
13+
class Utils {
14+
public:
15+
int add(int a, int b);
16+
int sub(int a, int b);
17+
};
18+
19+
20+
#endif // __UTILS_H_
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
CC=gcc
3+
CFLAGS=-c -Wall -g
4+
5+
OBJS=main.o hello.o
6+
7+
ALL: main
8+
9+
main:$(OBJS)
10+
$(CC $^ -o main
11+
12+
%.o:%.c
13+
$(CC) $^ $(CFLAGS) -o $@
14+
clean:
15+
rm *.o main
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
/*
2+
# Software License Agreement (MIT License)
3+
#
4+
# Copyright (c) 2022, Vinman, Inc.
5+
# All rights reserved.
6+
#
7+
# Author: Vinman <[email protected]>
8+
*/
9+
10+
#include "hello.h"
11+
12+
int add(int a, int b) {
13+
return a + b;
14+
}
15+
16+
int sub(int a, int b) {
17+
return a - b;
18+
}
19+
20+
int main(int argc, char *argv[]) {
21+
return 0;
22+
}

0 commit comments

Comments
 (0)