public class EntityA
{
    public EntityA()
    {
        EntityB.OnCallbackAction1 += OnCallbackListener1;
    }

    private void OnCallbackListener1(float data)
    {
        Debug.Log("OnCallbackListener1" + data.ToString());
    }
}

public class EntityB
{
    public static Action<float> OnCallbackAction1 = null;

    private void ActionHappned()
    {
        float data = 0.0f;
        OnCallbackAction1?.Invoke(data);
    }
}

'Programming > C#' 카테고리의 다른 글

현재시간(C#)  (0) 2023.09.05
Winform - // form 위에 form 설정  (0) 2022.07.13
기초 C#  (0) 2022.07.13
WPF에서 실행파일이 있는 경로  (0) 2022.07.13
WPF 중복 실행 방지  (0) 2021.12.02

// 현재시간
string sNow;
sNow = DateTime.Now.ToString("yyyy-MM-dd-HH-mm-ss-fff");

'Programming > C#' 카테고리의 다른 글

Action 사용하기  (0) 2023.09.27
Winform - // form 위에 form 설정  (0) 2022.07.13
기초 C#  (0) 2022.07.13
WPF에서 실행파일이 있는 경로  (0) 2022.07.13
WPF 중복 실행 방지  (0) 2021.12.02

빌보드(Billboard) - 3D 오브젝트가 카메라를 바라보는 기술

transform.LookAt

void Update()
{
transform.LookAt(Camera.current.transform);
}

import requests                # 
url = 'https://www.naver.com'
response = requests.get(url)   # 
print(response.status_code)    # 
html_text = response.text      # 

 

# selenium의 webdriver를 사용하기 위한 import
from selenium import webdriver

from selenium.webdriver.common.keys import Keys

# 크롬드라이버 실행  (경로 예: '/Users/admin/Downloads/chromedriver')
driver = webdriver.Chrome('chromedriver의 경로를 입력할 것') 

driver.get('https://www.google.co.kr')

time.sleep(3)

 

search = driver.find_element_by_xpath('//*[@id="google_search"]')

search.send_keys('파이썬')
time.sleep(1)

search.send_keys(Keys.ENTER)

 

from bs4 import BeautifulSoup as bs

html = bs(response.text, 'html.parser')

google_logo = html.find('img', {'id':'hplogo'})

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

numpy.clip(array, min, max)  (0) 2023.06.03
내장함수 eval  (0) 2023.04.08
내장함수 zip  (0) 2023.04.08
내장함수 enumerate  (0) 2023.04.08
pyinstaller 실행파일 만들기  (0) 2021.10.26

numpy.clip(array, min, max)

    array 내의 element들에 대해서

    min 값 보다 작은 값들을 min값으로 바꿔주고

    max 값 보다 큰 값들을 max값으로 바꿔주는 함수.

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

web 사용  (0) 2023.08.03
내장함수 eval  (0) 2023.04.08
내장함수 zip  (0) 2023.04.08
내장함수 enumerate  (0) 2023.04.08
pyinstaller 실행파일 만들기  (0) 2021.10.26

내장함수 eval

eval(expression[, globals[, locals]])

>> x = 1
>> eval('x+1')
2

docs.python.org

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

web 사용  (0) 2023.08.03
numpy.clip(array, min, max)  (0) 2023.06.03
내장함수 zip  (0) 2023.04.08
내장함수 enumerate  (0) 2023.04.08
pyinstaller 실행파일 만들기  (0) 2021.10.26

zip(*iterables)
각 iterables 의 요소들을 모으는 이터레이터를 만듭니다.

>>> x = [1, 2, 3]
>>> y = [4, 5, 6]
>>> zipped = zip(x, y)
>>> list(zipped)
[(1, 4), (2, 5), (3, 6)]

docs.python.org

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

web 사용  (0) 2023.08.03
numpy.clip(array, min, max)  (0) 2023.06.03
내장함수 eval  (0) 2023.04.08
내장함수 enumerate  (0) 2023.04.08
pyinstaller 실행파일 만들기  (0) 2021.10.26

내장함수 enumerate

enumerate(iterable, start=0)
- 열거 객체를 돌려줍니다
>> seasons = ['Spring', 'Summer', 'Fall', 'Winter']
>> list(enumerate(seasons))
[(0, 'Spring'), (1, 'Summer'), (2, 'Fall'), (3, 'Winter')]

>> list(enumerate(seasons, start=1))
[(1, 'Spring'), (2, 'Summer'), (3, 'Fall'), (4, 'Winter')]


docs.python.org

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

web 사용  (0) 2023.08.03
numpy.clip(array, min, max)  (0) 2023.06.03
내장함수 eval  (0) 2023.04.08
내장함수 zip  (0) 2023.04.08
pyinstaller 실행파일 만들기  (0) 2021.10.26

namespace WinFormsApp1
{
    public partial class Form1 : Form
    {
        Form2 child1 = new Form2();
        Form3 child2 = new Form3();

        private void Form1_Load(object sender, EventArgs e)
        {
            child1.TopLevel = false;
            child2.TopLevel = false;

            this.Controls.Add(child1);
            this.Controls.Add(child2);

            child1.Parent = this.panel1;
            child2.Parent = this.panel1;

            child1.Text = child2.Text = "";
            child1.ControlBox = child2.ControlBox = false;

 

            child1.FormEvent += EventMethod;
            child2.FormEvent += EventMethod;
        }

        private void button1_Click_1(object sender, EventArgs e)
        {
            child2.Hide();
            child1.Show();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            child1.Hide();
            child2.Show();
        }

        public void EventMethod(string str)
        {
            textBox1.Text = str.ToString();
        }
    }
}
////////////////////////////////////////////

public partial class Form2 : Form
{
        public delegate void SendDataHandler1(string message);
        public event SendDataHandler1 FormEvent;

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == string.Empty)
            {
                MessageBox.Show("text input !!");
                return;
            }
            this.FormEvent(textBox1.Text);
        }
}

'Programming > C#' 카테고리의 다른 글

Action 사용하기  (0) 2023.09.27
현재시간(C#)  (0) 2023.09.05
기초 C#  (0) 2022.07.13
WPF에서 실행파일이 있는 경로  (0) 2022.07.13
WPF 중복 실행 방지  (0) 2021.12.02

// convert
string str = "3";
int number = Convert.ToInt32(str);
int number1 = Int32.Parse(str);
int number2= int.Parse(str);

 

// array
string[,] array2D = new string[3, 5];

string[,,] Cubes;

int[][] a = new int[3][];
a[0] = new int[10];
a[1] = new int[5];
a[2] = new int[20];

 

 

// writeln

Console.WriteLine(@"c:\temp");
Console.WriteLine($"Sum of {t2.Count} elements is {t2.Sum}.");

 

 

'Programming > C#' 카테고리의 다른 글

Action 사용하기  (0) 2023.09.27
현재시간(C#)  (0) 2023.09.05
Winform - // form 위에 form 설정  (0) 2022.07.13
WPF에서 실행파일이 있는 경로  (0) 2022.07.13
WPF 중복 실행 방지  (0) 2021.12.02

+ Recent posts