반응형

메뉴얼과 함수는 아래 링크에 있는 Qt의 공식 홈페이지를 참조해주시기 바랍니다.

 

Qt for Python Documentation  https://doc.qt.io/qtforpython/index.html
Qt Designer Manual  https://doc.qt.io/qt-5/qtdesigner-manual.html

Qt for Python Documentation
Qt Designer Manual

 

Qt Style Sheets Reference

https://doc.qt.io/qt-5/stylesheet-reference.html

 

Qt Style Sheets Reference | Qt Widgets 5.15.14

 

doc.qt.io

Qt Style Sheets support various properties, pseudo-states, and subcontrols that make it possible to customize the look of widgets.

반응형
반응형

[python] 파이썬이 인기 있는 이유

 

첫째, 비전공자도 쉽게 배울 수 있다!(시작할 수 있다.)
일단 문법이 간단해서 배우기 쉽습니다.

C 언어 등의 프로그래밍 언어는 문법이 복잡해서
컴퓨터 공학을 공부하는 학생들도
어렵게 느끼는 경우가 많은데,

파이썬은 문법이 단순해서 배우기 쉬워요.
그래서 비전공자도 쉽게 배울 수 있지요.

 둘째, 다양한 분야에 활용할 수 있다!
컴퓨터에서 사용하는 앱부터
웹 서버, IoT, 인공지능 등
우리가 접할 수 있는 다양한 곳에서
활용할 수 있습니다.

셋째, 운영체제 대부분에서 동일하게 활용된다!
대부분의 프로그래밍 언어는 운영체제가 제한적입니다.
여러 운영체제에서 사용할 수 있어도
사용 방법이 조금씩 다른 경우가 있지요.
하지만 파이썬은 모든 운영체제에서
같은 방법으로 사용할 수 있습니다.

파이썬은 다음과 같은 상황에서 두루 사용을 고려해 볼 수 있어요. 

개발자로서, 
》 스타트업에서 웹 서비스 개발을 하고 싶은 경우
》 서비스에 활용할 인공지능을 개발하고 싶은 경우
》 데이터 수집 프로그램을 개발하고 싶은 경우

비개발자로서, 
》 엑셀 이상의 데이터 분석을 하고 싶은 경우
》 업무 자동화를 위한 간단한 프로그램을 만들고 싶은 경우
》 프로그래밍을 접해 보고 싶은 경우

이 중 마지막에 있는 ‘비개발자로서 프로그래밍을 접해 보고 싶은 분’들이 
빠르게 늘어나고 있는 것도 최근의 트렌드 입니다. 

 

https://www.elancer.co.kr/blog/view?seq=152 

 

파이썬 프로그램이 주목받는 이유와 파이썬의 활용성 알아보기! I 이랜서 블로그

티오베 인덱스에서 가장 인기 있는 언어 1위 파이썬! 개발자들에게 주목받는 이유와 활용성을 이랜서와 함께 알아보겠습니다. I 파이썬, 파이썬 다운로드. 파이썬 리스트, 파이썬 sort, 파이썬 크

www.elancer.co.kr

 

반응형
반응형

PyQt5 5.15.9

pip install PyQt5

https://pypi.org/project/PyQt5/

 

PyQt5

Python bindings for the Qt cross platform application toolkit

pypi.org

 Qt 는 최신 데스크톱 및 모바일 시스템의 여러 측면에 액세스하기 

PyQt5 - Comprehensive Python Bindings for Qt v5



위한 고급 API를 구현하는 교차 플랫폼 C++ 라이브러리 집합입니다 . 
여기에는 
위치 및 포지셔닝 서비스, 멀티미디어, NFC 및 Bluetooth 연결, 
Chromium 기반 웹 브라우저 및 기존 UI 개발이 포함됩니다. 

PyQt5는 Qt v5용 포괄적인 Python 바인딩 세트입니다. 35개 이상의 확장 모듈로 구현되며 Python을 iOS 및 Android를 포함한 모든 지원 플랫폼에서 C++에 대한 대체 애플리케이션 개발 언어 
로 사용할 수 있습니다 . PyQt5는 C++ 기반 애플리케이션에 내장되어 사용자가 해당 애플리케이션을 사용할 수 있도록 할 수도 있습니다.

 
해당 응용 프로그램의 기능을 구성하거나 향상시키는 응용 프로그램. 

반응형
반응형

달력 만들기 

import calendar

def smartphone_calendar():
    print("Welcome to the Smartphone Calendar!")
    
    while True:
        try:
            year = int(input("Enter the year (e.g., 2023): "))
            month = int(input("Enter the month (1-12): "))
            
            if 1 <= month <= 12:
                cal = calendar.TextCalendar(calendar.SUNDAY)
                month_calendar = cal.formatmonth(year, month)
                print("\n" + month_calendar)
            else:
                print("Invalid month. Please enter a value between 1 and 12.")
        
        except ValueError:
            print("Invalid input. Please enter valid numeric values for year and month.")
        
        choice = input("Do you want to view another calendar? (y/n): ")
        if choice.lower() != 'y':
            print("Thank you for using the Smartphone Calendar. Goodbye!")
            break

if __name__ == "__main__":
    smartphone_calendar()

반응형
반응형

https://wikidocs.net/14606

 

3.1 ndarray

### 개념과 생성 NumPy와 패키지의 핵심은 `ndarray` 객체이다. * `ndarray`는 fixed-size homogeneous multidimensional …

wikidocs.net

3.1 ndarray

개념과 생성

