ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[­ì³Ð] python¤W¥«Âd¤T¤jªk¤H¶R½æ¶W¤é³ø¸ê®Æ¤U¸ü

¦^´_ 110# c_c_lai

c¤j¡A¥u­n¯à¹F¨ì¥Øªº§Y¬O¦n¤èªk¡A¨ä¥¦¬ÛÃö¥N½X¥u¬O¨C­Ó¤H¤è¦¡¤£¦P
zyzzyva¤j & lpk187¤j ¬°µeªíÂà¥X CSV  ³o¤è¦¡«Ü¦n¡A¹ï©ó¥ÎEXCELªí®æ¨Ó»¡¬O¤@¤j¦n¨Æ
¦óªp c¤j¦bvba¤¤®¼¬¡ÅDªº^^
vba§Ú¤]¬O¬ÝµÛ§A­Ìªº¤å³¹ºCºC¾Çªº~

¥»¨Ó¤]¬O·Q§â´£¨úªºÀÉ®×Âà¦scsv
¦ý¬Ý¨ìcsv to sql¦³³\¦hÂà½X°ÝÃD¡A¬G¤~ª½±µ±qpython¶×¤Jsql

¬Ý¨ì¤¶²Ð SQL¦n¹³¥i¥H¦hªíÁp¦X¬d¸ßÅã¥Ü¤§Ãþ¡A¤~¥h¸Iªº(­è¸I¡A¥Ø«e¥u·|Python¶×¤Jsql¡Asql ¶×¥X¦ÜEXCEL)
¤£¦PÀɮצhªíÁp¦X¬d¸ß  EXCEL À³¸Ó¤]¥i¥H§a¡H   ¨S¸Õ¹L¡AÀ³¸Ó­n¥Îvba??

½Ð±Ð°Ý¤@¤Usql¥i¥H©Ô¸ê®Æ¦ÜEXCEL¡A¦A¥ÎEXCELµe¹Ï
¹ï©óvbaµe¹Ï³o¶ô¡A¤§«á¥i¯à­n½Ðc¤j«üÂI¤F@@
ÁöµMpython¤]¥i¥Hµe¹Ï¡A¦ý¾ã¦X©Ê¤£ª¾¹D¦³¨S¦³®t¡AÁÙ¨S¬ã¨s¹L¡A©Ò¥HÁÙ¬O¥ý¿ï³Ì¤F¸ÑªºEXCEL¨Ó¾ã¦X

TOP

¦^´_ 109# lpk187
import io

¤p§Ìªº®M¥ó¿ù»~¡AµLªk°õ¦æ¡A¦Ó¥B¥Î conda install io ¸Ë¤£°_¨Ó¡A¤Ó¯«©_¤F
¤U¯Z«á¦A¨Ó¸Õ pip install io or easy install io ¸Õ¸Õ

TOP

