Hi,
In [2]: sum([.1, .1, .1, .1, .1, .1, .1, .1, .1, .1])
Out[2]: 0.
In ipython, I got the above output. But I got a different output from
"print". Is there a way to print exact what I saw in ipython?
~/linux/test/python/man/library/math/fsum$ cat main.py
#!/usr/bin/env python
pr
Hi,
I installed Python using python-2.7.3-macosx10.6.dmg on my Mac OS
10.8.2.
When try to use pip to install packages, I get the following message.
Then the installation fails.
gcc-4.2 not found, using clang instead
I then create a link from /usr/bin/gcc to gcc-4.2. Then I run pip
again, I get
Hi,
reference.pdf from python document has the following description. It
is not accessible from help() in the command line. Is there an
alternative so that I can quickly access these class attributes or
method names from the command line?
object.__call__(self [, args... ])
Called when the instanc
Hi,
In bash, set -v will print the command executed. For example, the
following screen output shows that the "echo" command is printed
automatically. Is there a similar thing in python?
~/linux/test/bash/man/builtin/set/-v$ cat main.sh
#!/usr/bin/env bash
set -v
echo "Hello World!"
~/linux/test/
> Is this what you want?
> http://docs.python.org/2/library/trace.html
I'm not able to get the mixing of the python command screen output on
stdout. Is there a combination of options for this purpose?
~/linux/test/python/man/library/trace$ cat main1.py
#!/usr/bin/env python
def f():
print "Hel
> Try with just --trace?
>
>
> C:\ramit>python.exe -m trace test.py
> C:\ramit\Python27\lib\trace.py: must specify one of --trace, --count,
> --report, --listfuncs, or --trackcalls
>
> C:\ramit>python -m trace --trace test.py
> --- modulename: test, funcname:
> test.py(2): def f():
> test.py(5):
Hi,
The empty() returns True even after put() has been called. Why it is
empty when there some items in it? Could anybody help me understand
it? Thanks!
~/linux/test/python/man/library/multiprocessing/Queue/empty$ cat
main.py
#!/usr/bin/env python
import multiprocessing
queue = multiprocessing.
Hi,
I'm not able to find the documentation on what locale is used for
sorted() when the 'cmp' argument is not specified. Could anybody let
me what the default is? If I always want LC_ALL=C, do I need to
explicitly set the locale? Or it is the default?
Regards,
Peng
--
http://mail.python.org/mail
Hi,
It is confusing to me what the best workflow is for python module
development. There is setup.py, egg. Also, pip, easy_install.
Could any expert suggest an authoritative and complete guide for
developing python modules? Thanks!
Regards,
Peng
--
http://mail.python.org/mailman/listinfo/python
On Apr 11, 10:25 am, John Gordon wrote:
> In <2900f481-fbe9-4da3-a7ca-5485d1ceb...@m13g2000yqc.googlegroups.com> Peng
> Yu writes:
>
> > It is confusing to me what the best workflow is for python module
> > development. There is setup.py, egg. Also, pip, easy_install
Hi,
The following example demonstrates the variable 'v' used in the list
comprehension is accessible out site the list comprehension.
I think that 'v' should be strictly local. Does anybody know where
this behavior is documented and why it is designed this way?
~/linux/test/python/man/library/__
Hi,
list(a_set)
When convert two sets with the same elements to two lists, are the
lists always going to be the same (i.e., the elements in each list are
ordered the same)? Is it documented anywhere?
--
Regards,
Peng
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, May 3, 2012 at 11:16 PM, Terry Reedy wrote:
> On 5/3/2012 8:36 PM, Peng Yu wrote:
>>
>> Hi,
>>
>> list(a_set)
>>
>> When convert two sets with the same elements to two lists, are the
>> lists always going to be the same (i.e., the elements
On Fri, May 4, 2012 at 6:21 AM, Chris Angelico wrote:
> On Fri, May 4, 2012 at 8:14 PM, Peng Yu wrote:
>> Thanks. This is what I'm looking for. I think that this should be
>> added to the python document as a manifestation (but nonnormalized) of
>> what "A set ob
On Fri, May 4, 2012 at 12:43 PM, Terry Reedy wrote:
> On 5/4/2012 8:00 AM, Peng Yu wrote:
>>
>> On Fri, May 4, 2012 at 6:21 AM, Chris Angelico wrote:
>>>
>>> On Fri, May 4, 2012 at 8:14 PM, Peng Yu wrote:
>>>>
>>>> Thanks. This is what I
On Fri, May 4, 2012 at 6:12 PM, Cameron Simpson wrote:
> On 04May2012 15:08, Peng Yu wrote:
> | On Fri, May 4, 2012 at 12:43 PM, Terry Reedy wrote:
> | > On 5/4/2012 8:00 AM, Peng Yu wrote:
> | >> On Fri, May 4, 2012 at 6:21 AM, Chris Angelico wrote:
> | >>&g
Hi Terry,
Thank you for you detailed email.
> If two collections are equal, should the iteration order be the same? It has
> always been true that if hash values collide, insertion order matters.
> However, a good hash function avoids hash collisions as much as possible in
> practical use cases.
> Documentation that takes ten pages to say something is just as bad as
> documentation that leaves stuff out, because it's almost guaranteed
> that it won't be read.
That's the point. If a simple example (6 lines) can demonstrate the
concept, why spending "ten pages" to explain it. My experience
Hi, R has the functions head() and str() to show the brief content of
an object. Is there something similar in python for this purpose?
For example, I want to inspect the content of the variable "train".
What is the best way to do so? Thanks.
$ cat demo.py
from __future__ import division, print_f
Hi,
Does anybody know how only get the redirected URL but not the actual content?
I guess the request module probably should be used. But I am not sure
how to do it exactly.
Can somebody show me the best way to request
(https://doi.org/10.1109/5.771073) and get the URL
(http://ieeexplore.ieee.or
Where is `?reload=true` from? How to just get the redict URL that one
would get from the browser? Thanks.
> 'http://ieeexplore.ieee.org:80/document/771073/?reload=true'
--
Regards,
Peng
--
https://mail.python.org/mailman/listinfo/python-list
Hi, perl has __END__ which ignore all the lines below it.
Is there anything similar to __END__ in python? Thanks.
--
Regards,
Peng
--
https://mail.python.org/mailman/listinfo/python-list
Hi,
I would like to extract "a...@efg.hij.xyz". But it only shows ".hij".
Does anybody see what is wrong with it? Thanks.
$ cat main.py
#!/usr/bin/env python
# vim: set noexpandtab tabstop=2 shiftwidth=2 softtabstop=-1 fileencoding=utf-8:
import re
email_regex = re.compile('[a-zA-Z0-9_.+-]+@[a-z
Hi,
R has the function edit() which allows the editing of the definition
of a function. Does python have something similar so that users can
edit python functions on the fly? Thanks.
https://www.rdocumentation.org/packages/utils/versions/3.4.3/topics/edit
--
Regards,
Peng
--
https://mail.pytho
Hi, I see the following two lines are the same. But I'd like to find
where ^ is documented via the help() function (I am not looking for
the document in html)? Does anybody know? Thanks.
s.symmetric_difference(t)
s ^ t
--
Regards,
Peng
--
https://mail.python.org/mailman/listinfo/python-list
Hi, The following example shows that both locals() and globals() are
updated when x and f are defined. Shouldn't they be considered and
global variable and functions only? Why does it make sense to set
locals() as well? Thanks.
$ cat ./main.py
#!/usr/bin/env python
# vim: set noexpandtab tabstop=
Where is it documented that __xor__ and ^ is the same as
symmetric_difference? Thanks.
BTW, I am using to Python 2, your help message is different from mine.
Do you use Python 3?
On Fri, Dec 22, 2017 at 9:41 PM, Dan Sommers wrote:
> On Fri, 22 Dec 2017 21:35:53 -0600, Peng Yu wrote:
>
&g
Hi, I only can find the doc for @. What does @@ mean in python?
--
Regards,
Peng
--
https://mail.python.org/mailman/listinfo/python-list
See for example this file.
https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/ops/rnn_cell.py
On Sat, Dec 23, 2017 at 12:03 AM, Steve D'Aprano
wrote:
> On Sat, 23 Dec 2017 04:38 pm, Peng Yu wrote:
>
>> Hi, I only can find the doc for @. What does @@ mean
Hi,
I see the following usage of list comprehension can generate a
generator. Does anybody know where this is documented? Thanks.
$ cat main.py
#!/usr/bin/env python
import sys
lines = (line.rstrip('\n') for line in sys.stdin)
print lines
lines = [line.rstrip('\n') for line in sys.stdin]
print
> When you use square brackets, you're creating a generator, as in your
> second example. Your first example is a slightly different beast
> called a "generator expression". If you search for that in the docs or
> on the web, you'll find what you want.
Thanks. Can the documentation be found by `he
Hi,
I use the following code to process TSV input.
$ printf '%s\t%s\n' {1..10} | ./main.py
['1', '2']
['3', '4']
['5', '6']
['7', '8']
['9', '10']
$ cat main.py
#!/usr/bin/env python
# vim: set noexpandtab tabstop=2 shiftwidth=2 softtabstop=-1 fileencoding=utf-8:
import sys
for line in sys.stdin
> Just to be clear, TAB *only* appears in utf-8 as the encoding for the actual
> TAB character, not as a part of any other character's encoding. The only
> bytes that can appear in the utf-8 encoding of non-ascii characters are
> starting with 0xC2 through 0xF4, followed by one or more of 0x80 t
Hi,
I see _sre.SRE_Match is returned by re.match. But I don't find where
it is defined. Does anybody know how to get its help page within
python command line? Thanks.
>>> import re
>>> m = re.match('a', 'abc')
>>> print type(m)
>>> _sre.SRE_Match
Traceback (most recent call last):
File "", lin
Here shows some code for reading Unicode characters one by one in
python2. Is it the best code for reading Unicode characters one by one
in python2?
https://rosettacode.org/wiki/Read_a_file_character_by_character/UTF8#Python
--
Regards,
Peng
--
https://mail.python.org/mailman/listinfo/python-li
Hi,
I can extracted the encoded value as bytes. But is there a way to
extracted the decoded value (for á, it is C1)? Thanks.
$ cat ./dumpunicode.py
#!/usr/bin/env python3
while True:
c = sys.stdin.read(1)
if c:
print(c)
print('0x' + ''.join(['%x' % x for x in reversed(byt
I would like to just get the escaped string without the single quotes.
Is there a way to do so? Thanks.
>>> x='\n'
>>> print repr(x)
'\n'
--
Regards,
Peng
--
https://mail.python.org/mailman/listinfo/python-list
On Sat, Feb 24, 2018 at 12:45 PM, Wildman via Python-list
wrote:
> On Sat, 24 Feb 2018 11:41:32 -0600, Peng Yu wrote:
>
>> I would like to just get the escaped string without the single quotes.
>> Is there a way to do so? Thanks.
>>
>>>>> x='\n
On Sat, Feb 24, 2018 at 1:08 PM, Peng Yu wrote:
> On Sat, Feb 24, 2018 at 12:45 PM, Wildman via Python-list
> wrote:
>> On Sat, 24 Feb 2018 11:41:32 -0600, Peng Yu wrote:
>>
>>> I would like to just get the escaped string without the single quotes.
>>
Hi,
>>> import re
>>> prog=re.compile('[a-f]+')
>>> help(prog)
I can use the above command to access SRE_Pattern. But this involves
the creation of an object of the class.
I tried to directly access the class. But it does not work. Does
anybody know if there is a way to directly access the class
Hi,
https://docs.python.org/3/library/email.parser.html
It says "For MIME messages, the root object will return True from its
is_multipart() method, and the subparts can be accessed via the
payload manipulation methods, such as get_body(), iter_parts(), and
walk()."
But when I try the following
Hi,
https://www.fuzzingbook.org/html/Grammars.html
I am trying to follow an example on the above page. But it does not
show a figure. Could anybody let me know how to display the figure?
$ ipython3
Python 3.8.0 (v3.8.0:fa919fdf25, Oct 14 2019, 10:23:27)
Type 'copyright', 'credits' or 'license'
Hi, See the following example, I am not able to get the source code of
the actual function that does the calculation of partial_ratio. Does
anybody know what is the correct way of getting the source?
/tmp$ ./main.py
@functools.wraps(func)
def decorator(*args, **kwargs):
if args[0]
Hi,
I'm wondering where is the documentation for ',' as in the following usage.
x = 1
y = 2
x, y = y, x
I tried help(','). But there are too many ',' in it and I don't see in
which section ',' is documented. Could anybody let me know? Thanks.
--
Regards,
Peng
--
https://mail.python.org/mailma
ew__ =
| T.__new__(S, ...) -> a new object with type S, a subtype of T
On Fri, Sep 16, 2016 at 9:13 PM, MRAB wrote:
> On 2016-09-17 03:05, Peng Yu wrote:
>>
>> Hi,
>>
>> I'm wondering where is the documentation for ',' as in the following
>&
Hi, `set -v` in bash allows the print of the command before print the
output of the command.
I want to do the similar thing --- print a python command and then
print the output of the command. Is it possible with python?
--
Regards,
Peng
--
https://mail.python.org/mailman/listinfo/python-list
OK. But it is documented somewhere in python doc?
On Fri, Sep 16, 2016 at 9:48 PM, Lawrence D’Oliveiro
wrote:
> On Saturday, September 17, 2016 at 2:05:49 PM UTC+12, Peng Yu wrote:
>> x, y = y, x
>
> It’s just syntactic sugar for
>
> (x, y) = (y, x)
> --
> http
Hi, I want to convert strings in which the characters with accents
should be converted to the ones without accents. Here is my current
code.
$ cat main.sh
#!/usr/bin/env bash
# vim: set noexpandtab tabstop=2:
set -v
./main.py Förstemann
./main.py Frédér8ic@
$ cat main.p
> python -m trace -t yourprogram.py
If I want to add some command in yourprogram.py to show the commands
used it instead of calling trace from the command line, can it be
done?
--
Regards,
Peng
--
https://mail.python.org/mailman/listinfo/python-list
Hi, I want to get the same content as the html doc from help(). I am
not sure if this is possible (as I tried help(inspect) which does not
give the same content). Could anybody confirm if there is a way to get
the same content from help()? Thanks.
https://docs.python.org/2/library/inspect.html
--
Sorry. I am still referring to python2.
On Sat, Sep 17, 2016 at 8:45 PM, Lawrence D’Oliveiro
wrote:
> On Sunday, September 18, 2016 at 12:51:11 PM UTC+12, Peng Yu wrote:
>> I want to get the same content as the html doc from help().
>
> ldo@theon:~> pydoc3 inspect
&g
somehow settrace in one line and expect to
get the trace function being called in the next line.
So something like `set -v` in bash sounds not possible. Is it so?
On Sat, Sep 17, 2016 at 5:28 PM, Ned Batchelder wrote:
> On Saturday, September 17, 2016 at 4:41:32 PM UTC-4, Peng Yu wrote:
>
./main.py Schöön
$ ./main.sh
Schoon
>> Kouli
>>
>> On Sat, Sep 17, 2016 at 6:12 PM, Peng Yu wrote:
>>> Hi, I want to convert strings in which the characters with accents
>>> should be converted to the ones without accents. Here is my current
>>> code.
>
>
On Sunday, September 18, 2016, Ned Batchelder wrote:
> On Saturday, September 17, 2016 at 11:09:04 PM UTC-4, Peng Yu wrote:
> > The manual says the following.
> >
> > "The trace function is invoked (with event set to 'call') whenever a
> > new local scop
Hi,
Suppose that I have file1.py, ..., filen.py in a module directory.
I want to import all the thing (or the ones available in the
respective __all__) defined in each of the file by putting the
following lines in __init__.py
from file1 import *
from filen import *
However, I don't want to
Hi, I want know where import is defined in the source code. Is it
implemented using __import__?
--
Regards,
Peng
--
https://mail.python.org/mailman/listinfo/python-list
On Wed, Sep 21, 2016 at 11:14 PM, Ben Finney wrote:
> Peng Yu writes:
>
>> I want to import all the thing (or the ones available in the
>> respective __all__) defined in each of the file by putting the
>> following lines in __init__.py
>>
>> from file1 i
On Thu, Sep 22, 2016 at 8:35 PM, Ben Finney wrote:
> Peng Yu writes:
>
>> On Wed, Sep 21, 2016 at 11:14 PM, Ben Finney
>> wrote:
>> > [Importing ‘*’ from a module] will also make the names in the code
>> > impossible to automatically match against where the
Hi, In many other functional language, one can change the closure of a
function. Is it possible in python?
http://ynniv.com/blog/2007/08/closures-in-python.html
--
Regards,
Peng
--
https://mail.python.org/mailman/listinfo/python-list
On Tue, Sep 27, 2016 at 10:01 AM, Chris Angelico wrote:
> On Wed, Sep 28, 2016 at 12:01 AM, Peng Yu wrote:
>> Hi, In many other functional language, one can change the closure of a
>> function. Is it possible in python?
>>
>> http://ynniv.com/blog/2007/08/closures-in-
Hi, peekable from more-itertools only allow peeking an iterator. But
sometimes, one may want to take a look at an element, manipulate it,
then put it back to the iterator. Is there a class in python that can
help do this?
https://pypi.python.org/pypi/more-itertools/
--
Regards,
Peng
--
https://
Hi,
I got the following error. Does anybody know how to fix it? Thanks.
$ pip
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/2.7/bin/pip",
line 7, in
from pip._internal import main
File
"/Library/Frameworks/Python.framework/Versions/2.7/lib/python
Hi, The following code shows that "Michał" is printed differently for
print(yaml.safe_dump(...)) and the direct print. Does anybody know how
to use yaml.safe_dump() so that "Michał" will be printed as is.
~$ cat main.py
#!/usr/bin/env python
# vim: set noexpandtab tabstop=2 shiftwidth=2 softtabsto
Hi,
I'd like to use a program to convert between basic regular expression
(BRE) and extended regular expression (ERE). (see man grep for the
definition of BRE and ERE). Does python has a module for this purpose?
Thanks.
--
Regards,
Peng
--
https://mail.python.org/mailman/listinfo/python-list
```
import requests
s = requests.Session()
import json
s.cookies.set_cookie(requests.utils.cookiejar_from_dict(json.load(sys.stdin)))
```
I used the above command to load cookies from a json file. But I got
the following error. Does anybody know how to fix the error? Thanks.
```
Traceback (most r
Hi,
I'd like to tell what part is zlib.compress data in an input stream.
One way is to use some characters that never appear in zlib.compress
output to denote the boundary. Are there such characters? Thanks.
--
Regards,
Peng
--
https://mail.python.org/mailman/listinfo/python-list
Suppose that I use this to read from stdin. But `line` contains
decoded data in python 3. In python 2, it contains the original data.
What is the best way to get the original data in python 3? Thanks.
```
for line in sys.stdin:
...
```
--
Regards,
Peng
--
https://mail.python.org/mailman/list
Hi,
I am trying to understand what does encode() do. What are the hex
representations of "u" in main.py? Why there is UnicodeEncodeError
when main.py is piped to xxd? Why there is no such error when it is
not piped? Thanks.
~$ cat main.py
#!/usr/bin/env python
u = unichr(40960) + u'abcd' + unich
Hi,
I get the following error when I try to install pip. Does anybody know
what it is wrong and how to fix it? Thanks.
~/Downloads$ pip install dtrx
Downloading/unpacking dtrx
Could not find any downloads that satisfy the requirement dtrx
Some externally hosted files were ignored (use --allow
Hi,
The following attributes does not include the class name. Is there a
way to add class name to the format string? Thanks!
http://docs.python.org/library/logging.html#logrecord-attributes
--
Regards,
Peng
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
The following code doesn't give me error, even I don't specify the
value of filename from the command line arguments. filename gets
'None'. I checked the manual, but I don't see a way to let
OptionParser fail if an argument's value (which has no default
explicitly specified) is not specified.
Hi,
I want to get the indent level within the code. For example, I want to
print 1 within the while loop as the line is indented 1 level. Is it
possible to get it within python?
while 1:
#print the level of indent, which is 1 here.
--
Regards,
Peng
--
http://mail.python.org/mailman/listinfo
Hi,
pprint can not print defaultdict one record per line. Is there some
other convenient way in python to print one record per line?
~/linux/test/python/man/library/pprint/function/pprint$ ./main.py
{'two': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14], 'one': [0,
1, 2, 3, 4, 5, 6, 7, 8, 9]}
Hi,
man python says "If a script argument is given, the directory
containing the script is inserted in the path in front of $PYTHONPATH.
The search path can be manipulated from within a Python program as
the variable sys.path." Instead I want to have the current directory
inserted to the fron
On Mon, Mar 18, 2013 at 1:54 AM, Steven D'Aprano
wrote:
> On Sun, 17 Mar 2013 22:56:07 -0500, Peng Yu wrote:
>
>> Hi,
>>
>> man python says "If a script argument is given, the directory
>> containing the script is inserted in the path in front o
On Sun, Mar 17, 2013 at 1:23 AM, Mark Shroyer wrote:
> I realize this isn't yet precisely what you're asking for, but look at the
> inspect and ast modules:
>
> import ast, inspect
>
> def indent_level():
> lineno = inspect.currentframe().f_back.f_lineno
>
> with open(__fi
Hi,
I don't quite understand how -m option is used. And it is difficult to
search for -m in google. Could anybody provide me with an example on
how to use this option? Thanks!
-m module-name
Searches sys.path for the named module and runs the
corresponding .py file as a scrip
Hi,
By default, setup.py will install everything in the source directory.
I want mask some directories so that they will not be installed. Is
there a way to do so in setup.py?
--
Regards,
Peng
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I'm wondering if it possible to use pandoc instead of rst to document
python. Is there a documentation system support this format of python
document?
--
Regards,
Peng
--
http://mail.python.org/mailman/listinfo/python-list
On Tue, Apr 23, 2013 at 5:40 PM, R. Michael Weylandt
wrote:
> On Tue, Apr 23, 2013 at 6:36 PM, Peng Yu wrote:
>> Hi,
>>
>> I'm wondering if it possible to use pandoc instead of rst to document
>> python. Is there a documentation system support this format of py
Hi,
It seem that the current python requires fixed-width pattern for look-
behind. I'm wondering if there is any newly development which make
variable-width pattern available for look-behind.
Thanks,
Peng
--
http://mail.python.org/mailman/listinfo/python-list
> Most probably a backport to Python 2.6 or even 2.5 under a different
> module name like re_ng wouldn't be too difficult to do for anybody that
> needs the new functionality and knows a bit about building extension
> modules.
I did a google a search. But I don't find any document that describe
it
Hi,
The following code snippet is from /usr/bin/rpl. I would like the it
to match a word, for example, "abc" in ":abc:". But the current one
would not match "abc" in ":abc:". I tried to modify it myself. Would
you please let me know what is the corrected way to do it?
Thanks,
Peng
if opt
On Jul 15, 10:29 pm, Gary Herron <[EMAIL PROTECTED]> wrote:
> Peng Yu wrote:
> > Hi,
>
> > The following code snippet is from /usr/bin/rpl. I would like the it
> > to match a word, for example, "abc" in ":abc:". But the current one
> > would
Hi,
Perl has a command line help perldoc. I'm wondering if python has a
similar help command.
Thanks,
Peng
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I use r"\ba\b" to match "a". However, I can not use "\ba::\b" to match
"a::b".
I would like to match "a::" in "a::b", but not in "a:: b". That is,
the character after "::" should be a alphanumeric character. Could you
let me know how to do it and why "\b" would not work?
Thanks,
Peng
--
http
Hi,
'\b' only match the boundary between alphanumerical char and
nonalphanumerical char. I'm wonder if there is a generic metacharacter
to match the boundary between any non intersected char set defined in
regex and its complement.
For example, I have a few non intersected char sets [a-zA-Z_0-9],
Hi,
I want to delete the line with abc in the following program. But the
following program does not do what I want. Can somebody let me know
how to do it?
Thanks,
Peng
#!/usr/bin/python
import re
file="""abcd
efg
hijk
lmn
"""
regex = re.compile("^abcd$", re.MULTILINE)
print file,
print "$"
p
I observe that python library primarily use exception for error
handling rather than use error code.
In the article API Design Matters by Michi Henning
Communications of the ACM
Vol. 52 No. 5, Pages 46-56
10.1145/1506409.1506424
http://cacm.acm.org/magazines/2009/5/24646-api-design-matters/fullte
On Thu, Dec 31, 2009 at 11:24 PM, Chris Rebert wrote:
> On Thu, Dec 31, 2009 at 8:47 PM, Peng Yu wrote:
>> I observe that python library primarily use exception for error
>> handling rather than use error code.
>>
>> In the article API Design Matters by Michi Henning
On Sat, Jan 2, 2010 at 6:05 AM, Diez B. Roggisch wrote:
> Peng Yu schrieb:
>>
>> On Thu, Dec 31, 2009 at 11:24 PM, Chris Rebert wrote:
>>>
>>> On Thu, Dec 31, 2009 at 8:47 PM, Peng Yu wrote:
>>>>
>>>> I observe that python library primar
Hi,
I am looking for a method in python that is similar to the function
str() in R, if you are familiar with R,
If you have no idea of R, what I want is to print the class
information of an object and the values of its members. Overloading
'__expr__' and '__repr__' then using 'print' can sort of
Hi,
It is strange that the file mode of .pyc files are changed to
executable (x mode) after the corresponding .py files have been run. I
have the follow python, which is compiled from source code by me.
$ python --version
Python 2.6.2
Should .pyc files have the x mode?
Regards,
Peng
--
http://
On Sat, Sep 26, 2009 at 8:10 AM, Steven D'Aprano
wrote:
> On Sat, 26 Sep 2009 06:57:52 -0500, Peng Yu wrote:
>
>> Hi,
>>
>> It is strange that the file mode of .pyc files are changed to executable
>> (x mode) after the corresponding .py files have been run.
On Sat, Sep 26, 2009 at 2:05 PM, Robert Kern wrote:
> On 2009-09-26 09:32 AM, Peng Yu wrote:
>>
>> Hi,
>>
>> I am looking for a method in python that is similar to the function
>> str() in R, if you are familiar with R,
>>
>> If you have no
On Sun, Sep 27, 2009 at 1:20 PM, Simon Forman wrote:
> On Sun, Sep 27, 2009 at 12:14 PM, Peng Yu wrote:
>> On Sat, Sep 26, 2009 at 2:05 PM, Robert Kern wrote:
>>> On 2009-09-26 09:32 AM, Peng Yu wrote:
>>>>
>>>> Hi,
>>>>
>>>> I
On Mon, Sep 28, 2009 at 12:43 AM, greg wrote:
> Peng Yu wrote:
>>
>> -rw--- 1 pengy lilab 29 2009-09-26 10:10:45 main.py
>> -rwx-- 1 pengy lilab 106 2009-09-26 10:19:17 test.py
>> -rwx-- 1 pengy lilab 339 2009-09-26 10:20:39 test.pyc
>
> Doesn
On Mon, Sep 28, 2009 at 8:22 AM, Steven D'Aprano
wrote:
> On Mon, 28 Sep 2009 17:01:40 +1000, Cameron Simpson wrote:
>
>> On 26Sep2009 10:24, Peng Yu wrote: | >
>> [st...@sylar test]$ ls -l
>> | > total 16
>> | > -rw-rw-r-- 1 steve steve 6 2009-0
On Sun, Sep 20, 2009 at 12:43 PM, Benjamin Kaplan
wrote:
> On Sun, Sep 20, 2009 at 12:43 PM, Peng Yu wrote:
>> On Sun, Sep 20, 2009 at 11:32 AM, Vijayendra Bapte
>> wrote:
>>> On Sep 20, 8:38 pm, Peng Yu wrote:
>>>> Hi,
>>>>
>>>> I ha
Hi,
I want some command to jump out of nested loop. I'm wondering what is
the most convenient way to do so in python.
for i in range(10):
print "i = ", i
for j in range(10):
if i*10 + j == 50:
print i*10 + j
break # I want to jump out of the loops.
Regards,
Peng
--
http://ma
1 - 100 of 243 matches
Mail list logo