générer UML à partir du code python
pyreverse -o png -p yourpackage .
Tender Toucan
pyreverse -o png -p yourpackage .
import java.util.Scanner;
Scanner myScanner = new Scanner(myTextInputStream); // Create new [Scanner] from myTextInputStream InputStream
StringBuilder myText = new StringBuilder(); // Create new [StringBuilder] for result text
while (myScanner.hasNextLine()) { // Go through every lines of myScanner [Scanner]
myText.append(myScanner.nextLine()).append("\n"); // Add line to myText [StringBuilder] and go back to next line (\n)
}
System.out.println("myText :");
System.out.println(myText); // Print result, use ".toString()" on myText [StringBuilder] if needed
class Card:
suits = ["pik", "kier", "karo", "trefl"]
values = [None, None, "2", "3", "4", "5", "6", "7",
"8", "9", "10", "Walet", "Królowa", "Król", "AS"]
def __init__(self, v, s):
"""suit + value are ints"""
self.value = v
self.suit = s
def __lt__(self, c2):
if self.value < c2.value:
return True
if self.value == c2.value:
if self.suit < c2.suit:
return True
else:
return False
return False
def __gt__(self, c2):
if self.value > c2.value:
return True
if self.value == c2.value:
if self.suit > c2.suit:
return True
return False
return False
def __repr__(self):
v = self.values[self.value] +\
" z " + \
self.suits[self.suit]
return v