¦^´_ 108# koshi0413
­ì¥»¤]¦³¦Ò¼{¨Ï¥Î for ¨Ó³B­ù¡A¦ý°ÝÃD¥X¦b print() °õ¦æ§¹«á³£·|°e¥X Feed¡C
for ta in soup.select('tr')[3:]:
    for ct in [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]:
        print ta.select("td")[ct].text
¦ýµ²ªG¬°¡G

TOP

¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-9-13 09:31 ½s¿è

¦^´_ 111# koshi0413
¤@¯ëÀ³¥Î­±¨Ó»¡¡A sql ¸ê®Æ¬O¥i¥Hª½±µ©Ô¸ê®Æ¦Ü EXCEL ªº¡A¦A¥Î EXCEL ¨Óµe»s²Î­p¹Ïªí¡C
¦³¨Ç¤H·|±N¨C¤é¨C¤À¡B¬Æ¦Ü¨C¬íªºªÑ¥«¬ö¿ý¦s¤J¦Ü¸ê®Æ®w (DataBase) ¡A
¦p MS SQL¡B Access¡B MySQL¡B Oracle"¡B PostgreSQL µ¥¡C
µM«á¦A¥h¿z¿ï³B²z¡AµL½×§A¬O¨Ï¥Î¦óºØµ{¦¡»y¨¥¤u¨ã¡C
³o¤è­±§A¥i¥H¦V ­ã´£³¡ªL¡BGBKEE¡BHsieh ¡B ... µ¥¦h¦ìª©¥D«e½ú½Ð¯qªº¡C

TOP

¥»©«³Ì«á¥Ñ koshi0413 ©ó 2016-9-13 09:36 ½s¿è

¦^´_ 113# c_c_lai


©Ò¥H¤p§Ì©ñ±ó³oºØ¼gªk¡A¥ý¥Î¤âºCºCkey¡AÁöµM«Üªü§b¡ã«¢«¢
­n¸Ñªººô­¶¤Ó¦h¤F¡A©Ò¥H¸Ñ±¼¤@­Ó°¨¤W¸Ñ¤U¤@­Ó
µ¥§â©Ò»Ýºô­¶¥þ¸Ñ§¹«á¦b¥þ¥[¤J®É¶¡°j°é+­ÓªÑ¥N¸¹°j°é¤U¥h¶]
µe¹Ï¬O¦b¤U¤@¨B¡A¨ì®É¦b¨Ó¬ã¨s~

TOP

¦^´_ 108# koshi0413
pythonªº»yªk¬O¡G¡ufor i in range(15):¡v¡A¥[¤W´«¦æ¸ò¹ï»ô¡A±z³o¬q¥N½X¥i¥H²¤¬°­×§ï¦¨
  1. for ta in soup.select('tr')[3:10]:
  2.     for i in range(15):
  3.         print(ta.select("td")[i].text, end='\t')
  4.     print('\n')
½Æ»s¥N½X

TOP

¦^´_  koshi0413
pythonªº»yªk¬O¡G¡ufor i in range(15):¡v¡A¥[¤W´«¦æ¸ò¹ï»ô¡A±z³o¬q¥N½X¥i¥H²¤¬°­×§ï¦¨
zyzzyva µoªí©ó 2016-9-13 09:50

§Ñ¤F±zªº¬O2.xª©ªº¡A¼Æ¦r¤pªº¸Ü¨S¤°»ò®t§O¡A¼Æ¦r¤jªº¸Ürange­n§ï¦¨xrange

TOP

¦^´_ 116# zyzzyva
­ì¨Ó¥i¥H¨Ï¥Î end='\t' ¤Î print('\n')
Åã¥Üµe­±¤]¾ã»ô¬üÆ[¡AÁÂÁ«ü±Ð¡I

TOP

¦^´_ 116# zyzzyva
½Ð±Ð¡A ¦pªG·Q§Q¥Î¦¹¶×¤J¸ê®Æ±N¥¦¦P®Éø»s¦¨²Î­p¹Ïªí
­n¦p¦ó°µ¡H

TOP

¦^´_ 119# c_c_lai
¤@¯ëµe¹Ï³£¬O¥Îmatplotlib¡A¦bipythonªº¸Ü¥u­n¥Î¡u%pylab in¡v¡A¤§«á´N¥i¥Hª½±µplot(x,y)¡C
test = range(50)
plot(temp)
´Nµe¥X¤@±øª½½u¡C
µe¹Ï¨ä¹ê§Ú¤]¤£¼ô¡A¥i¥H¤@°_¬ã¨s¤@¤U¡C
³o­Óºô­¶ªº¸ê®Æº¡¦hªº¡A¤£ª¾¹D±z¬O·Qµe¤°»ò¼Ëªº¹Ïªí¡H

TOP

        ÀR«ä¦Û¦b : ¤H­nª¾ºÖ¡B±¤ºÖ¡B¦A³yºÖ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD