發表文章

目前顯示的是 9月, 2017的文章

[Python] Basic commands, functions and Math

圖片
# (octothorpe or pound character) Everything after the # is ignored by python. print "text" string in "" will be printed out. Integer and Float 1/4 = 0 (int) 1.00 / 4 = (float)   % (modulus) 75 % 4 = 3 (75 = 18 * 4 + 3 ) 2 % 4 = 2  Variable myName = "Rovingleaves" myAge = 40 print "my name is %s. I am %d years old" % (myName, myAge) s: String (converts any python object using  str() ). d: Signed integer decimal. f: Floating point decimal format. x:  Unsigned hexadecimal (lowercase). X: Unsigned hexadecimal (Uppercase). Escape Sequences

[Python] Basic Functions in PowerShell

To a specific directory (cd command) cd D:newDirectory\  cd C:\Users\<User Name>\Desktop  Run a python file (The python file must be in the same folder) D:\newDirectory> python testFile.py

[PowerShell] Normal Commands

Create a new directory New-Item -ItemType directory -Path C:\newDiretory Change into a directory Set-Location -Path D:\newDirectory  Get items in a folder Get-ChildItem -Path D:\newDirectory Get items, including hidden items, in a folder Get-ChildItem -Force D:\newDirectory  Open a file Invoke-Item newFile.txt