project/
main.py
sub1/
__init__.py
helper.py
- 并发(Concurrency):Composition of independently executing process (processes in the general sense, not linux processes.
- 并行(Parallism): Simultaneous execution of computations
import select
import socket
if __name__ == "__main__":
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
s.setblocking(False)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
s.bind(('', 4000))
// call c function in cpp files
//cExample.h
#ifndef C_EXAMPLE_H
#define C_EXAMPLE_H
int add(int x,int y);
#endif
//cExample.c
#include "cExample.h"
int add( int x, int y ) {
在golang中的每个模块可以,定义init函数,用来初始化该包内的全局变量,我们可以看看它的特点
package main
import "fmt"
func init() {
fmt.Println("init 1")
}
func init() {
fmt.Println("init 2")
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fstream> | |
#include <cassert> | |
#include "json/json.h" | |
// json文件的读取 | |
int main() { | |
ifstream ifs; | |
// 打开数据文件 | |
ifs.open("testjson.json"); | |
assert(ifs.is_open()); |
OlderNewer