mon image

Moret Python mar 2019

Yves Guidet (yves.guidet@gmail.com)

21/03/2019

Bienvenue

Le plan

Mes transparents.

Les corrigés sont .

La formation précédente est ici.

En ce mercredi j'ai ajouté un slide, il est ici.

On pourra voir aussi ce script. Attention, c'est du Python3, les raw_input devront devenir des input.

Pour ce jeudi :

IHM, réseau et SGBD

Pour TkInter il y a un exemple dans les corrigés.

Pour le réseau, le module ssh, et l'exemple donné sur ce site

En complément de csv, un exemple d'utilisation de xslxwriter :

  import xlsxwriter
  
  workbook = xlsxwriter.Workbook('hello.xlsx')
  worksheet = workbook.add_worksheet()
  
  worksheet.write('A1', 'Hello world')
  
  workbook.close()
  

Le code peut être chargé ici. Attention ce module n'est pas standard et doit être installé.

Pour sql on ira voir ici.

modules scientifiques

Un mot sur Anaconda.

Comment dessiner un cercle en Python3 ?

  import numpy as np
  import matplotlib.pyplot as plt
  
  # theta goes from 0 to 2pi
  
  theta = np.linspace(0, 2*np.pi, 100)# the radius of the circle
  
  x = input("please input a size of the circle:")
  r = np.sqrt (int(x))
  
  # compute x1 and x2
  x1 = r*np.cos(theta)
  x2 = r*np.sin(theta)
  
  # create the figure
  fig, ax = plt.subplots(1)
  ax.plot(x1, x2)
  ax.set_aspect(1)
  plt.show()
  



Retour à la page d'accueil

© Yves Guidet jeudi 9 juillet 2020, 09:48:17 (UTC+0200) (bella ubuntu, site printemps) yves.guidet@gmail.com