'Programming'에 해당되는 글 1837건

  1. 2020.01.11 python 반복문 for in range()
  2. 2020.01.11 python print 와 while 문
  3. 2020.01.11 오랫만에 한가로움?
  4. 2020.01.10 python split
  5. 2020.01.09 python 겅부
  6. 2020.01.09 python 관련 문서들
  7. 2020.01.08 SMS PDU 형식
  8. 2020.01.03 css3 calc()
  9. 2020.01.02 python exception
  10. 2019.12.17 node.js xpath 그리고 boolean

왜 열거형(sequence)를 따라서 for문을 사용하게 했는지 모르겠지만..

일단은 열거형은 []로 나열되는 tuple의 list 혹은 array라고 하는데

node.js와 비교하면 배열을 foreach 로 반복하도록 문법을 제한한 느낌이라고 해야하나?

 

[링크 : https://www.w3schools.com/python/ref_func_range.asp]

[링크 : https://www.learnpython.org/en/Loops]

'Programming > python(파이썬)' 카테고리의 다른 글

python yield  (0) 2021.04.07
python 공부  (0) 2020.01.14
python print 와 while 문  (0) 2020.01.11
오랫만에 한가로움?  (0) 2020.01.11
python split  (0) 2020.01.10
Posted by 구차니

 

if guess == number:
    print('same')
elif guess < number:
    print('larger then')
else:
    print('lesser then')

 

node.js와는 다르게 문자열과 숫자를 마음대로 + 로 출력할 수가 없다.

그리고 while 문에 대해서도 특이하게 else가 붙어서 마지막 조건에서 벗어날때 무언가를 할 수 있다.

(무슨 용도로 이걸 만들었을까..)

cnt = 10;

while cnt > 0:

cnt = cnt - 1;

print('cnt:', cnt);

else:

print('cnt <= a', cnt);

 

[링크 : https://www.opentutorials.org/module/2980/17535]

'Programming > python(파이썬)' 카테고리의 다른 글

python 공부  (0) 2020.01.14
python 반복문 for in range()  (0) 2020.01.11
오랫만에 한가로움?  (0) 2020.01.11
python split  (0) 2020.01.10
python 겅부  (0) 2020.01.09
Posted by 구차니

머 애들이랑 놀아주는게 한가로울리가 없지만

그래도 마음 편하게 가족이랑 있으니 좋긴하네

'Programming > python(파이썬)' 카테고리의 다른 글

python 반복문 for in range()  (0) 2020.01.11
python print 와 while 문  (0) 2020.01.11
python split  (0) 2020.01.10
python 겅부  (0) 2020.01.09
python 관련 문서들  (0) 2020.01.09
Posted by 구차니

파싱을 위해 split 함수 혹은 tokenizer를 찾고 있는 중.

(regexp_split 같은 것도 있으려나?)

 

[링크 : https://wayhome25.github.io/python/2017/02/26/py-14-list/]

[링크 : https://wikidocs.net/13]

[링크 : https://www.w3schools.com/python/ref_string_split.asp]

[링크 : https://mainia.tistory.com/5624]

 

+

[링크 : https://stackoverflow.com/questions/13209288/python-split-string-based-on-regex]

'Programming > python(파이썬)' 카테고리의 다른 글

python print 와 while 문  (0) 2020.01.11
오랫만에 한가로움?  (0) 2020.01.11
python 겅부  (0) 2020.01.09
python 관련 문서들  (0) 2020.01.09
python exception  (0) 2020.01.02
Posted by 구차니

 

$ python3
Python 3.6.9 (default, Nov  7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

5.4.5. 문자열 포맷팅
>>> age = 20
>>> name = 'Swaroop'
>>> print ("{0} was {1} years old".format(name, age))
Swaroop was 20 years old
>>> print ("{1} was {0} years old".format(name, age))
20 was Swaroop years old
>>> print ("{1:.3f} was {0} years old".format(name, age))
20.000 was Swaroop years old

5.4.7 순 문자열
>>> print(r"\a")
\a
>>> print("\a")

'Programming > python(파이썬)' 카테고리의 다른 글

오랫만에 한가로움?  (0) 2020.01.11
python split  (0) 2020.01.10
python 관련 문서들  (0) 2020.01.09
python exception  (0) 2020.01.02
python 컴파일하기 및 디컴파일?  (0) 2019.12.14
Posted by 구차니

이제 다시 한번 마스터 해봐야지..

node.js 해서 문법적으로 유사성을 찾으면 좀 쉬우려나?

 

[링크 : https://docs.python.org/3.8/download.html]

[링크 : http://byteofpython-korean.sourceforge.net/byte_of_python.pdf] 2.7 기준

'Programming > python(파이썬)' 카테고리의 다른 글

python split  (0) 2020.01.10
python 겅부  (0) 2020.01.09
python exception  (0) 2020.01.02
python 컴파일하기 및 디컴파일?  (0) 2019.12.14
python indent  (0) 2019.12.13
Posted by 구차니
Programming/android2020. 1. 8. 17:37
Posted by 구차니
Programming/css2020. 1. 3. 16:14

css에서 연산을 할 수 있게 한다는 것은 양날의 검이 될 듯 한데..

아무튼 이런 기능이 있다는걸 오늘 처음 알았음.

 

[링크 : https://developer.mozilla.org/ko/docs/Web/CSS/calc]

[링크 : https://www.codingfactory.net/10373]

[링크 : https://techbug.tistory.com/215]

'Programming > css' 카테고리의 다른 글

css 반응형 웹 대응 - 미디어 쿼리  (0) 2024.01.18
@keyframe in css  (0) 2019.01.29
css transform zindex origin  (0) 2018.10.25
css tooltip 위치  (0) 2018.10.25
css로 백그라운드만 돌리기  (0) 2018.10.10
Posted by 구차니

C만 쓰다 보니 예외처리 부터 공부를 좀 해야겠다..

Cpp만 써봤어도 이해가 쉬울텐데...

 

[링크 : https://docs.python.org/ko/3/tutorial/errors.html]

[링크 : https://wikidocs.net/30]

'Programming > python(파이썬)' 카테고리의 다른 글

python 겅부  (0) 2020.01.09
python 관련 문서들  (0) 2020.01.09
python 컴파일하기 및 디컴파일?  (0) 2019.12.14
python indent  (0) 2019.12.13
tensorflow, pytorch  (0) 2019.12.10
Posted by 구차니
Programming/node.js2019. 12. 17. 13:26

이제야 눈에 띄는 DOM3 XPath 1.0 implementation..

그래서 문법을 많이 적용 못 받은건가? 최신은 3.1인 것 같은데 1.0이라서 기능들이 많이 빠진듯

 

DOM 3 XPath 1.0 implemention and helper for JavaScript, with node.js support.

[링크 : https://www.npmjs.com/package/xpath]

 

아무튼 boolean() 함수는 결과값이 boolean 타입이다(당연하지만)

[링크 : https://developer.mozilla.org/ko/docs/Web/XPath/Functions/boolean]

 

아래는 xpath node.js npm의 예제를 이용하여

/book 노드가 실제로 존재하는지 boolean()으로 체크하도록 수정한 내용이다.

> var xpath = require('xpath')
undefined
>
> var dom = require('xmldom').DOMParser
undefined
> var xml = ""
undefined
> var doc = new dom().parseFromString(xml)
undefined
console.log(xml)

undefined
> var nodes = xpath.select("//title", doc)
undefined
console.log(nodes[0].localName + ": " + nodes[0].firstChild.data)
title: Harry Potter
undefined
var test = xpath.select("boolean(/book)", doc)
undefined
console.log(typeof test)
boolean
undefined
console.log(test)
true

typeof로 체크시 boolean 타입으로 나오니.. 기존에 프로그램을 좀 수정해야 할 듯..

'Programming > node.js' 카테고리의 다른 글

node.js cookie 관련 함수들  (0) 2020.01.19
node.js crypto 모듈  (0) 2020.01.19
node.js JWT with refresh token  (0) 2019.12.10
node.js synchornous file write  (0) 2019.11.06
postgres on node.js  (0) 2019.09.24
Posted by 구차니