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

+ Recent posts