diff --git a/README.md b/README.md index 91680394d..a08b1c141 100644 --- a/README.md +++ b/README.md @@ -1,198 +1,274 @@ -
-
-
-
-
-
-
-
-
|
- |
-
- |
-
|---|---|
| - -```python -from lithops import FunctionExecutor - -def hello(name): - return f'Hello {name}!' - -with FunctionExecutor() as fexec: - f = fexec.call_async(hello, 'World') - print(f.result()) -``` - | -- -```python -from lithops.multiprocessing import Pool - -def double(i): - return i * 2 - -with Pool() as pool: - result = pool.map(double, [1, 2, 3, 4]) - print(result) -``` - | -
|
- |
-
- |
-
|---|---|
| - -```python -from lithops import Storage - -if __name__ == "__main__": - st = Storage() - st.put_object(bucket='mybucket', - key='test.txt', - body='Hello World') - - print(st.get_object(bucket='lithops', - key='test.txt')) -``` - | -- -```python -from lithops.storage.cloud_proxy import os - -if __name__ == "__main__": - filepath = 'bar/foo.txt' - with os.open(filepath, 'w') as f: - f.write('Hello world!') - - dirname = os.path.dirname(filepath) - print(os.listdir(dirname)) - os.remove(filepath) -``` - | -
+
+
+
+
+
+
+
+
+
+
+
|
+ |
+
+ |
+
|---|---|
| + +```python +from lithops import FunctionExecutor + +def double(i): + return i * 2 + +with FunctionExecutor() as fexec: + f = fexec.map(double, [1,2,3,4,5,6]) + print(f.result()) +``` + | ++ +```python +from lithops.multiprocessing import Pool + +def double(i): + return i * 2 + +with Pool() as pool: + result = pool.map(double, [1, 2, 3, 4]) + print(result) +``` + | +
|
+ |
+
+ |
+
|---|---|
| + +```python +from lithops import Storage + +if __name__ == "__main__": + st = Storage() + st.put_object(bucket='mybucket', + key='test.txt', + body='Hello World') + + print(st.get_object(bucket='lithops', + key='test.txt')) +``` + | ++ +```python +from lithops.storage.cloud_proxy import os + +if __name__ == "__main__": + filepath = 'bar/foo.txt' + with os.open(filepath, 'w') as f: + f.write('Hello world!') + + dirname = os.path.dirname(filepath) + print(os.listdir(dirname)) + os.remove(filepath) +``` + | +