Skip to content

Instantly share code, notes, and snippets.

View nesffer's full-sized avatar
🐧

Nesffer nesffer

🐧
View GitHub Profile
@nesffer
nesffer / Python_Philosophy.txt
Last active August 15, 2016 15:23
파이썬 철학 (Python Philosophy)
The Zen of Python, by Tim Peters
(파이썬 철학, 팀 피터스)
Beautiful is better than ugly.
(아름다운 것이 추한 것보다 낫다.)
Explicit is better than implicit.
(명확한 것이 함축적인 것보다 낫다.)
Simple is better than complex.
@nesffer
nesffer / python-added-urlopen.py
Created March 15, 2016 00:19
파이썬에서 query, header 추가해서 urlopen 사용하기
import urllib.parse
import urllib.request
url = 'http://example.com'
values = {'name': 'nesffer',
'query': 'python'}
headers = {'Content-Type': 'text/plain'}
data = urllib.parse.urlencode(values).encode('utf-8')
req = urllib.request.Request(url, data, headers)
f = urllib.request.urlopen(req)
@nesffer
nesffer / d2015_11_16_1.java
Last active November 16, 2015 13:30
Java 성적처리
import java.util.Random;
import java.util.stream.IntStream;
public class d2015_11_16_1 {
public static void main(String[] args) {
Random ran = new Random();
String[] name = {"신지민", "김재권", "송영교", "김명중", "이기현"};
int[][] num = new int[5][5];
int[] sum_row = new int[5];
int[] sum_col = {0, 0, 0, 0, 0};
@nesffer
nesffer / Python3.5-Build.txt
Last active October 27, 2023 10:52
Python 3.5 Build on Ubuntu 14.04.3
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2 _curses _curses_panel
_dbm _gdbm _lzma
_sqlite3 _ssl _tkinter
readline zlib
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
sudo apt-get install libbz2-dev libncurses5-dev libgdbm-dev liblzma-dev sqlite3 libsqlite3-dev openssl libssl-dev tcl8.6-dev tk8.6-dev libreadline-dev zlib1g-dev
@nesffer
nesffer / baseball.py
Created October 16, 2015 04:46
[Python] 야구 게임
# -*- coding: utf-8 -*-
# 랜덤 숫자 1~5
from random import randint
a = randint(1, 5)
b = randint(1, 5)
c = randint(1, 5)
# 랜덤 숫자 1~5
# a = 2
@nesffer
nesffer / vending_machine.py
Created October 16, 2015 04:45
[Python] 자판기
# -*- coding: utf-8 -*-
from sys import exit
pay = int(input("투입할 금액을 입력하세요: "))
price = int(input("제품의 가격을 입력하세요: "))
number = int(input("제품의 갯수를 입력하세요: "))
coin = int(input("동전의 단위를 입력하세요: "))
coin_list = [500, 100, coin]
coin_list.sort(reverse=True)
@nesffer
nesffer / admission.c
Last active September 24, 2015 00:34
Admission
#include <stdio.h>
int main() {
int male[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int female[10] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int male_num, female_num;
double money = 0;
do {
printf("남성은 몇명인가요? ");
@nesffer
nesffer / grades.txt
Last active August 29, 2015 14:22
Grades Management
Nesffer 21580023 10 20 30 40 50
Nesffer 21580023 60 70 80 90 100
Nesffer 21580023 90 80 70 60 50
Nesffer 21580023 40 30 20 10 20
Nesffer 21580023 30 40 50 60 70
@nesffer
nesffer / gist:650d7fb74d9794fc452a
Last active August 29, 2015 14:21
Network Connection Popup
# -*- coding: utf-8 -*-
from time import sleep
from tkinter import messagebox
from urllib.request import urlopen
import urllib.error
def net_connection_on():
try:
@nesffer
nesffer / gist:f5acccc03aa46572b1ea
Last active August 29, 2015 14:21
Array Element Move
#include <stdio.h>
#define RANGE 10
int main() {
int kk[RANGE] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
int i, j, move, temp;
printf("몇 번 이동 시키겠습니까? ");
scanf_s("%d", &move);