Re: Python Dice Game/Need help with my script/looping!
I use Linux and python 2.7.12 -- https://mail.python.org/mailman/listinfo/python-list
Python Dice Game/Need help with my script/looping!
Hello,I recently started to make a dice game in python.Everything was nice and beautiful,until now.My problem is that when I try to play and I win or lost or it's equal next time it will continue only with that. Exemple: Enter name >> Sorin Money = 2 Bet >> 2 You won! Money 4 Bet >> 2 You won! and it loops like this :/ Here is the code: import time import os import random os = os.system os("clear") print "What is your name?" name = raw_input(">>") def lost(): print "Yoy lost the game!Wanna Play again?Y/N" ch = raw_input(">>") if ch == "Y": game() elif ch == "N": exit() def game(): os("clear") a = random.randint(1,6) b = random.randint(1,6) c = random.randint(1,6) d = random.randint(1,6) e = a + b f = c + d money = 2 while money > 0: print "Welcome to FireDice %s!" %name print "Your money: %s$" %money print "How much do you bet?" bet = input(">>") if e > f: print "you won!" money = money + bet elif e < f: print "you lost" money = money - bet else: print "?" print money lost() game() -- https://mail.python.org/mailman/listinfo/python-list
[issue23030] lru_cache manual get/put
Constantin added the comment: I understand your decision. Even though it makes my life a little bit harder, it is definitely not the end of the world, the end of Python or even the end for my libtco project. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23030 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23030] lru_cache manual get/put
Constantin added the comment: It may be the case, that an lru_cache does not provide the best strategy for reliably caching many base cases in recursively written code. I suggest that someday we think about a different caching paradigm which fits this purpose and add it to functools e.g. as functools.recopt_cache. This cache would then implement the same interface as lru_cache and therefore all code currently using lru_cache could benefit from recopt_cache with just one line of code change. Furthermore, by designing this interface, it becomes more probable that user defined caching decorators are compatible. Please remember: My suggestion isn't just about lru_cache, but about an interface for caching decorators. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23030 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23030] lru_cache manual get/put
New submission from Constantin: In an effort for improved communication between stacked decorators, I would like to propose that all decorators providing caching mechanisms should provide the functions cache_info, cache_clear, cache_get and cache_put. The standard lib only provides functools.lru_cache as caching decorators, which already implements the former two. I have attached a patch to provide the latter two. On python-ideas there was also the idea to create a cache data structure and then have a decorator take its data structure as an argument. But it was argued that this could lead to some optimizations of the caching being impossible. I think my suggested approach should not impose a problem on highly optimized caching code, because every cache - no matter how optimized - must have some functionality to add something to the cache and lookup something in the cache. -- components: Library (Lib) files: lru_get_put.patch keywords: patch messages: 232476 nosy: ConnyOnny priority: normal severity: normal status: open title: lru_cache manual get/put type: enhancement versions: Python 3.5 Added file: http://bugs.python.org/file37415/lru_get_put.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23030 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1776674] glob.glob inconsistent
Changes by Constantin Veretennicov kveretenni...@gmail.com: -- nosy: +kveretennicov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1776674 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9584] Allow curly braces in fnmatch
Changes by Constantin Veretennicov kveretenni...@gmail.com: -- nosy: +kveretennicov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9584 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4573] zsh-style subpattern matching for fnmatch/glob
Changes by Constantin Veretennicov kveretenni...@gmail.com: -- nosy: +kveretennicov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4573 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8402] glob returns empty list with [ character in the folder name
Changes by Constantin Veretennicov kveretenni...@gmail.com: -- nosy: +kveretennicov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8402 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Problem ... with threads in Python
Hello. Iknow that Python is not fully threadsafe. Unlike Java, where threading was considered to be so important that it is a part of the syntax, in Python threads were laid down at the altar of Portability. But, i really have to finish a project which uses multiple threads in Python, and i shouldn't use the time.sleep() function. Is there any posibility to use multiple threads without using the time.sleep() function ? And if so, what thatway should be ? Best regards, _Cosmin -- http://mail.python.org/mailman/listinfo/python-list