์ ์ฒด ๊ธ
[Node.js] ์ฌ์ฉ์๊ฐ ์ํ๋ ํด๋ ์ด๋ฆ ์์ ํ๊ฒ ๋ฐ์์ค๊ธฐ
node app.js ํ์ผ๋ช ์ผ๋ก ์คํํด์ฃผ๋ฉด, var os = require('os'); const path = require('path'); const folder = process.argv[2]; const workingDir = path.join(os.homedir(), 'Pictures', folder); if (!folder || !fs.existsSync(workingDir)) { console.error('Please enter a folder name in Picture'); } console.log('Working Directory: ' + workingDir); - process.argv ๊ธธ์ด๊ฐ 3์ธ ๋ฐฐ์ด - process.argv[2] ํ์ผ๋ช -const workingDir = pat..
๋ฐฐ์ด์ ํจ์๋ค
๋ฐฐ์ด ์์ฒด๋ฅผ ๋ณ๊ฒฝ ์๋ก์ด ๋ฐฐ์ด์ ๋ง๋ค์ด์ ๋ฐํ ์์ ๊ฐ์ด ํฌ๊ฒ ๋๊ฐ์ง ์คํ์ผ๋ก ๋ถ๋ฅ ๊ฐ๋ฅ const ์ฃฝs = ['๋์ง์ฃฝ','์ ๋ณต์ฃฝ','ํธ๋ฐ์ฃฝ','ํ์ฃฝ']; //ํน์ ํ ์ค๋ธ์ ํธ๊ฐ ๋ฐฐ์ด์ธ์ง ์ฒดํฌ console.log(Array.isArray(์ฃฝs)); // true console.log(Array.isArray({})); //false //ํน์ ํ ์์ดํ ์ ์์น๋ฅผ ์ฐพ์ ๋ console.log(์ฃฝs.indexOf('ํธ๋ฐ์ฃฝ')); //2 //๋ฐฐ์ด ์์ ํน์ ํ ์์ดํ ์ด ์๋์ง ์ฒดํฌ console.log(์ฃฝs.includes('ํธ๋ฐ์ฃฝ')); // true console.log(์ฃฝs.includes('์ผ์ฑ์ฃฝ')); //false // ์์ดํ ์ถ๊ฐ : ์ ์ผ ๋ค // ๋ฐฐ์ด ์์ฒด๋ฅผ ๋ณ๊ฒฝ ์ฃฝs.push('์ฐธ์น์ฃฝ'); con..
[py] ๊ฑฐ๋ถ์ด ๊ทธ๋ํฝ
turtle --- ํฐํ ๊ทธ๋ํฝ — ํ์ด์ฌ ์ค๋ช ์ ์ฃผ์ํ (flowdas.com) turtle --- ํฐํ ๊ทธ๋ํฝ — ํ์ด์ฌ ์ค๋ช ์ ์ฃผ์ํ turtle --- ํฐํ ๊ทธ๋ํฝ ์์ค ์ฝ๋: Lib/turtle.py ์๊ฐ ํฐํ(๊ฑฐ๋ถ์ด) ๊ทธ๋ํฝ์ ์์ด๋ค์๊ฒ ํ๋ก๊ทธ๋๋ฐ์ ์๊ฐํ๋ ๋ฐ ๋๋ฆฌ ์ฌ์ฉ๋๋ ๋ฐฉ๋ฒ์ ๋๋ค. 1967๋ Wally Feurzeig, Seymour Papert ๋ฐ Cynthia Solomon์ด ๊ฐ๋ฐํ python.flowdas.com import turtle t = turtle.Turtle() t.speed("slowest") t.shape("turtle") t.turtlesize(2) t.color("green") t.pencolor("blue") t.screen.bgcolor("aqua") for..
[Js] ๋ฐฐ์ด ์์ฑ
interface ArrayConstructor { /** * Creates an array from an array-like object. * @param arrayLike An array-like object to convert to an array. */ from(arrayLike: ArrayLike): T[]; /** * Creates an array from an iterable object. * @param arrayLike An array-like object to convert to an array. * @param mapfn A mapping function to call on every element of the array. * @param thisArg Value of 'this' u..
Bind
this.x = 9; var module = { x: 81, getX: function() { return this.x; } }; module.getX(); // 81 var retrieveX = module.getX; retrieveX(); // 9 ๋ฐํ - ํจ์๊ฐ ์ ์ญ ์ค์ฝํ์์ ํธ์ถ๋์ // module๊ณผ ๋ฐ์ธ๋ฉ๋ 'this'๊ฐ ์๋ ์๋ก์ด ํจ์ ์์ฑ // ์ ์ ํ๋ก๊ทธ๋๋จธ๋ ์ ์ญ ๋ณ์ x์ // module์ ์์ฑ x๋ฅผ ํผ๋ํ ์ ์์ var boundGetX = retrieveX.bind(module); boundGetX(); // 81 this.name ='์๋'; let person1 = { name: '์๋ฌด๋ฌด' }; let person2 = { name: '๋ญ์ค', study: functio..
[opencv์ค์น] No module named 'cv2' ํด๊ฒฐ
line 1, in import cv2 ModuleNotFoundError: No module named 'cv2' ์๋ฌ๋ฅผ ๋ง๋๊ณ pip install opencv-python ๋ช ๋ น์ด๋ก ํด๊ฒฐ ์ ๋ ๋, https://bobbyhadz.com/blog/python-no-module-named-cv2 ModuleNotFoundError: No module named 'cv2' in Python | bobbyhadz The Python ModuleNotFoundError: No module named 'cv2' occurs when we forget to install the `opencv-python` module before importing it or install it in an incorrect e..
[conda] vscode base์์ ๊ฐ์ํ๊ฒฝ my_env๋ก ๊ฐ์ํ๊ธฐ
# To activate this environment, use # # $ conda activate my_env # # To deactivate an active environment, use # $ conda deactivate (base) PS C:\Users\User\gitprogect\pythooo\> conda create -n my_env python=3.8 Collecting package metadata (current_repodata.json): done Solving environment: done ## Package Plan ## environment location: C:\Users\User\anaconda3\envs\my_env added / updated specs: - pyt..