# -*- coding: utf-8 -*-
"""
Created on Sun Apr 12 15:16:50 2020
@author: Hubert
"""
import pygame
init = pygame.init()
screen = pygame.display.set_mode((400,300))
title = pygame.display.set_caption('PyGame Demo')
''' -----------------------------------------------------------------------'''
run = True
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
print(event)
'''--------------------------------------------------------------------'''
update = pygame.display.update()
''' -----------------------------------------------------------------------'''
close = pygame.quit()
2020/04/15
PyGame 教學 (一)
基礎模版:
2019/04/22
利用 Veyon + WinSCP 讓學生端電腦下載FTP server上的多個檔案
Teacher's PC
https://filezilla-project.org/
- 需事先安裝設定 Veyon with Master & FileZilla FTP Server
- 安裝 Veyon without Master
- 安裝WinSCP,預設路徑 ( C:\Program Files (x86)\WinSCP\ )
- 建立 C:\bat 資料夾,並新增 scpget.bat & scpcmd.txt 二個檔案
@"C:\Program Files (x86)\WinSCP\winscp.com" /ini=nul /script=c:\bat\scpcmd.txt
@exit
scpget.bat 是一個批次檔,簡單的一句話,執行 winscp.com 並讀取預先建好的文字檔scpcmd.txt 裡的內容。在批次檔的每一行前面加個 小老鼠 @ ,在 dos 視窗就不會顯示所執行的指令,如果執行速度快,只會在畫面上看到 dos視窗閃一下。
----
[scpcmd.txt]
open ftp://user:passwd@192.168.1.1
lcd c:\temp
get *.*
exit
scpcmd.txt 裡是WinSCP專用的語法,每一行一個指令。 這個檔案的意思是讓 winscp.com 去連上 192.168.1.1 這台ftp server,帳號 user、密碼 passwd, 並將本地端的目錄設定為 c:\temp, get *.*就是把 ftp server上的檔案抓下來。 然後 exit 結束 winscp.com 這支程式。一句話簡述,就是把ftp server 上的檔案下載到學生端電腦 c:\temp 裡,下載完後結束程式。
---------------------------------------------------------------
最後操作Teacher's PC 透過 Veyon讓Students' PCs 執行 C:\bat\scpget.bat 即可。
[延伸應用]
執行批次檔清空特定資料的檔案
執行批次檔安裝指定軟體或更新
[link]
https://veyon.io/
https://winscp.net/https://filezilla-project.org/
2018/05/12
錯誤身教
火車上,人滿為患,旁邊座位的乘客到站下車,一嬤見狀,要幼孫來坐,幼孫不肯,並說:「無座票,不當坐。」
嬤回:「坐無妨,待人趕,再讓座。」
孫又答:「何必。」
嬤又回:「汝不坐,我坐。」
語畢,嬤強拉孫入座,孫哭鬧。
不久,該座的乘客走來,嬤先發制人:「
再一站就到了。
再一站就到了。
再一站就到了。」
對方原地苦笑 ......
嬤回:「坐無妨,待人趕,再讓座。」
孫又答:「何必。」
嬤又回:「汝不坐,我坐。」
語畢,嬤強拉孫入座,孫哭鬧。
不久,該座的乘客走來,嬤先發制人:「
再一站就到了。
再一站就到了。
再一站就到了。」
對方原地苦笑 ......
#這阿嬤打從一開始就沒想讓位了啊
2018/04/13
2018/04/07
FreeMeshX 2.0
FreeMeshX is a global terrain mesh replacement for the stock terrain mesh in Microsoft Flight Simulator – It is available free to bring more topography fidelity to your simulation!
[link]
http://ninetwopro.com/freemeshx/
[link]
http://ninetwopro.com/freemeshx/
2018/03/28
How to Format a Mac drive on Windows 10
HFSExplorer is easy and convenient to use.
Must have a Java SE Runtime Environment (version 5.0 or greater) before running HFSexplorer.
[link]
http://www.catacombae.org/hfsexplorer/
Must have a Java SE Runtime Environment (version 5.0 or greater) before running HFSexplorer.
[link]
http://www.catacombae.org/hfsexplorer/
2018/01/29
Mount disk(s) automatically on boot
The goal is to add another hard disk (sdb1) which assigned to partition /home automatically on boot.
[command]
vi /etc/fstab
[modify]
/dev/sdb1 /home ext4 defaults 1 0
[command]
vi /etc/fstab
[modify]
/dev/sdb1 /home ext4 defaults 1 0
Backup partitions
Here are several samples to backup partitions by tarball.
I wrote this notes when I tried to re-build my laboratory's mail server in 2010.
The following command is to backup the root / partition.
[command]
sudo tar -cvpzf ubuntuXYZ.tar.gz --exclude=/ubuntuXYZ.tar.gz --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys --exclude=/media --exclude=/dev /
The following command is to backup specific partition (e.g. /home and /etc).
[command]
sudo tar -cvpzf home0129.tar.gz --exclude=/home/home0129.tar.gz /home
sudo tar -cvpzf etc0129.tar.gz --exclude=/etc/etc0129.tar.gz /etc
I wrote this notes when I tried to re-build my laboratory's mail server in 2010.
The following command is to backup the root / partition.
[command]
sudo tar -cvpzf ubuntuXYZ.tar.gz --exclude=/ubuntuXYZ.tar.gz --exclude=/proc --exclude=/lost+found --exclude=/mnt --exclude=/sys --exclude=/media --exclude=/dev /
The following command is to backup specific partition (e.g. /home and /etc).
[command]
sudo tar -cvpzf home0129.tar.gz --exclude=/home/home0129.tar.gz /home
sudo tar -cvpzf etc0129.tar.gz --exclude=/etc/etc0129.tar.gz /etc
---------------------------------------------------------------
Restore
The following command is to restore data from backup file.
[command]
sudo tar -xvpfz home0129.tar.gz -C /home
2017/12/14
2017/12/13
How to solve MSI GS60 2PE Ghost Pro Bluetooth issue [win10]
Don't use Windows 10 built-in driver!
For the reason that Bluetooth devices would be disconnected while Wi-Fi getting busy.
It's recommended to install Intel official drivers for "Intel® Dual Band Wireless-AC 7260".
Please install both of Wi-Fi and Bluetooth drivers.
[Link]
https://www.intel.com/content/www/us/en/support/articles/000005559/network-and-i-o/wireless-networking.html
For the reason that Bluetooth devices would be disconnected while Wi-Fi getting busy.
It's recommended to install Intel official drivers for "Intel® Dual Band Wireless-AC 7260".
Please install both of Wi-Fi and Bluetooth drivers.
[Link]
https://www.intel.com/content/www/us/en/support/articles/000005559/network-and-i-o/wireless-networking.html
Subscribe to:
Posts (Atom)