数学講師2858358 views
ヒストリア284999 views
高校日本史189945 views
中学理科1627041 views
中学数学621738 views
中学英語809206 views
高校化学2914610 views
中学社会667307 views
世界の国561106 views
教育148996 views
Help
Tools

English

Config of root path - Pi/Pie

In the Pi/Pie project, developers can set the root path in index.pi.

+ html
+ path
+ option


this_file = path.this()
option.path.root = this_file.parent.path

html.print(data)

The path.this() return an Path object of the current file. The Path object has parent property that is also Path object, and path property that is not relative but absolute.

index.pi is directly placed in the project directory so its parent is project itself.

In the above case, the root path is set to the project path. The default root is “/” in the OS level.

I think Pi/Pie language can be used in Rollpie and local environments. If you use Pi/Pie as an alternative of Python or Java in your computer, you may not need to change the root path. In the Rollpie project, there is no need to change the root option.