Posts by Ruan • 131 points
3 posts
-
1
votes2
answers88
viewsA: Organize string data flow by default
Use parse() of dateutil.parser, that tests whether a string is a date or not. #!/usr/bin/python #-*- coding: utf-8 from dateutil.parser import parse def chunks(string): try: int(string) return False…
-
1
votes2
answers1757
viewsA: Hide password on terminal
If you want it to happen in the terminal, you will have to create a new input function and import it after, from the original input() function in C ( available here from line 1832 ). It seems to be…
-
1
votes2
answers2148
viewsA: Generate random numbers without repeating the previously generated number
First make a list of doors. Let’s assume that we are working with 10 doors. *l, = range(1,11) will generate: >>l [1,2,3,4,5,6,7,8,9,10] Now let’s delete a random number from the list. Just…