OnlyFive 发表于 2019-9-15 17:52:16

虽然中秋已过,仍是过来蹭经验

Chris2019 发表于 2019-9-15 19:05:19

中秋节快乐

ykn大神6 发表于 2019-9-15 19:58:45

这都是啥

雨冷青杉 发表于 2019-9-15 21:10:44

Python不是注重美观的吗

zltzlt 发表于 2019-9-15 21:11:20

雨冷青杉 发表于 2019-9-15 21:10
Python不是注重美观的吗

这是活动

雨冷青杉 发表于 2019-9-15 22:06:26

zltzlt 发表于 2019-9-15 21:11
这是活动

懂了

晓屁屁 发表于 2019-9-18 11:27:23

中秋快乐

Jery_wang09 发表于 2019-9-18 16:00:11

再看一遍视频,还没看完

黑色光亮 发表于 2019-9-18 19:23:06

中秋快乐

cxyxzq 发表于 2019-9-19 17:07:21

先占楼

cxyxzq 发表于 2019-9-19 17:39:33


from                  tkinter                                 import *
from    SQLserver   import *
from    student_surface             import *
from   log_in               import *
def
                                                            test                                                                                                    (                                     ):
   
    def

   log                                                                                                    (                                     ):
      


      a                                                      =                                                                                                    Tk                                                                                                                                    (                                    

            )
      msg                                    =                                                                                                SQLserver                                                                                                                                                                     (                                       
            server                               =                                                               "a"
                                                                                       ,                                                               user                               =                                                               "b"
                                           ,                                                               password                               =                                                               "c"                               ,                                                               
                                                                                                                            database                               =                                                               "test05")
      sql2                                                                           =                                                               '                                    select      *   * from syuser'



      result                                                               =                                                                              msg                               .                                                                                 ExecQuery                                                                                                                   (                                                       sql
            )

      d                                  =                                                                                                                            0

      for             row             in                                    result                                                                               :
            if                                                                                                    (                                    
                e1                               .                                                                                                          get                                                                                                                           (                                    
                  )                                          =                                                                                                =                                                                                                                                  row[
                0
                ]                               .                                                               rstrip                                                                                                                        (                                    

                  )
                ):
                cipher                                 =                                                               
                row[                                                3                                             ]                               .                                                               rstrip                                                                                                       (                                       
                  )
                c                                                                                  =                                                                     row[
                                                                                                                  4
                ]


                d                                 =                                                                                                                               1
               

                break
            elif                                                                                                                                                                              (                                    
                            row[         1          ]                               .                                                                               rstrip                                                                                                                                                      (                                    
                  )                                                      =                                                                                                =                                                                                                   e1                               .                                                                              get                                                                                                                        (                                    
                              )
                ):
                                                      cipher                                                                           =                                                               row[
                3

                ]                               .                                                               
                                                                            rstrip                                                                                                    (                                                               
                  )
                c                                 =                                                                     row                                             [   
                           4
                ]
                d                              =                                                               
                1

                                                      break
                elif                                                                                                    (                                    
                  row[
                  2
                  ]                               .                                                               
                  rstrip                                                                                                    (                                    
                        )                               =                                                                                                =                                                               
                  e1                               .                                                                  get                                                                                                    (                                    
                        )
                  ):
                cipher                              =                                                               row [
                3
                ]                               .                                                                     rstrip                                                                                                    (                                    
                  )
                c                              =                                                                  row[
                4
                ]
                d
                                             =                                                               
                1
                break
      if
         d
                                        =                                                                                                =                                                               
         0:
      Label                                                                                                                   (                                    
      a
                                       ,                                                               
      text                               =                                                               
      'E          R   R O R                                 ! '
      )
                                       .                                                               
      pack                                                                                                                              (                                    
      )
      Button                                                                                                      (                                    
      a
                                       ,                                                               
      text                               =                                                               ' O K '
                                       ,                                                               
      width                               =                                                               
      10
                                       ,                                                               
      command                               =                                                               
      a                                          .                                                                                    destroy
      )                               .                                                               pack                                                                                                    (                                    
      )
      e2                               .                                                                      delete                                                                                                    (                                    
      0                               ,                                                               len                                                                                                    (                                    
            e2                               .                                                               get                                                                                                    (                                    
                )
            )
      )
      
      elif
      d                               =                                                                                                =                                                               1:
            if
            cipher!                               =                                                               e2                               .                                                               get                                                                                                    (                                     ):
                Label                                                                                                    (                                     a                               ,                                                               text                               =                                                               'E R      R         O                                             R!')                               .                                                               pack                                                                                                    (                                     )
                Button                                                                                                    (                                     a                               ,                                                               text                               =                                                               'O                              K'                               ,                                                               width                               =                                                               10                               ,                                                               command                               =                                                               a                               .                                                               destroy)                               .                                                               pack                                                                                                    (                                     )
                e2                               .                                                               delete                                                                                                    (                                     0                               ,                                                               len                                                                                                    (                                     e2                               .                                                               get                                                                                                    (                                     )))
            else:

                Label                                                                                                    (                                     a                               ,                                                               text                               =                                                               's u c c e s                                          s!')                               .                                                               pack                                                                                                    (                                     )
                Button                                                                                                    (                                     a                               ,                                                               text                               =                                                               'ok'                               ,                                                               width                               =                                                               10                               ,                                                               command                               =                                                               a                               .                                                               destroy)                               .                                                               pack                                                                                                    (                                     )
                if
                c                               =                                                                                                =                                                               1:
                  
                  sql2                               =                                                               's e       l   e c t s n a m e f ro m s t u d e n t w h e r e s n o                              =                                                               %s'%e1                               .                                                               get                                                                                                    (                                     )
                  

                  result2                               =                                                               msg                               .                                                               ExecQuery                                                                                                    (                                     sql2)
                  


                  for
                  

                  row2
                  


                  in
                  


                  result2:
                        


                        sname                               =                                                               row2



                  surface                                                                                                    (                                     e1                               .                                                               get                                                                                                    (                                     )                               ,                                                               sname)
                  
                root                               .                                                               destroy                                                                                                    (                                     )
      a                               .                                                               mainloop                                                                                                    (                                     )
   
   
   
    root                               =                                                               Tk                                                                                                    (                                     )
   
    root                               .                                                               iconbitmap                                                                                                    (                                     '                               .                                                               //ganda                               .                                                               ico')
   

    root                               .                                                               title                                                                                                    (                                     'system')
   

    v1                               =                                                               StringVar                                                                                                    (                                     )
   
    v2                               =                                                               StringVar                                                                                                    (                                     )

   
    Label                                                                                                    (                                     root                               ,                                                               text                               =                                                               'id:')                               .                                                               grid                                                                                                    (                                     row                               =                                                               0                               ,                                                               column                               =                                                               0)
   



    Label                                                                                                    (                                     root                               ,                                                               text                               =                                                               'password:')                               .                                                               grid                                                                                                    (                                     row                               =                                                               1                               ,                                                               column                               =                                                               0)

    e1                               =                                                               Entry                                                                                                    (                                     root                               ,                                                               textvariable                               =                                                               v1)
   


    e2                               =                                                               Entry                                                                                                    (                                     root                               ,                                                               textvariable                               =                                                               v2                               ,                                                               show                               =                                                               '*')

    e1                               .                                                               grid                                                                                                    (                                     row                               =                                                               0                               ,                                                               column                               =                                                               1                               ,                                                               padx                               =                                                               10                               ,                                                               pady                               =                                                               5)
   


    e2                               .                                                               grid                                                                                                    (                                     row                               =                                                               1                               ,                                                               column                               =                                                               1                               ,                                                               padx                               =                                                               10                               ,                                                               pady                               =                                                               5)

    Button                                                                                                    (                                     root                               ,                                                               text                               =                                                               'login'                               ,                                                               width                               =                                                               10                               ,                                                               command                               =                                                               log)                               .                                                               grid                                                                                                    (                                     row                               =                                                               3                               ,                                                               column                               =                                                               0                               ,                                                               sticky                               =                                                               W                               ,                                                               padx                               =                                                               10                               ,                                                               pady                               =                                                               5)
   


    Button                                                                                                    (                                    
      
      root                               ,                                                               text                               =                                                               'out'                               ,                                                               width                               =                                                               10                               ,                                                               command                               =                                                               root                               .                                                               destroy)                               .                                                               grid                                                                                                    (                                     row                               =                                                               3                               ,                                                               column                               =                                                               1                               ,                                                               sticky                               =                                                               E                               ,                                                               padx                               =                                                               10                               ,                                                               pady                               =                                                               5)
   

    root                                       .                                                                                                      mainloop                                                                                                    (                                    

      )



if
__name__                                                                                          =                                                                                                =                                                               
"__m                           a                              i                               n __":
      test                                                                                                    (                                                                                                    )

Y0uWill_1Will 发表于 2019-9-20 16:54:04

中秋快乐

科技爱好者 发表于 2019-9-20 17:49:24

中秋快乐。

优酸鹿 发表于 2019-9-21 18:39:56

还没到这个程度。。。

2369520493 发表于 2019-9-23 15:24:34

中秋快乐

python小笨蛋 发表于 2019-9-23 20:01:53

完全看不懂,需要加倍学习!!国庆节快乐!!

AmosAlbert 发表于 2019-9-23 20:05:43

中秋failed

284115671 发表于 2019-9-23 22:52:37

这个有点难搞

二十五岁青春 发表于 2019-9-24 08:50:14

这样还能成功执行吗

二十五岁青春 发表于 2019-9-24 08:52:22

    A? //每个字母表示一个表达式
    (
      B
    ):
    (
      C?
      (
            D
      ):
      ()
    )
页: 1 2 [3] 4
查看完整版本: 庆中秋之 Python 乱码大赛