Skip to content

Instantly share code, notes, and snippets.

@cwon
cwon / operator-assign.py
Last active December 5, 2017 10:24
operator-assign
import operator
# https://docs.python.org/3/library/operator.html
myOp = operator.and_
print bool( myOp(myOp(3==3,1==1), myOp(2==2, 1==1)) )
@cwon
cwon / simpleGolangBuildPattern.go
Created November 28, 2017 15:17
simpleGolangBuildPattern
package main
import (
"fmt"
)
type result struct {
src_text string
result_sz string
is_done bool
// ReadBMjuP.cpp : Defines the entry point for the console application.
//
#include <iostream>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <time.h>
#include <algorithm>
#include <list>
@cwon
cwon / ChangeCategory.py
Last active October 20, 2017 20:34
ChangeCategory
from selenium import webdriver
#browser = webdriver.Firefox()
browser = webdriver.Chrome()
browser.get("http://movie.naver.com/movie/bi/pi/filmo.nhn?code=71351")
browser.switch_to.frame("filmoContentsIframe");
browser.find_elements_by_css_selector('#filmoOrder')[0].click()
menus = browser.find_elements_by_css_selector('#filmoOrderLayer ul li a')
@cwon
cwon / client
Created October 20, 2017 10:45
SimplePy3SocketStringServer-Client
from socket import *
s_socket = socket(AF_INET, SOCK_STREAM)
s_socket.connect(("localhost", 6000))
while (True):
s_socket.send('Test\n'.encode())
@cwon
cwon / SimpleClient.py
Last active October 19, 2017 06:19
SimpleCM
# Client
from multiprocessing.connection import Client
address = ('localhost', 6000)
conn = Client(address)
conn.send('test')