NumPy와 패키지의 핵심은 ndarray 객체이다.

  • ndarray는 fixed-size homogeneous multidimensional array 정도로 이해할 수 있으며, 기본적으로 vectorization과 broadcasting을 지원한다.
  • Python에서 제공하는 list, tuple 등의 시퀀스 자료형은 서로 다른 데이터타입을 저장할 수 있고(heterogeneous sequence), 크기가 자동으로 커질 수 있다. 반면에 ndarray는 성능향상을 위해 같은 데이터타입만을 요소로 가질 수 있고, 크기 역시 고정되어 있다. 만약 크기를 변경하면 새로 메모리에 할당되고 이전 값은 삭제된다.
# https://wikidocs.net/14606
import numpy as np

print("x는 float64를 요소타입으로 갖는 크기 3의 1차원 배열이다.")
x = np.array((0.1,0.2,0.3))
print(x)
print(x.shape)  # 차원 : 1자원 배열의 shape는 (m,)
print(x.dtype) # 요소 타입 : float64

print("y는 int32를 요소 타입으로 하는 (2,3) 크기의 2차원 배열이다.")
y = np.array(((1,2,3),(4,5,6)))
print(y)
print(y.shape)  # 차원 : 2자원 배열의 shape는 (m,n)  3차원은 (p,q,r)
print(y.dtype) # 요소 타입 : int32

print("생성시 입력된 값을 통해 dtype을 추천하는데, 강제로 지정하는 것은 다음과 같다.")
z = np.array([1,2,3],dtype='float64')
print(z)
print(z.shape)
print(z.dtype)

"""_summary_
ndarray의 중요 속성을 정리하면 다음과 같다.

shape : 배열의 형태
dtype : 요소의 데이터 타입, int32, float32 등등
ndim : 차원수. x.ndim = 1, y.ndim=2 등이며 len(x.shape) 와 동일
size : 요소의 개수. shape의 모든 값의 곱. x.size = 3, y.size=6 등
itemsize : 요소 데이터 타입의 크기(byte 단위), x.itemsize=8 등
data : 실제 데이터. 직접 사용자가 접근할 필요는 없음
"""

print("초기화 관련 편의함수")
Y = np.zeros((3,3))
print(Y)
Y = np.ones((3,3),dtype='int32')
Z = np.empty((3,3))

print("\n미리 크기지정없이 순차적으로 만들때, 크기 0인 배열을 생성하고 append()를 수행")
A = np.array([])
for i in range(3):
    A = np.append(A,[1,2,3])

print(A)

print("단순한 시퀀스는 range() 함수의 실수버전인 arange(from,to,step)이나 \nlinspace(from,to,npoints)를 사용하면 편리하다. \n또한 단위행렬을 위한 eye(n) 함수를 제공한다.")
print(np.arange(1,2,0.1))
#array([ 1. ,  1.1,  1.2,  1.3,  1.4,  1.5,  1.6,  1.7,  1.8,  1.9])
print(np.arange(10))   # start, step 생략가능. 정수로 생성
#array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
print(np.arange(10.))  # start, step 생략가능. 실수로 생성
#array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9.])
print(np.linspace(0.,20.,11))
#array([  0.,   2.,   4., ...,  16.,  18.,  20.])
print(np.eye(3))
#array([[ 1.,  0.,  0.],
#       [ 0.,  1.,  0.],
#       [ 0.,  0.,  1.]])

print("\n\nshape과 dtype 변경")
msg = "ndarray는 고정된 크기를 유지하면서 shape을 변경할 수 있다. 예를 들어 크기 9의 1차원 배열을 3*3 2차원 배열로 바꿀 수 있다. \n이때 사용하는 함수는 reshape() 인데 함수 또는 메쏘드 형태로 제공한다."
print(msg)

X = np.arange(0,9,1.)
print(X)
Y = np.reshape(X,(3,3)) # 또는 Y=X.reshape((3,3))
print(Y)

#만약 자기 자신을 대상을 변경하면 shape 속성을 강제로 변경하면 된다.
X.shape = (3,3)
print(X)

print("astype() 메쏘드를 사용하면 배열에서 dtype을 바꿀 수 있다.")

a = np.arange(3);
a.astype(int)  # a.astype('int34') 와 동일
a.astype('int34') 
a.astype('int64')
a.astype(float)    # a.astype('float64')
a.astype('float32')
a.astype('float64')
print(a)
반응형
반응형


error : Cannot interpret '<attribute 'dtype' of 'numpy.generic' objects>' as a data type 

 

    발생하면  pandas를 업그레이드 하라. 

 

pip install numpy --upgrade
pip install pandas --upgrade
반응형
반응형

pip install matplotlib

matplotlib 3.7.2

https://pypi.org/project/matplotlib/

 

matplotlib

Python plotting package

pypi.org

Matplotlib is a comprehensive library for creating static, animated, and interactive visualizations in Python.

Check out our home page for more information.

Matplotlib produces publication-quality figures in a variety of hardcopy formats and interactive environments across platforms. Matplotlib can be used in Python scripts, Python/IPython shells, web application servers, and various graphical user interface toolkits.

Install

See the install documentation, which is generated from /doc/users/installing/index.rst

Contribute

You've discovered a bug or something else you want to change - excellent!

You've worked out a way to fix it -- even better!

You want to tell us about it -- best of all!

Start at the contributing guide!

반응형
반응형

점프 투 파이썬

https://wikidocs.net/book/1

 

점프 투 파이썬

이 책은 파이썬이란 언어를 처음 접해보는 독자들과 프로그래밍을 한 번도 해 본적이 없는 사람들을 대상으로 한다. 프로그래밍을 할 때 사용되는 전문적인 용어들을 알기 쉽게 풀어서 …

wikidocs.net

반응형

+ Recent posts