Skip to content

Instantly share code, notes, and snippets.

@FaustinM
Created May 27, 2020 08:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FaustinM/4482c88d4e300262e635faaff46173ce to your computer and use it in GitHub Desktop.
Save FaustinM/4482c88d4e300262e635faaff46173ce to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import csv
print ("Pour utiliser le programme 1(avoir toutes les informations sur un atome en écrivant son nom) tapez <1>. Si vous souhaitez connaitre tous les éléments qui composent une famille d'atome tapez <2>")
x=int(input('Quel programme souhaitez vous utiliser? '))
if x==1 :
tableau=open("/home/project/Python/elements-data3.csv","r")
reader = csv.reader(tableau, delimiter=";")
recherche = input("Quel est le nom de l'atome recherché? ")
for row in reader:
if recherche in row[1]:
print(row[0])
print(row[1])
print(row[16])
print(row[-1])
print(row[4])
print("---------------")
else :
tableau=open("/home/project/Python/elements-data3.csv","r")
reader = csv.reader(tableau, delimiter=";")
recherche = input("De quel famille sont issus les éléments recherchés? ")
for row in reader:
if recherche in row[-1]:
print(row[0])
print(row[1])
print(row[16])
print(row[-1])
print(row[4])
print("---------------")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment