프로그래밍/Python

프로그래밍/Python

[PYTHON] 모듈 예제, 모듈 불러오기- 파이썬

[PYTHON] 모듈 예제, 모듈 불러오기- 파이썬 mod1.py를 생성하고 다른 파일에서 모듈을 호출한다. https://github.com/ngio/python_study/blob/main/module_py.py GitHub - ngio/python_study: python, konply, numpy, matplotlib, networkx, pandas python, konply, numpy, matplotlib, networkx, pandas - GitHub - ngio/python_study: python, konply, numpy, matplotlib, networkx, pandas github.com import mod1 print(" module name is ", mod1.__name__)..

프로그래밍/Python

[python] 파이썬 모듈 예제

https://wikidocs.net/7040 241 ~ 250 .answer {margin-top: 10px;margin-bottom: 50px;padding-top: 10px;border-top: 3px solid LightGray;bo… wikidocs.net 248 os 모듈 os 모듈의 getcwd 함수를 호출하여 현재 디렉터리의 경로를 화면에 출력해보세요. 정답확인 import os ret = os.getcwd() print(ret, type(ret)) 249 rename 함수 바탕화면에 텍스트 파일을 하나 생성한 후 os 모듈의 rename 함수를 호출하여 해당 파일의 이름을 변경해보세요. 정답확인 import os os.rename("C:/Users/hyunh/Desktop/before.t..

프로그래밍/Python

파이썬 제어문 python control-flow

파이썬 제어문 python control-flow """ Python Control-Flow if if - else for while break continue """ print("----- if, if - else") a = 33 b = 200 if b > a: print("b is greater than a") elif a == b: print("a and b equal") print("----- for") fruits = [ "apple", "banana", "cherry"] for x in fruits: print(x) print("----- while, break") i = 1 while i < 6: print(i) if( i == 3 ): break i += 1 print("----- cont..

프로그래밍/Python

[python] google.colab 가져오기 파일에서 Jupyterlab에서 파일의 동일한 동작을 얻는 방법

google.colab 가져오기 파일에서 Jupyterlab에서 파일의 동일한 동작을 얻는 방법 현재 colab에서 잘 돌아가는 프로젝트를 진행하고 있는데 로컬 jupyterlab에서 수정하고 실행하고 싶지만 해당 프로젝트에는 colab과 같은 특정 기능이 있고 이런 방식으로 가져온 files기능 이 output있습니다 .from google.colab import filesfrom google.colab import output pypi에서 찾았으니 기본적 으로 모듈을 로컬에 설치한 pip install google-colab다음 노트북에서 사용할 수 있습니다. https://stackoverflow.com/questions/64103409/from-google-colab-import-files-how..

프로그래밍/Python

[python] Text2Art - https://text2art.com/

Text2Art AI Powered Text-to-Art Generator Try It Out » View Notebook · Read Article · Report Bug · Request Feature https://colab.research.google.com/github/mfrashad/text2art/blob/main/text2art.ipynb Copy of Text2Art Run, share, and edit Python notebooks colab.research.google.com https://github.com/mfrashad/text2art GitHub - mfrashad/text2art: AI-powered Text-to-Art Generator - Text2Art.com AI-po..

프로그래밍/Python

[python] What will be the output?

https://github.com/ngio/python_study/blob/main/true_false_quiz.py GitHub - ngio/python_study: python, konply, numpy, matplotlib, networkx, pandas python, konply, numpy, matplotlib, networkx, pandas - GitHub - ngio/python_study: python, konply, numpy, matplotlib, networkx, pandas github.com What will be the output? A.True B.False C.Error D.None of above """_summary_ What will be the output? A.Tru..

프로그래밍/Python

conda에서 파이썬 가상 환경 (virtual environments) 생성하기

가상환경(virtualenv)은 여러 개의 파이썬 프로젝트가 하나의 컴퓨터에서 충동을 일으키지 않고 존재할 수 있도록 해줍니다. virtualenv는 각 프로그램별로 완전히 독립적인 가상의 환경을 만들어서 각 프로그램별로 라이브러리 모듈등의 버전을 별도로 지정할 수 있게 합니다. 즉 한 컴퓨터에 여러 개발환경을 서로 독립적으로 설치, 실행할 수 있게 해줍니다. 왜 가상 환경을 만들어서 작업을 진행할까? 한마디로 요약하자면 "독립적인 작업환경에서 작업할 수 있다." 로 말할 수 있습니다. 프로젝트를 진행하다보면 여러 라이브러리, 패키지를 다운로드하여서 사용하게 됩니다. 그러다 보면 각 라이브러리들끼리 충돌을 일으키는 문제를 발생시키는 경우가 있습니다. 또는, 특정 버전과 호환하는 경우가 생겨서 최신 버전과..

프로그래밍/Python

[PYTHON] Gradio 웹앱 만들기

[PYTHON] Gradio 웹앱 만들기 Build & share delightful machine learning apps easily Gradio https://gradio.app/ https://github.com/gradio-app/gradio """_summary_ # Gradio https://gradio.app/ https://github.com/gradio-app/gradio Returns: _type_: _description_ """ import gradio as gr def greet(name): return "Hello " + name + " !" demo = gr.Interface(fn=greet, inputs="text", outputs="text") if __name__ == ..

홍반장水_
'프로그래밍/Python' 카테고리의 글 목록