'Coding'에 해당되는 글 358건

  1. 2010.10.25 [Python] 파일 zip으로 압축하기
  2. 2010.08.26 SICP 연습문제 1.3
  3. 2010.08.26 SICP 연습문제 1.2
  4. 2010.08.26 SICP 연습문제 1.1
  5. 2010.08.21 [Bada] Bada로 만든 숫자 빨리 터치 하기 게임
  6. 2010.08.18 [Bada] Resource explore
  7. 2010.08.18 [Bada] SDK 설치
  8. 2010.07.14 1000!
  9. 2010.07.13 Self number ... 2
  10. 2010.07.11 Bubble sort
Coding/Python 삽질기2010. 10. 25. 00:25

#-*- coding: cp949 -*-
# 파일 명을 받아서 압축해 주는 스크립트

import os
import sys
import glob
import zipfile


def main(files):
    file_number = len(files)
    target_file = files[1];
        
    target = zipfile.ZipFile(target_file, 'w')
 
    for idx in range (2, file_number):
        all_flist = glob.glob (files[idx])
        for f in all_flist:
            if os.path.isdir(f):
                pass
            target.write(f)
   
    target.close()
  

#-------------------------------------------------------------------------------
# main
if __name__ == "__main__": 
    if len(sys.argv) < 3:
        print "Usage : pyzip source1 [source2]*"
    else:
        main(sys.argv)


'Coding > Python 삽질기' 카테고리의 다른 글

http://www.pythonchallenge.com...Level2  (0) 2010.12.06
1000!  (0) 2010.07.14
Self number ... 2  (0) 2010.07.13
Posted by chobocho
Coding/SICP2010. 8. 26. 22:14

'Coding > SICP' 카테고리의 다른 글

SICP 연습문제 1.2  (0) 2010.08.26
SICP 연습문제 1.1  (0) 2010.08.26
Posted by chobocho
Coding/SICP2010. 8. 26. 21:33
 

'Coding > SICP' 카테고리의 다른 글

SICP 연습문제 1.3  (0) 2010.08.26
SICP 연습문제 1.1  (0) 2010.08.26
Posted by chobocho
Coding/SICP2010. 8. 26. 21:20

'Coding > SICP' 카테고리의 다른 글

SICP 연습문제 1.3  (0) 2010.08.26
SICP 연습문제 1.2  (0) 2010.08.26
Posted by chobocho
Coding/Bada2010. 8. 21. 14:00
주말을 이용해 Bada로 만들어 본 간단한 게임.

Bada가 MFC와 비슷해서 MFC에 익숙한 분은 금방 만들 것 같다.

내공이 부족하다...ㅠㅜ



[게임 시작 화면]


[게임 화면]


[ 게임 오버 ]

'Coding > Bada' 카테고리의 다른 글

Bada SDK 2.0  (0) 2011.09.06
[Bada] Resource explore  (0) 2010.08.18
[Bada] SDK 설치  (0) 2010.08.18
Posted by chobocho
Coding/Bada2010. 8. 18. 23:56

Bada IDE에서 Resource explore가 안보일 때, 아래와 같이 메뉴을 클릭 하면 된다.
 
Window > Show View > Other… > bada > Resource Explorer.

'Coding > Bada' 카테고리의 다른 글

[Bada] Bada로 만든 숫자 빨리 터치 하기 게임  (0) 2010.08.21
[Bada] SDK 설치  (0) 2010.08.18
현재 시간 알아내기  (0) 2009.09.04
Posted by chobocho
Coding/Bada2010. 8. 18. 23:00
1. http://developer.bada.com 에 접속하여 가입을 한다.

2. SDK 툴을 다운 받는다.

3. 파란색 네모안의 툴을 다운 받아 설치하면 끝
    언어팩은 기본적으로 설치된다. (Language pack 1에 한국어도 있다.)


4. 프로젝트를 만들어서 예제 코드를 컴파일 후 실행하면 하기와 같이 Wave 폰의 시뮬레이터가 실행 된다.


설치 후 테스트 코드로 돌려 본 시뮬레이터

'Coding > Bada' 카테고리의 다른 글

[Bada] Bada로 만든 숫자 빨리 터치 하기 게임  (0) 2010.08.21
[Bada] Resource explore  (0) 2010.08.18
현재 시간 알아내기  (0) 2009.09.04
Posted by chobocho
Coding/Python 삽질기2010. 7. 14. 23:15
1000! 의 값을 보여주는 코드

print reduce(lambda x, y : x * y, range(1, 1001))

402387260077093773543702433923003985719374864210714632543799910429938512398629020592044208486969404800479988610197196058631666872994808558901323829669944590997424504087073759918823627727188732519779505950995276120874975462497043601418278094646496291056393887437886487337119181045825783647849977012476632889835955735432513185323958463075557409114262417474349347553428646576611667797396668820291207379143853719588249808126867838374559731746136085379534524221586593201928090878297308431392844403281231558611036976801357304216168747609675871348312025478589320767169132448426236131412508780208000261683151027341827977704784635868170164365024153691398281264810213092761244896359928705114964975419909342221566832572080821333186116811553615836546984046708975602900950537616475847728421889679646244945160765353408198901385442487984959953319101723355556602139450399736280750137837615307127761926849034352625200015888535147331611702103968175921510907788019393178114194545257223865541461062892187960223838971476088506276862967146674697562911234082439208160153780889893964518263243671616762179168909779911903754031274622289988005195444414282012187361745992642956581746628302955570299024324153181617210465832036786906117260158783520751516284225540265170483304226143974286933061690897968482590125458327168226458066526769958652682272807075781391858178889652208164348344825993266043367660176999612831860788386150279465955131156552036093988180612138558600301435694527224206344631797460594682573103790084024432438465657245014402821885252470935190620929023136493273497565513958720559654228749774011413346962715422845862377387538230483865688976461927383814900140767310446640259899490222221765904339901886018566526485061799702356193897017860040811889729918311021171229845901641921068884387121855646124960798722908519296819372388642614839657382291123125024186649353143970137428531926649875337218940694281434118520158014123344828015051399694290153483077644569099073152433278288269864602789864321139083506217095002597389863554277196742822248757586765752344220207573630569498825087968928162753848863396909959826280956121450994871701244516461260379029309120889086942028510640182154399457156805941872748998094254742173582401063677404595741785160829230135358081840096996372524230560855903700624271243416909004153690105933983835777939410970027753472000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000


'Coding > Python 삽질기' 카테고리의 다른 글

[Python] 파일 zip으로 압축하기  (0) 2010.10.25
Self number ... 2  (0) 2010.07.13
Self number  (1) 2010.07.10
Posted by chobocho
Coding/Python 삽질기2010. 7. 13. 23:10
1 부터 5000 사이의 Self number 개수와 그 합을 구하는 코드를 3줄로 줄여봤다.
self_number = set(range(1, 5001)) - set([sum( map(int, str(idx))) + idx for idx in range(1, 5001)])

print len(self_number)
print sum(self_number)
494
1227365

'Coding > Python 삽질기' 카테고리의 다른 글

1000!  (0) 2010.07.14
Self number  (1) 2010.07.10
몬테카를로 법을 이용한 원주율 계산  (0) 2010.07.09
Posted by chobocho
Coding/Java 삽질기2010. 7. 11. 00:17

'Coding > Java 삽질기' 카테고리의 다른 글

Android Tetris  (0) 2011.02.02
Selection sort  (0) 2010.07.11
Text2Memo  (0) 2010.05.09
Posted by chobocho