반응형

 

아나콘다 다운로드 및 설치

 

가상환경 들어가서 pip update 필요하다. 

conda update pip

현재 (base) 환경에서 사용중인 파이썬 버전을 확인하려면 다음 명령을 실행합니다.

PIP는 Python Package Index (PyPI) 저장소로부터 패키지를 다운받아 설치 및 관리해주는 패키지 매니저 입니다. pip install [패키지 이름]의 형태로 패키지를 설치하면 됩니다.
Pip를 최신 버전으로 업그레이드 하려면 다음 명령을 실행합니다.
(base) PS D:\_py_project> python --version

(base) PS D:\_py_project> python -m pip install --upgrade pip

아나콘다 패키지 업데이트

(base) C:\Users\사용자계정>conda -–version

(base) C:\Users\사용자계정>conda update --all

 

pygame :  https://www.pygame.org/wiki/GettingStarted

 

GettingStarted - pygame wiki

Pygame Installation Pygame requires Python; if you don't already have it, you can download it from python.org. It's recommended to run the latest python version, because it's usually faster and has better features than the older ones. Bear in mind that pyg

www.pygame.org

 

아나콘다 설치 모르겠으면 기본 설치로~ https://docs.python.org/3/using/windows.html#installation-steps

 

4. Using Python on Windows

This document aims to give an overview of Windows-specific behaviour you should know about when using Python on Microsoft Windows. Unlike most Unix systems and services, Windows does not include a ...

docs.python.org

 

반응형
반응형

 

https://github.com/MauryaRitesh/Facial-Expression-Detection

 

GitHub - MauryaRitesh/Facial-Expression-Detection: Facial Expression or Facial Emotion Detector can be used to know whether a pe

Facial Expression or Facial Emotion Detector can be used to know whether a person is sad, happy, angry and so on only through his/her face. This Repository can be used to carry out such a task. - G...

github.com

Facial Expression or Facial Emotion Detector can be used to know whether a person is sad, happy, angry and so on only through his/her face. This Repository can be used to carry out such a task.

This is the code for this video by Ritesh on YouTube.

Facial Expression or Facial Emotion Detector can be used to know whether a person is sad, happy, angry and so on only through his/her face. This Repository can be used to carry out such a task. It uses your WebCamera and then identifies your expression in Real Time. Yeah in real-time!

PLAN
This is a three step process. In the first, we load the XML file for detecting the presence of faces and then we retrain our network with our image on five diffrent categories. After that, we import the label_image.py program from the last video and set up everything in realtime.

반응형
반응형

Python Dictionary Methods

 https://www.instagram.com/p/CrKgbEGrrX_/?igshid=MDJmNzVkMjY%3D 

Clear()

Copy()

Get()

Items()

Keys()

Popitem()

Values()

Pop()

Update()

Setdefault()

 

 

Method Description

clear() Removes all the elements from the dictionary
copy() Returns a copy of the dictionary
fromkeys() Returns a dictionary with the specified keys and value
get() Returns the value of the specified key
items() Returns a list containing a tuple for each key value pair
keys() Returns a list containing the dictionary's keys
pop() Removes the element with the specified key
popitem() Removes the last inserted key-value pair
setdefault() Returns the value of the specified key. If the key does not exist: insert the key, with the specified value
update() Updates the dictionary with the specified key-value pairs
values() Returns a list of all the values in the dictionary

https://www.w3schools.com/python/python_ref_dictionary.asp

 

Python Dictionary Methods

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

www.w3schools.com

https://www.w3schools.com/python/python_dictionaries.asp

 

Python Dictionaries

W3Schools offers free online tutorials, references and exercises in all the major languages of the web. Covering popular subjects like HTML, CSS, JavaScript, Python, SQL, Java, and many, many more.

www.w3schools.com

반응형
반응형

[python]  swapping variables, Flattening a list of lists

# Swapping variables without a temporary variable

a = 10
b = 20
a,b = b,a

print(a)

# Flattening a list of lists

lst = [[1,2,3],[4,5],[6,7,8,9]]

flattened = [num for sublist in lst 
             for num in sublist]

print(flattened)
반응형
반응형

Python Script to Shutdown Computer

 

컴퓨터를 종료하는 Python 스크립트

Python은 다양한 기능으로 인해 널리 사용되는 스크립팅 언어입니다. 이 기사에서는 컴퓨터를 종료하는 Python 스크립트를 작성합니다. Python 스크립트를 사용하여 컴퓨터/PC/노트북을 종료하려면 “ ” 코드가 있는 기능을
사용해야 합니다 

 

import os
  
shutdown = input("Do you wish to shutdown your computer ? (yes / no): ")
  
if shutdown == 'no':
    exit()
else:
    os.system("shutdown /s /t 1")

 

반응형
반응형

https://codecrazypy.blogspot.com/2023/03/python-mcqs-quiz-1.html

 

Python MCQ's Quiz-1

Here you can find some infomation about exams,educational events and how to prepare for competitive exams likes ssc gd, railway exams,

codecrazypy.blogspot.com

What will be the datatype of the var in the below code snippet?
var = 10
print(type(var))
var = "Hello"
print(type(var))

반응형
반응형

[python] 구문 퀴즈, 파이썬

""" 
# What will be the output?
    A.Infinite loop
    B.120
    C.47
    D.48
"""
import secrets


def rec(a,b):
    if a == 0:
        return b
    else:
        return rec(a - 1, a + b)

print(rec(8, 12))

# 48 


s1 = [92,57,[82,75]]
s2 = s1[:]
s2[2][1] = 23
print(s1)

# 클래스 
result = 0

def add(num):
    global result
    result += num
    return result

print(add(3))
print(add(4))


"""
    # what will be the output?
    A.@corporate
    B.qna
    C.corporate
    D.@qna
"""
s = ['@corporate','qna']
print(s[:-1][-1])
반응형
반응형

[python] 구문 퀴즈, 파이썬

""" 
# What will be the output?
    A.Infinite loop
    B.120
    C.47
    D.48
"""
def rec(a,b):
    if a == 0:
        return b
    else:
        return rec(a - 1, a + b)

print(rec(8, 12))

# 48

 

반응형

+ Recent posts