Welcome to mirror list, hosted at ThFree Co, Russian Federation.

README.md - github.com/torch/sys.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a0b6aa88701f50d388e885a5bc3dcf4e7ae7d641 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Lua *system* package

## Dependencies
Torch7 (www.torch.ch)

## Install
```
$ luarocks install sys
```

## Use
```
$ torch
> require 'sys'
> for k in pairs(sys) print(k) end  -- gives you all the included functions
dirname
dirp
usleep
ls
prefix
uname
pwd
fstat
COLORS
lla
tic
toc
OS
la
execute
ll
concat
basename
clock
filep
```

### sys.COLORS
If you'd like print in colours, follow the following snippets of code. Let start by listing the available colours
```
$ torch
> for k in pairs(sys.COLORS) do print(k) end
```
Then, we can generate a shortcut `c = sys.COLORS` and use it within a `print`
```
> c = sys.COLORS
> print(c.magenta .. 'This ' .. c.red .. 'is ' .. c.yellow .. 'a ' .. c.green .. 'rainbow' .. c.cyan .. '!')
```