查看: 8304|回复: 0

[laravel] Python Django/Ruby On Rails/Go 各种语言与php和Laravel的区别

[复制链接]

49

主题

62

帖子

3014

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3014
发表于 2016-11-30 08:48:26 | 显示全部楼层 |阅读模式
Python基础语法
  1. print("Hello, World!")
复制代码
循环
  1. fruits = ['banana', 'apple',  'mango']
  2. for index in range(len(fruits)):
  3.    print '当前水果 :', fruits[index]

  4. print "Good bye!"
复制代码
函数
  1. def functionname( parameters ):
  2.    "函数_文档字符串"
  3.    function_suite
  4.    return [expression]
复制代码


Django


  1. --检查配置
  2. python manage.py  check  

  3. --收集静态文件
  4. python manage.py collectstatic --noinput 1>/dev/null

  5. --数据结构获取
  6. python manage.py  makemigrations detection
  7. python manage.py  makemigrations deployment
  8. python manage.py makemigrations operating  

  9. --DB同步
  10. python manage.py  migrate  


  11. --admin页面 的超级用户创建
  12. python manage.py  createsuperuser

  13. --运行
  14. python manage.py runserver
复制代码


Django 提供了基于 web 的管理工具。
pip, easy_install




相关资料
http://djangobook.py3k.cn/2.0/
http://www.runoob.com/django/django-model.html


Ruby基础语法
  1. puts "Hello, Ruby!";
复制代码
循环
  1. $i = 0
  2. $num = 5

  3. while $i < $num  do
  4.    puts("在循环语句中 i = #$i" )
  5.    $i +=1
  6. end
复制代码
方法

  1. def test(a1="Ruby", a2="Perl")
  2. puts "编程语言为 #{a1}"
  3. puts "编程语言为 #{a2}"
  4. end
  5. test "C", "C++"
  6. test
复制代码




Ruby On Rails
和Laravel 几乎完全一样


gem  Gemfile

相关资料http://www.runoob.com/ruby/ruby-intro.html
http://guides.ruby-china.org/



Go语言
docker , gogs ,etcd


安装
https://golang.org/dl/


基础语法 hello.go
  1. package main

  2. import "fmt"

  3. func main() {
  4.     fmt.Println("Hello, World!")
  5. }
复制代码
go run hello.go

无闻: https://github.com/Unknwon
视频: https://github.com/Unknwon/go-fundamental-programming
书:http://wiki.jikexueyuan.com/project/the-way-to-go/

http://www.runoob.com/go/go-tutorial.html





签名
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表