본문 바로가기

2016/02

[PYTHON 3] Tutorials 45. Struct (bytes data <-> normal data(human readable)) 안녕하세요. 이번 시간에는 Struct 에 대해서 알아보도록 하겠습니다. 파이썬에서 Struct이 무엇인지부터 얘기를 시작해볼까 합니다. 파이썬에서는 어떠한 형태의 데이터, 가령 numbers, letters, string 와 같은 데이터를 bytes (0,1 으로 이루어진 바이너리 형태의 데이터) 데이터로 converting 할 수 있습니다. 그럼 왜 이렇게 bytes 형태의 데이터로 전환을 할까요? 이는 우리가 사용하는 컴퓨터가 데이터를 저장하거나 네트워크를 통해 이러한 데이터를 주고 받을 때, 이진형태의 bytes data( 0, 1 )로 데이터를 다루기 때문입니다. 그러나 이런 형태의 데이터는 인간이 확인하여 인지하기는 힘든 점이 있습니다. 그러므로 평소에는 인간들이 읽을 수 있는 형태로 스크린에.. 더보기
돌아온 제이슨 본(맷 데이먼)... 반갑고 기대된다...예고편! 좋아하는 영화 중 하나인 본 시리즈가 새로운 모습을 하고 관객을 기다리고 있다. 제레미 레너가 출연한 '본 레거시(2012)'에 상당한 실망을 한 후 역시 본 시리즈는 '맷 데이먼'과 '폴 그린그래스' 감독이 했었어야 했다는 생각을 떨쳐 낼 수가 없었다. 이 당시 맷 데이먼이 한 말이 다시금 떠 오른다. 폴 그린그래스 감독이랑 함께 하지 않을거면 본 시리즈에 출연하지 않겠다던 이 말이 본 레거시를 본 이후 머리속을 한 동안 맴돌았더랬다. 기억 속에서 차츰 잊혀져가던 바로 이 시리즈가 올해(2016) 다시금 관객들을 찾아 올 모양이다. 열혈팬으로서 무척 기대되고 빨리 개봉하였으면 한다. 더보기
Advanced scheduling of Mac OS Wake and Sleep Time Mac OS has a settings panel that allows you to schedule the Wake, Sleep and Shutdown time for your Mac, but there is only one sche dule allowed, everyday, or every friday, or every weekend, and so on. I wanted a different wake and shutdown time for the weekend and weekdays. This is possible using cron, and the command line tool pmset. The crontab below wakes the Mac up at 5pm every weekday and s.. 더보기
How to sync your Mac's Documents, Desktop, and any other folder to Dropbox How to sync your Mac's Documents, Desktop, and any other folder to DropboxWe're in the early days of the cloud, but it's easier than you might think to put all your important files onto Dropbox. There are plenty of reasons to put things into the cloud, be it as a backup or to access them remotely from other devices. But putting things into the cloud can be a hassle — Apple's trying to make it a .. 더보기
find files and folders recursively in Python Using glob and iglob. Python 3.5+ Starting with Python version 3.5, the glob module supports the "**" directive (which is parsed only if you pass recursive flag):import glob for filename in glob.iglob('src/**/*.c', recursive=True): print(filename)If you need an list, just use glob.glob instead of glob.iglob. Python 2.2 to 3.4 For older Python versions, starting with Python 2.2, use os.walk to recursively walk a direc.. 더보기
How to Buy a USB Type-C Cable That Won’t Damage Your Devices How to Buy a USB Type-C Cable That Won’t Damage Your Devices USB Type-C brings a new universal connector to laptops and smartphones, and many device are already starting to use it. But beware: many USB-C cables aren’t designed properly and could potentially damage your hardware. Before buying any USB Type-C cables for your new devices, you should look up whether the cable is actually compliant w.. 더보기