2016년 6월 16일 목요일
Python GUI module tkinter
라즈베리파이에서 GUI화면을 구현하려면, Tkinter를 import하라는데...
python 2에서는 Tkinter
python 3에서는 tkinter 랍니다.
별거아닌걸로 삽질함.
2016년 6월 15일 수요일
mp3 play with python at raspberry pi
import pygame
pygame.mixer.init()
pygame.mixer.music.load("myFile.mp3")
pygame.mixer.music.play()
while pygame.mixer.music.get_busy() == True:
continue
pygame.mixer.init()
pygame.mixer.music.load("myFile.mp3")
pygame.mixer.music.play()
while pygame.mixer.music.get_busy() == True:
continue
RaspberryPi FTP Server
1. vsftpd FTP Server 설치
-->sudo apt-get install vsftpd
-->sudo nano /etc/vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
local_enable=YES
write_enable=YES
local_umask=022
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
3. 사용자 리스트 파일(/etc/vsftpd.chroot_list)을 만들어 사용자를 등록
-->sudo nano /etc/vsftpd.chroot_list
에 user(pi,root)를 등록
-->sudo service vsftpd restart
2016년 6월 3일 금요일
c# database table existence check
public class cTableCheck
{
public bool TableExist(string conString, string tableName)
{
MySqlConnection Con = new MySqlConnection(conString);
using (var cmd = new MySqlCommand())
{
cmd.Connection = Con;
var sql = string.Format("select count(*) from information_schema.TABLES where table_name = '{0}'", tableName);
cmd.CommandText = sql;
Con.Open();
var count = Convert.ToInt32(cmd.ExecuteScalar());
return (count > 0);
}
}
}
{
public bool TableExist(string conString, string tableName)
{
MySqlConnection Con = new MySqlConnection(conString);
using (var cmd = new MySqlCommand())
{
cmd.Connection = Con;
var sql = string.Format("select count(*) from information_schema.TABLES where table_name = '{0}'", tableName);
cmd.CommandText = sql;
Con.Open();
var count = Convert.ToInt32(cmd.ExecuteScalar());
return (count > 0);
}
}
}
피드 구독하기:
덧글 (Atom)
vsftpd FTP 서버 접속은 성공하였으나, "디렉토리 목록 조회 실패" 현상 발생시
FTP Passive 모드를 활성화 필요. 1. vsftpd 설정 변경 /etc/vsftpd/vsftpd.conf 상에 아래 내용 추가 기입 #passive modpasv_enable=YES pasv_min_port=5001 pasv...
-
FTP Passive 모드를 활성화 필요. 1. vsftpd 설정 변경 /etc/vsftpd/vsftpd.conf 상에 아래 내용 추가 기입 #passive modpasv_enable=YES pasv_min_port=5001 pasv...
-
from PIL import Image, ImageTk E : Unable to locate package python3 - pil E : Unable to locate package python3 - imaging - tk $sudo ...



