On 13 Gru, 19:11, [EMAIL PROTECTED] wrote:
> There's got to be a simpler and more efficient way to do this.
> Can you help?
>
> Thanks,
> igor
If all you need is the result here's simpler and more efficient code:
from random import randrange
sum = 100 * randrange(128)
print "Sum is ", sum
And t
Why not just use comments and some filter. Just write # _{ at the
beginning and # _} at the end. Then filter just before runing
indenting with those control sequences? Then there's no need to change
interpreter.
--
http://mail.python.org/mailman/listinfo/python-list
On Jul 25, 1:08 am, Steven D'Aprano
<[EMAIL PROTECTED]> wrote:
> Underscores in numerics are UGLY. Why not take a leaf out of implicit
> string concatenation and allow numeric literals to implicitly concatenate?
>
> Python already does:
> "hello-" "world" => "hello-world"
>
> Propose:
> 123 456 789
Version 1 and 2 do different thing than version 3. The latter doesn't
add value to dict.
As it was mentioned before, use:
1 - if you expect that there's no key in dict
2 - if you expect that there is key in dict
--
http://mail.python.org/mailman/listinfo/python-list
On Jun 25, 3:26 pm, AJK <[EMAIL PROTECTED]> wrote:
> Hello there!
>
> I've been googleing yet, and suppose it's hopeless to try, but better ask
> it...
>
> I want to write a program which turns Cx to , cx to et al WHILE
> TYPING. (i.e. converting Esperanto x-system to real hats, for those
> who
On May 14, 9:49 pm, Méta-MCI <[EMAIL PROTECTED]> wrote:
> Hi!
>
> - should non-ASCII identifiers be supported? why?
> - would you use them if it was possible to do so? in what cases?
>
> Yes.
>
> JScript can use letters with accents in identifiers
> XML (1.1) can use letters with accents in tags
On May 13, 5:44 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> - should non-ASCII identifiers be supported? why?
No. It's good convention to stick with english. And if we stick with
english, why we should need non-ASCII characters? Any non-ASCII
character makes code less readable. We never know
On Apr 14, 5:19 pm, [EMAIL PROTECTED] wrote:
> Hi!
> I ran in problem with simple exercise. I'm trying to get program to
> return grade when given points but no matter what, I always get F.
>
> def grader():
> print "Insert points: "
> points = raw_input('> ')
> int(points)
>
>
On Apr 13, 6:14 pm, [EMAIL PROTECTED] wrote:
> I have a confusion when I do some practice, the code and output are as
> following,
>
> >>> def fun():
>
> print 'In fun()'
>
> >>> testfun = fun()
> In fun()
> >>> print testfun
> None
> >>> testfun2 = fun
> >>> print testfun2
>
>
> >
On Apr 4, 12:36 pm, "autin" <[EMAIL PROTECTED]> wrote:
> such as:>>>b = False
> >>>id(b)
>
> Traceback (most recent call last):
> File "", line 1, in ?
> TypeError: 'bool' object is not callable
>
> ---
> how to desc it?
>>> b = False
>>> id(b)
135311308
>>>
python 2.4, FreeBSD 6.2
--
http://
there are many much more powerful tools. If there will be any other
parsing tool in standard library that's OK. But I think that python
needs some standard parsing tool.
--
Jakub Stolarski
--
http://mail.python.org/mailman/listinfo/python-list
On 20 Lut, 19:29, "Alan Isaac" <[EMAIL PROTECTED]> wrote:
> If not, what module providing substantially similar functionality is?
>
AFAIK there's no parser generator module in standard library.
I would like to see PLY in standard library too.
--
Jakub Stolarski
Tim Daneliuk napisal(a):
> Ah yes, moral philosophy and python all come together... Er, that is to day:
>
> Imagine you have this situation on a *nix filesystem:
>
> Symlink A: /foo -> /usr/home
> Symlink B: /bar -> /foo/username
>
>
> If I do this:
>
>import os
>print os.path.realpath("/
13 matches
Mail list logo