| ¹èÄ¡ À¥ »çÀÌÆ®ÀÇ ÆäÀÌ¡ µð½ºÇ÷¹ÀÌ¿Í °°Àº ÀÏ°ý 󸮷Π½½¶óÀ̽º °¡´ÉÇÑ °´Ã¼¸¦ ÀÚ¸¨´Ï´Ù. |
Áö±Ý ´Ù¿î·Îµå |
¹èÄ¡ ¼øÀ§ ¹× ¿ä¾à
- °Ô½ÃÀÚ À¥»çÀÌÆ®:
- http://pesto.redgecko.org/
¹èÄ¡ ű×
¹èÄ¡ ¼³¸í
À¥ »çÀÌÆ®ÀÇ ÆäÀÌ¡ µð½ºÇ÷¹ÀÌ¿Í °°Àº ÀÏ°ý 󸮷Π½½¶óÀ̽º °¡´ÉÇÑ °´Ã¼¸¦ ÀÚ¸£½Ê½Ã¿À. Batcher´Â ¸ðµç ½½¶óÀ̼ °´Ã¼¸¦ ¹èÄ¡·Î ¹èÄ¡ÇÏ´Â ¸ðµâÀÔ´Ï´Ù. >>> Batcher °¡Á® ¿À±â Batcher >>> Ç׸ñ = ¸ñ·Ï ( 'abcdefghij') >>> Batcher = Batcher (Ç׸ñ, 4) >>> # »ç¿ë °¡´É ~À» ÀÚ¶õ >>> Len (Batcher) 3 >>> # ù ¹ø° ¹èÄ¡ÀÇ ³»¿ë °¡Á® ¿À±â >>> ¸ñ·Ï (Batcher ) >>> Batch >>> Batcher .previous >>> Batcher .next >>> Batcher . nonea °øÅë ¿ä±¸ »çÇ× À¥ ÀÀ¿ë ÇÁ·Î±×·¥¿¡¼ È£Ãâ±â À§Á¬À» ±¸ÇöÇÏ´Â °ÍÀÔ´Ï´Ù. ¹üÀ§ ¸Þ¼Òµå´Â »ç¿ëÀÚ°¡ ÆäÀÌÁö ** n **¸¦º¸°í ** n ** Áß¾Ó¿¡ÀÖ´Â ÆäÀÌÁö ¹üÀ§¸¦ Ç¥½ÃÇÏ°í, ¿£µå Æ÷ÀÎÆ®¸¦ Á¶Á¤ÇÏ¿© ¹üÀ§¸¦ À¯ÁöÇϱâ À§ÇØ ³¡Á¡À» Á¶Á¤ÇÏ·Á°íÇÕ´Ï´Ù. >>> Ç׸ñ = ¹üÀ§ (100) >>> Batcher = Batcher (Ç׸ñ, 4) >>> Len (Batcher) 25 >>> # ÁÖ¾îÁø ¹èÄ¡¿¡ Áß½ÉÀÌÀÖ´Â 5 ¹èÄ¡ ¹üÀ§ >>> Batcher .range (5) >>> Batcher .range (5) >>> Batcher .range (5) Àüü ¹èÄ¡°¡ ÃæºÐÇÏÁö ¾ÊÀº °æ¿ì Àüü ¹èÄ¡°¡ ¹ÝȯµË´Ï´Ù :: >>> Ç׸ñ = ¹üÀ§ (10) >>> Batcher = Batcher (Ç׸ñ, 4) >>> Len (Batcher) 3 >>> Batcher .range (5) , ¹èÄ¡ ¶§¹®¿¡ ÆÄÀ̽ãÀÇ ½½¶óÀÌ½Ì API¸¦ »ç¿ëÇÏ¿© µ¥ÀÌÅ͸¦ °Ë»öÇÏ·Á¸é ½½¶óÀ̽º °´Ã¼¸¦ ½É¹®ÇÏ¿© ¹èÄ¡ÀÇ Ã¹ ¹ø° ¹× ¸¶Áö¸· Ç׸ñÀÇ À妽º¸¦ ã¾Æ "ÆäÀÌÁö 1 (Ç׸ñ 1-10)"¿Í °°Àº µ¥ÀÌÅ͸¦ º¸¿©ÁÖ´Â µ¥ À¯¿ëÇÕ´Ï´Ù. :: >>> Ç׸ñ = ¹üÀ§ (25) >>> Batcher = Batcher (Ç׸ñ, 10) >>> Batch = Batcher >>> Batch.Slice ½½¶óÀ̽º (0, 10, ¾øÀ½) >>> "ÆäÀÌÁö % D (Ç׸ñ % D-% d) "% (batch.index + 1, batch.slice.start + 1, batch.slice.stop) 'p ³ªÀÌ 1 (Ç׸ñ 1-10) 'PythonÀÇ ½½¶óÀ̽º Àǹ̷ÐÀº À妽º°¡ 0À¸·Î ±â¹ÝÀ¸·ÎÇÏ´Â ¹æ¹ýÀ» ÀǹÌÇÕ´Ï´Ù (±×·¡¼ µð½ºÇ÷¹À̸¦ Çü½ÄÈ ÇÒ ¶§ 1À» Ãß°¡)°ú ½Ã¸®Áî ³¡ ÈÄ¿¡ ½½¶óÀ̽ºÀÇ Á¤Áö »öÀÎÀÌ Ç׸ñÀ» °¡¸®Å°´Â °ÍÀÔ´Ï´Ù. ...¿¡ ¿ä±¸ »çÇ× : ¡¤ ÆÄÀ̽ã
¹èÄ¡ °ü·Ã ¼ÒÇÁÆ®¿þ¾î