Built-in Functions
I/O Functions
print(value)
Outputs a value to the console.
print "Hello"
print 42input(prompt)
Reads user input from the console.
let name = input("Enter your name: ")
print nameType Conversion Functions
str(value)
Converts a value to a string.
let num = 42
let text = str(num)int(value)
Converts a value to an integer.
let text = "123"
let num = int(text)type(value)
Returns the type name of a value as a string.
print type(42) # Prints: int
print type("hello") # Prints: strUtility Functions
len(value)
Returns the length of a string or list.
let text = "FlowLang-Script"
print len(text) # Prints: 15range(start, end)
Creates a list of integers from start (inclusive) to end (exclusive).
let numbers = range(1, 5)
print numbers # Prints: [1, 2, 3, 4]HTTP Functions
http_get(url)
Performs an HTTP GET request and returns the response.
let data = http_get("https://jsonplaceholder.typicode.com/users/1")
print dataFeatures:
- Automatic JSON parsing when possible
- Returns dictionary for JSON responses
- Returns string for plain text responses
- Error handling with error messages
http_post(url, data)
Performs an HTTP POST request with JSON data.
let response = http_post("https://api.example.com/data", {"key": "value"})
print responseFile I/O Functions
read_file(path)
Reads and returns the contents of a file.
let content = read_file("data.txt")
print contentwrite_file(path, content)
Writes content to a file.
let result = write_file("output.txt", "Hello, World!")
print result # Prints: Written to output.txtFunction Reference Table
| Function | Category | Description |
|---|---|---|
print(value) | I/O | Output to console |
input(prompt) | I/O | Read user input |
str(value) | Conversion | Convert to string |
int(value) | Conversion | Convert to integer |
type(value) | Utility | Get type name |
len(value) | Utility | Get length |
range(start, end) | Utility | Create number list |
http_get(url) | HTTP | GET request |
http_post(url, data) | HTTP | POST request |
read_file(path) | File I/O | Read file |
write_file(path, content) | File I/O | Write file |