语言基础快速预览-Lua

  • 数据类型
  • 变量
  • 循环
  • 流程控制
  • 函数
  • 运算符
  • 字符串
  • 数组
  • 迭代器
  • table
  • Lua模块与包
  • Lua元表
  • 协同程序
  • 文件I/O
  • 错误处理
  • 面向对象
  • 初阶话题
  • 进阶话题
  • 高阶话题

供大家快速熟悉各种语言基础语法,快速上手。叙述尽量简洁。
对以下资源进行整理排版,在此表示感谢。

  1. https://www.w3cschool.cn/lua/yiso1tcv.html

数据类型


--[[nil、boolean、number、string、userdata、function、thread和table。
userdata    表示任意存储在变量中的C数据结构
thread      表示执行的独立线路,用于执行协同程序--]]print(type("Hello world"))      --> string
print(type(10.4*3))             --> number
print(type(print))              --> function
print(type(type))               --> function
print(type(true))               --> boolean
print(type(nil))                --> nil
print(type(type(X)))            --> string
print('1##############')tab1 = { key1 = "val1", key2 = "val2", "val3" }
for k, v in pairs(tab1) doprint(k .. " - " .. v)
end
-- 删除key1
tab1.key1 = nil
for k, v in pairs(tab1) doprint(k .. " - " .. v)
end
print('2##############')print(type(true))
print(type(false))
print(type(nil))
if type(false) or type(nil) thenprint("false and nil are false!")
elseprint("other is true!")
end
print('3##############')--数字类型只有一种number
print(type(2))
print(type(2.2))
print(type(0.2))
print(type(2e+1))
print(type(0.2e-1))
print(type(7.8263692594256e-06))
print('4##############')string1 = "this is string1"
string2 = 'this is string2'
html = [[
<html>
<head></head>
<body><a href="//www.w3cschool.cn/">w3cschoolW3Cschool教程</a>
</body>
</html>
]]
print(html)
print('5##############')print("2" + 6)
print("2" + "6")
print("2 + 6")
print("-2e2" * "6")
--print("error" + 1) --报错
print("a" .. 'b')   --输出ab
print(157 .. 428)   --输出157428
print(#"www.w3cschool.cn")    --输出长度
print('6##############')local tbl1 = {}  -- 创建一个空的 table
local tbl2 = {"apple", "pear", "orange", "grape"}  --直接初始化
a = {}
a["key"] = "value"
key = 10
a[key] = 22
a[key] = a[key] + 11
for k, v in pairs(a) doprint(k .. " : " .. v)
end
print('7##############')local tbl = {"apple", "pear", "orange", "grape"}
for key, val in pairs(tbl) doprint("Key", key)    --所以从1开始
end
print('8##############')a3 = {}
for i = 1, 10 doa3[i] = i
end
a3["key"] = "val"
print(a3["key"])
print(a3["none"])
print('9##############')function factorial1(n)if n == 0 thenreturn 1elsereturn n * factorial1(n - 1)end
end
print(factorial1(5))
factorial2 = factorial1
print(factorial2(5))
print('10##############')function anonymous(tab, fun)for k, v in pairs(tab) doprint(fun(k, v))end
end
tab = { key1 = "val1", key2 = "val2" }
anonymous(tab, function(key, val)return key .. " = " .. val
end)
print('*************************************')

变量

---------------------------变量-----------------------------
--在默认情况下,变量总是认为是全局的。
print(b)    --输出nil
b=10
print(b)    --输出10b = nil      --删除变量
print(b)    --输出nil
print('11##############')a = 5               -- 全局变量
local b = 5         -- 局部变量
function joke()c = 5           -- 全局变量local d = 6     -- 局部变量
end
joke()
print(c,d)          --> 5 nil
dolocal a = 6     -- 局部变量b = 6           -- 全局变量print(a,b);     --> 6 6
end
print(a,b)      --> 5 6
print('11##############')a, b = 10, 2*a  --       a=10; b=2*x
a, b = b, a
--a. 变量个数 > 值的个数             按变量个数补足nil
--b. 变量个数 < 值的个数             多余的值会被忽略
a, b, c = 0, 1
print(a,b,c)             --> 0   1   nil
a, b = a+1, b+1, b+2     -- value of b+2 is ignored
print(a,b)               --> 1   2
a, b, c = 0
print(a,b,c)             --> 0   nil   nil
print('12##############')--   t[i]
--  t.i                 -- 当索引为字符串类型时的一种简化写法
--  gettable_event(t,i) -- 采用索引访问本质上是一个类似这样的函数调用
site = {}
site["key"] = "www.w3cschool.cn"
print(site["key"])
print(site.key)
print('*************************************')

循环

a=10
while( a < 20 )
doprint("a 的值为:", a)a = a+1
end
print('13##############')--数值for循环
function f(x)print("function")return x*2
end
for i=1,f(5) do print(i)
end
print('14##############')--泛型for循环
days = {"Suanday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"}
for i,v in ipairs(days) do  print(v) end
print('15##############')--[ 变量定义 --]
a = 10
--[ 执行循环 --]
repeatprint("a的值为:", a)a = a + 1
until( a > 15 )
print('16##############')

流程控制


--[ 定义变量 --]
a = 10;
--[ 使用 if 语句 --]
if( a < 20 )
then--[ if 条件为 true 时打印以下信息 --]print("a 小于 20" );
end
print("a 的值为:", a);
print('17##############')--[ 定义变量 --]
a = 100;
--[ 检查条件 --]
if( a < 20 )
then--[ if 条件为 true 时执行该语句块 --]print("a 小于 20" )
else--[ if 条件为 false 时执行该语句块 --]print("a 大于 20" )
end
print("a 的值为 :", a)
print('18##############')--[ 定义变量 --]
a = 100--[ 检查布尔条件 --]
if( a == 10 )
then--[ 如果条件为 true 打印以下信息 --]print("a 的值为 10" )
elseif( a == 20 )
then--[ if else if 条件为 true 时打印以下信息 --]print("a 的值为 20" )
elseif( a == 30 )
then--[ if else if condition 条件为 true 时打印以下信息 --]print("a 的值为 30" )
else--[ 以上条件语句没有一个为 true 时打印以下信息 --]print("没有匹配 a 的值" )
end
print("a 的真实值为: ", a )
print('19##############')a = 100;
b = 200;
--[ 检查条件 --]
if( a == 100 )
then--[ if 条件为 true 时执行以下 if 条件判断 --]if( b == 200 )then--[ if 条件为 true 时执行该语句块 --]print("a 的值为 100 b 的值为 200" );end
end
print("a 的值为 :", a );
print("b 的值为 :", b );
print('20##############')

函数


--[[ 函数返回两个值的最大值 --]]
function max(num1, num2)if (num1 > num2) thenresult = num1;elseresult = num2;endreturn result;
end
-- 调用函数
print("两值比较最大值为 ",max(10,4))
print("两值比较最大值为 ",max(5,6))
print('21##############')myprint = function(param)print("这是打印函数 -   ##",param,"##")
end
function add(num1,num2,functionPrint)result = num1 + num2-- 调用传递的函数参数functionPrint(result)
end
myprint(10)
-- myprint 函数作为参数传递
add(2,5,myprint)
print('22##############')function maximum (a)local mi = 1             -- 最大值索引local m = a[mi]          -- 最大值for i,val in ipairs(a) doif val > m thenmi = im = valendendreturn m, mi
end
print(maximum({8,10,23,12,5}))
print('23##############')function average(...)result = 0local arg={...}for i,v in ipairs(arg) doresult = result + vendprint("总共传入 " .. #arg .. " 个数")return result/#arg
endprint("平均值为",average(10,5,3,4,5,6))
print('24##############')

运算符

a = true
b = true
if ( a and b )
thenprint("a and b - 条件为 true" )
end
if ( a or b )
thenprint("a or b - 条件为 true" )
end
print("---------分割线---------" )
-- 修改 a 和 b 的值
a = false
b = true
if ( a and b )
thenprint("a and b - 条件为 true" )
elseprint("a and b - 条件为 false" )
end
if ( not( a and b) )
thenprint("not( a and b) - 条件为 true" )
elseprint("not( a and b) - 条件为 false" )
end
print('25##############')

字符串

a = "Hello "
b = "World"
print("连接字符串 a 和 b ", a..b )
print("b 字符串长度 ",#b )
print("字符串 Test 长度 ",#"Test" )
print("w3cschool在线教程网址长度 ",#"www.w3cschool.cn" )
print('26##############')string1 = "Lua"
print("\"字符串 1 是\"",string1)
string2 = 'w3cschool.cn'
print("字符串 2 是",string2)
string3 = [["Lua 教程"]]
print("字符串 3 是",string3)
print('27##############')

数组

array = {"Lua", "Tutorial"}
for i= 0, 2 doprint(array[i])
end
print('28##############')array = {}
for i= -2, 2 doarray[i] = i *2
end
for i = -2,2 doprint(array[i])
end
print('29##############')-- 初始化数组
array = {}
for i=1,3 doarray[i] = {}for j=1,3 doarray[i][j] = i*jend
end
-- 访问数组
for i=1,3 dofor j=1,3 doprint(array[i][j])end
end
print('30##############')

迭代器

array = {"Lua", "Tutorial"}
--迭代器
for key,value in ipairs(array)
doprint(key, value)
end
print('31##############')function square(iteratorMaxCount,currentNumber)if currentNumber<iteratorMaxCountthencurrentNumber = currentNumber+1return currentNumber, currentNumber*currentNumberend
endfor i,n in square,3,0
doprint(i,n)
end
print('32##############')function iter (a, i)i = i + 1local v = a[i]if v thenreturn i, vend
endfunction ipairs (a)return iter, a, 0
end
print('33##############')array = {"Lua", "Tutorial"}function elementIterator (collection)local index = 0local count = #collection-- 闭包函数return function ()index = index + 1if index <= countthen--  返回迭代器的当前元素return collection[index]endend
endfor element in elementIterator(array)
doprint(element)
end
print('34##############')

table

-- 初始化表
mytable = {}
-- 指定值
mytable[1]= "Lua"
-- 移除引用
mytable = nil
-- lua 垃圾回收会释放内存
-- 简单的 table
mytable = {}
print("mytable 的类型是 ",type(mytable))
mytable[1]= "Lua"
mytable["wow"] = "修改前"
print("mytable 索引为 1 的元素是 ", mytable[1])
print("mytable 索引为 wow 的元素是 ", mytable["wow"])
-- alternatetable和mytable的是指同一个 table
alternatetable = mytable
print("alternatetable 索引为 1 的元素是 ", alternatetable[1])
print("mytable 索引为 wow 的元素是 ", alternatetable["wow"])
alternatetable["wow"] = "修改后"
print("mytable 索引为 wow 的元素是 ", mytable["wow"])
-- 释放变量
alternatetable = nil
print("alternatetable 是 ", alternatetable)
-- mytable 仍然可以访问
print("mytable 索引为 wow 的元素是 ", mytable["wow"])
mytable = nil
print("mytable 是 ", mytable)
print('35##############')fruits = {89,"orange","apple"}
-- 返回 table 连接后的字符串
print("连接后的字符串 ",table.concat(fruits))
-- 指定连接字符
print("连接后的字符串 ",table.concat(fruits,", "))
-- 指定索引来连接 table
print("连接后的字符串 ",table.concat(fruits,", ", 2,3))
print('36##############')fruits = {"banana","orange","apple"}
-- 在末尾插入
table.insert(fruits,"mango")
print("索引为 4 的元素为 ",fruits[4])
-- 在索引为 2 的键处插入
table.insert(fruits,2,"grapes")
print("索引为 2 的元素为 ",fruits[2])
print("最后一个元素为 ",fruits[5])
table.remove(fruits)
print("移除后最后一个元素为 ",fruits[5])
print('37##############')

Lua模块与包

require("myModule")
print(module.constant)
module.func3()-- 别名变量 m
local m = require("myModule")
print(m.constant)
m.func3()
print('38##############')

Lua元表

--当你通过键来访问 table 的时候,如果这个键没有值,
--那么Lua就会寻找该table的metatable(假定有metatable)中的__index 键。
--如果__index包含一个表格,Lua会在表格中查找相应的键。mytable = {}                          -- 普通表
mymetatable = {}                      -- 元表
-- 把 mymetatable 设为 mytable 的元表
--如果元表(mymetatable)中存在__metatable键值,setmetatable会失败 。
setmetatable(mytable,mymetatable)
mytable = setmetatable({},{})  --等价上面操作
getmetatable(mytable)           -- 这回返回mymetatableother = { foo = 3 }
t = setmetatable({}, { __index = other })
print(t.foo)
print(tbar)
print('39##############')
mytable = setmetatable({key1 = "value1"}, {__index = function(mytable, key)if key == "key2" thenreturn "metatablevalue"elsereturn nilendend
})print(mytable.key1,mytable.key2)
print('40##############')
--上面可简写为下面代码
mytable = setmetatable({key1 = "value1"}, { __index = { key2 = "metatablevalue" } })
print(mytable.key1,mytable.key2)
print('41##############')
-- __newindex 元方法用来对表更新,__index则用来对表访问 。
mymetatable = {}
mytable = setmetatable({key1 = "value1"}, { __newindex = mymetatable })
print(mytable.key1)
mytable.newkey = "新值2"
print(mytable.newkey,mymetatable.newkey)    -- 新索引,调用元方法
mytable.key1 = "新值1"
print(mytable.key1,mymetatable.newkey1)     -- 已存在的索引,直接赋值
--输出
--  value1
--  nil    新值2
--  新值1    nil
print('42##############')
mytable = setmetatable({key1 = "value1"}, {__newindex = function(mytable, key, value)rawset(mytable, key, "\""..value.."\"")end
})
mytable.key1 = "new value"
mytable.key2 = 4
print(mytable.key1,mytable.key2)
--输出
--  new value  "4"
print('43##############')
-- 计算表中最大值,table.maxn在Lua5.2以上版本中已无法使用
-- 自定义计算表中最大值函数 table_maxn
function table_maxn(t)local mn = 0for k, v in pairs(t) doif mn < k thenmn = kendendreturn mn
end-- 两表相加操作
mytable = setmetatable({ 1, 2, 3 }, {__add = function(mytable, newtable)for i = 1, table_maxn(newtable) dotable.insert(mytable, table_maxn(mytable)+1,newtable[i])endreturn mytableend
})secondtable = {4,5,6}mytable = mytable + secondtable
for k,v in ipairs(mytable) do
print(k,v)
end
print('44##############')
mytable = setmetatable({ 10, 20, 30 }, {__tostring = function(mytable)sum = 0for k, v in pairs(mytable) dosum = sum + vendreturn "表所有元素的和为 " .. sumend
})
print(mytable)
print('45##############')
-- 计算表中最大值,table.maxn在Lua5.2以上版本中已无法使用
-- 自定义计算表中最大值函数 table_maxn
function table_maxn(t)local mn = 0for k, v in pairs(t) doif mn < k thenmn = kendendreturn mn
end-- 定义元方法__call
mytable = setmetatable({10}, {__call = function(mytable, newtable)sum = 0for i = 1, table_maxn(mytable) dosum = sum + mytable[i]endfor i = 1, table_maxn(newtable) dosum = sum + newtable[i]endreturn sumend
})
newtable = {10,20,30}
print(mytable(newtable))
print('46##############')

协同程序

--[[
coroutine.create()  创建coroutine,返回coroutine, 参数是一个函数,当和resume配合使用的时候就唤醒函数调用
coroutine.resume()  重启coroutine,和create配合使用
coroutine.yield()   挂起coroutine,将coroutine设置为挂起状态,这个和resume配合使用能有很多有用的效果
coroutine.status()  查看coroutine的状态
注:coroutine的状态有三种:dead,suspend,running,具体什么时候有这样的状态请参考下面的程序
coroutine.wrap()  创建coroutine,返回一个函数,一旦你调用这个函数,就进入coroutine,和create功能重复
coroutine.running() 返回正在跑的coroutine,一个coroutine就是一个线程,当使用running的时候,就是返回一个corouting的线程号
--]]
co = coroutine.create(function(i)print(i);end
)coroutine.resume(co, 1)   -- 1
print(coroutine.status(co))  -- deadprint("----------")co = coroutine.wrap(function(i)print(i);end
)co(1)print("----------")co2 = coroutine.create(function()for i=1,10 doprint(i)if i == 3 thenprint(coroutine.status(co2))  --runningprint(coroutine.running()) --thread:XXXXXXendcoroutine.yield()endend
)coroutine.resume(co2) --1
coroutine.resume(co2) --2
coroutine.resume(co2) --3print(coroutine.status(co2))   -- suspended
print(coroutine.running())   --nil
print("----------")
print('47############\n')function foo (a)print("foo 函数输出", a)return coroutine.yield(2 * a) -- 返回  2*a 的值
endco = coroutine.create(function (a , b)print("第一次协同程序执行输出", a, b) -- co-body 1 10local r = foo(a + 1)print("第二次协同程序执行输出", r)local r, s = coroutine.yield(a + b, a - b)  -- a,b的值为第一次调用协同程序时传入print("第三次协同程序执行输出", r, s)return b, "结束协同程序"                   -- b的值为第二次调用协同程序时传入
end)print("main", coroutine.resume(co, 1, 10)) -- true, 4
print("--分割线----")
print("main", coroutine.resume(co, "r")) -- true 11 -9
print("---分割线---")
print("main", coroutine.resume(co, "x", "y")) -- true 10 end
print("---分割线---")
print("main", coroutine.resume(co, "x", "y")) -- cannot resume dead coroutine
print("---分割线---")
print('48############\n')-- 生产者消费者问题
--[[
local newProductorfunction productor()local i = 0while true doi = i + 1send(i)     -- 将生产的物品发送给消费者end
endfunction consumer()while true dolocal i = receive()     -- 从生产者那里得到物品print(i)end
endfunction receive()local status, value = coroutine.resume(newProductor)return value
endfunction send(x)coroutine.yield(x)     -- x表示需要发送的值,值返回以后,就挂起该协同程序
end-- 启动程序
newProductor = coroutine.create(productor)
consumer()
]]--print('49############\n')

文件I/O

-- 简单模式
-- 以只读方式打开文件--[[
file = io.open("myModule.lua", "r")-- 设置默认输入文件为 test.lua
io.input(file)-- 输出文件第一行
print(io.read())-- 关闭打开的文件
io.close(file)-- 以附加的方式打开只写文件
file = io.open("myModule.lua", "a")-- 设置默认输出文件为 test.lua
io.output(file)-- 在文件最后一行添加 Lua 注释
io.write("--  test.lua 文件末尾注释")-- 关闭打开的文件
io.close(file)
]]--
print('50############\n')-- 完全模式
-- 以只读方式打开文件
--[[
file = io.open("myModule.lua", "r")-- 输出文件第一行
print(file:read())-- 关闭打开的文件
file:close()-- 以附加的方式打开只写文件
file = io.open("myModule.lua", "a")-- 在文件最后一行添加 Lua 注释
file:write("--test")-- 关闭打开的文件
file:close()
]]--
print('51############\n')

错误处理

function myfunction ()n = n/nil
endfunction myerrorhandler( err )print( "ERROR:", err )
endstatus = xpcall( myfunction, myerrorhandler )
print( status)
print('52############\n')-----------------------垃圾回收------------------
mytable = {"apple", "orange", "banana"}print(collectgarbage("count"))mytable = nilprint(collectgarbage("count"))print(collectgarbage("collect"))print(collectgarbage("count"))
print('53############\n')

面向对象

Account = {balance = 0}
function Account.withdraw (v)Account.balance = Account.balance - v
end
Account.withdraw(100.00)
print('54############\n')-- 继承-- Meta class
Shape = {area = 0}
-- 基础类方法 new
function Shape:new (o,side)o = o or {}setmetatable(o, self)self.__index = selfside = side or 0self.area = side*side;return o
end
-- 基础类方法 printArea
function Shape:printArea ()print("面积为 ",self.area)
end-- 创建对象
myshape = Shape:new(nil,10)
myshape:printArea()Square = Shape:new()
-- 派生类方法 new
function Square:new (o,side)o = o or Shape:new(o,side) --把自己(Square)设为基类(Shape)的元表setmetatable(o, self)self.__index = selfreturn o
end-- 派生类方法 printArea
function Square:printArea ()print("正方形面积为 ",self.area)
end-- 创建对象
mysquare = Square:new(nil,10)
mysquare:printArea()Rectangle = Shape:new()
-- 派生类方法 new
function Rectangle:new (o,length,breadth)o = o or Shape:new(o)setmetatable(o, self)self.__index = selfself.area = length * breadthreturn o
end-- 派生类方法 printArea
function Rectangle:printArea ()print("矩形面积为 ",self.area)
end-- 创建对象
myrectangle = Rectangle:new(nil,10,20)
myrectangle:printArea()
print('55############\n')--[[
require "luasql.mysql"--创建环境对象
env = luasql.mysql()--连接数据库
conn = env:connect("数据库名","用户名","密码","IP地址",端口)--设置数据库的编码格式
conn:execute"SET NAMES UTF8"--执行数据库操作
cur = conn:execute("select * from role")row = cur:fetch({},"a")--文件对象的创建
file = io.open("role.txt","w+");while row dovar = string.format("%d %s\n", row.id, row.name)print(var)file:write(var)row = cur:fetch(row,"a")
endfile:close()  --关闭文件对象
conn:close()  --关闭数据库连接
env:close()   --关闭数据库环境
]]--
print('56############\n')

初阶话题

--对象工厂模式function create(name,id)local obj = {name = name,id = id}function obj:SetName(name)self.name = nameendfunction obj:GetName()return self.nameendfunction obj:SetId(id)self.id = idendfunction obj:GetId()return self.idendreturn obj
end--简单继承
local function CreateRobot(name,id)local obj = {name = name,id = id}function obj:SetName(name)self.name = nameendfunction obj:GetName()return self.nameendfunction obj:SetId(id)self.id = idendfunction obj:GetId()return self.idendreturn obj
endlocal function createFootballRobot(name ,id ,position)local obj = CreateRobot(name ,id)obj.position = "right back"function obj:SetPosition(p)self.position = pendfunction obj:GetPosition()return self.positionendreturn obj
end
print('57############\n')

进阶话题

function createCountdownTimer(second)local ms = second * 1000  --ms为countDown的Upvaluelocal function countDown()ms = ms -1return msendreturn countDown
endlocal timer1 = createCountdownTimer(1)for i = 1, 3 doprint(timer1())
end
print('58############\n')local t = {}
local m = {a = "and",b = "Li Lei", c = "Han Meimei"}setmetatable(t,{__index = m})  --表{ __index=m }作为表t的元表for k,v in pairs(t) do  --穷举表t,是找不到的print("有值吗?")print(k,"=>",v)
endprint("-------------")
print(t.b, t.a, t.c)    --此处可以在元表中找到值
print('59############\n')-- 基于原型的继承
local Robot = { name = "Sam", id = 001 }
function Robot:New(extension)local t = setmetatable(extension or { }, self)self.__index = selfreturn t
endfunction Robot:SetName(name)self.name = name
endfunction Robot:GetName()return self.name
endfunction Robot:SetId(id)self.id = id endfunction Robot:GetId()return self.id
endrobot = Robot:New()
print("robot's name:", robot:GetName())
print("robot's id:", robot:GetId())
print("-----------------")local FootballRobot = Robot:New({position = "right back"})
function FootballRobot:SetPosition(p)self.position = p
endfunction FootballRobot:GetPosition()return self.position
endfr = FootballRobot:New()
print("fr's position:", fr:GetPosition())
print("fr's name:", fr:GetName())
print("fr's id:", fr:GetId())
print("-----------------")fr:SetName("Bob")
print("fr's name:", fr:GetName())
print("robot's name:", robot:GetName())
print('60############\n')

高阶话题

-- 迭代
--  enum函数返回一个匿名的迭代函数,
--  for语句每次调用该迭代函数都得到一个值(通过element变量引用),
--  若该值为nil,则for循环结束。
local function enum(array)local index = 1return function()local ret = array[index]index = index + 1return retend
endlocal function foreach(array,action)for element in enum(array)doaction(element)end
endforeach({1,2,3},print)

语言基础快速预览-Lua相关推荐

  1. AE基础教程(9)——第9章 快速预览

    点击 新建合成: 新建图形(我们现在画的图是这个样子的): 点击"切换像素长宽比校正"后,长和宽的比例会变: 如果我们在刚开始的时候在新建合成中的像素长宽比选择的是方形像素我们建出 ...

  2. AE基础教程第一阶段——09快速预览

    快速预览 点击 新建合成 新建图形 我们现在画的图是这个样子的 点解切换像素长宽比校正会变得像正方形 如果我们在刚开始的时候在新建合成中的像素长宽比选择的是方形像素我们建出来的图形就是一个正方形,这时 ...

  3. 一个Django快速预览项目

    创建一个Django项目,会用到一些包,但是下载多了会导致电脑变卡.变慢,这个时候可以用到虚拟环境来解决这个问题,每写一个项目,便可以在虚拟环境内配置各种环境而不影响电脑本身的环境. 我是用的是win ...

  4. quicklook不能预览office_万物皆可格!给空格键施加神奇魔法的神器软件—快速预览工具QuicklookPC软件...

    大家好,我是元力.今天给大家带来一款电脑端使用的超级神奇的软件.只需要选中文件,然后点击空格键,即可预览文件. 支持大部分格式,比如word.excel.pdf.图片.视频甚至图片的源文件等等.真正实 ...

  5. Flutter教程(1)——快速预览

    简介 Flutter 是 Google 用以帮助开发者在 iOS 和 Android 两个平台开发高质量原生 UI 的移动 SDK.只需要维护一套代码就能在ios和Android中构建漂亮的App应用 ...

  6. Webappbuilder开发快速预览

    Webappbuilder开发快速预览 by 李远祥 Webappbuilder for ArcGIS 是由ArcGIS JavaScripit API和dojo创建的,它允许通过创建自己的widge ...

  7. MacOS效率工具IQuickLook-多合一Quick Look快速预览与右键扩展信息工具

    MacOS效率工具IQuickLook-多合一Quick Look快速预览与右键扩展信息工具 系统说明 Quick Look说明 什么是Quick Look Quick Look的局限 "I ...

  8. Win7下快速预览各种类型的文本文件

    win7下的快速预览功能,给我们带来了不少便捷.但它只能预览指定的或者有预览处理器的文件.一般情况下.我们的源码都是文本类型的.但win7默认只支持txt文件的预览.我们要想快速的预览下各种编程语言源 ...

  9. 前端预览word文件_[装机必备] QuickLook —— 敲击空格即可快速预览文件

    ​今天给大家推荐的软件是:QuickLook 你只需要选中文件,然后敲击空格,就可以快速预览文件内容 QuickLook 有三个版本:安装版.便携版.UWP 版 作者对这三个版本的描述: *需要注意的 ...

最新文章

  1. python学会了可以做什么菜_python学习之路(24)
  2. 神经网络版的GTA5火了,网友:好像AI的梦境
  3. 【加】德鲁·卡宾森 - 质量效应2:升天(2013年6月7日)
  4. vue获取当前日期和时间并进行格式化
  5. java学习笔记十一——对象转型
  6. window的war发布Linux失败,为什么war包在Windows的tomcat正常运行,在linux服务器报errorpage错误?...
  7. 大数据面试3分钟自我介绍_如何在面试时,做好三分钟自我介绍
  8. 人脸检测-Haar分类器方法
  9. 1018. Binary Prefix Divisible By 5可被 5 整除的二进制前缀
  10. 大规模电机控制的方案选择-电机和驱动器篇
  11. AI图片翻译助手软件FAQ
  12. 如何获取网站的HTTPS证书?
  13. 计算机系23班趣味口号,23班口号怎么写
  14. 比较两组数据的差异用什么图更直观_用好这11种可视化图表,数据可视化技能秒提升...
  15. 考研最易出现的几种心理状态,让人崩溃!
  16. 关于“/usr/include/openssl/bn.h 288 error: parse error before BN_ULONG解决方法
  17. 大数据学习路线,如何学习大数据?
  18. 迅为10.1寸人机界面工业HMI安卓电容屏定制生产供应商
  19. Omnipeek空口抓包(2):扫描无线网络
  20. 刚写完的 基于网页的音乐平台网站(含后台) 毕业设计毕设源码 (1)功能介绍

热门文章

  1. Scope Script Example (Scope)
  2. 修改chrome或edge缓存位置
  3. Grafana+Prometheus+Windows_exporter+Mysql_exporter
  4. Linux_insmod之后一直处于等等状态
  5. 开口谈薪水前,你一定要知道的事!
  6. java多态计算几何,通过程序设计几何图形、矩形、圆形、正方形、几种类型,能过利用接口和多态性计算几何图形的面积和周长并显示出来...
  7. Docker 搭建的大数据环境
  8. 适合宏基因组的可移动元件数据库mobileOG的使用
  9. VUE2.0 饿了么学习笔记(10)加减号组件cartcontrol
  10. cmd 默认编码以及切换