along the above discussion, resuming my python after the Xmas break (hope you
had a nice one!)
I want to install a number of scientific libraries, but I'm confused which
packages it contains what.
1) I see on scipy.org that scipy contains scipy library (fine, it makes sense),
along with other
> In theory, "pip3" will install into the default "python3", whichever
> that is. However, in practice, it's entirely possible that it installs
> into a very different Python from the one you're expecting. The most
> reliable form is the latter; whatever command you use to start Python,
> add "-m p
Hi, I'm learning python and full of extensive tutorials around. Getting a bit
lost and overflowed in my head with tuples, dictionaries, lists, etc ... etc...
Everything great, but I'd like to perform some basic task while learning the
rest. For example, I'm having a hard time to find some practi
Hi everybody, I have just installed python 3.5.2 (downloaded from
https://www.python.org/) on my mac (El Capitan).
1) I see from command line that older version of python are already available
on my machine (python, python2.6, python2.7, python3, python3.5). I guess some
might have been instal
I want to get pattern matching like OCaml in python(ref:http://
en.wikipedia.org/wiki/Tagged_union)
I consider the syntax:
def decl():
def Plus(expr, expr): pass
def Minus(expr, expr): pass
def Times(expr, expr): pass
def Divide(expr, expr): pass
def Value(
On 11月6日, 上午8时34分, metal wrote:
> On 11月4日, 下午5时39分, elca wrote:
>
> > Hello,
> > i have some text file list such like following format.
> > i want to change text format to other format.
> > i was upload it pastebin sitehttp://elca.pastebin.com/d71261168
>
&g
On 11月4日, 下午5时39分, elca wrote:
> Hello,
> i have some text file list such like following format.
> i want to change text format to other format.
> i was upload it pastebin sitehttp://elca.pastebin.com/d71261168
>
> if anyone help ,much appreciate thanks in advance
> --
> View this message in
> c
On 11月6日, 上午4时02分, Leland wrote:
> Hi,
>
> I always use readline(), strip(), split() and so on to parse a string.
> Is there some elegant way to parse the following string into a
> dictionary {'50MHZ_CLK_SRC' : 'U122.2, R1395.1'}?
>
> NET_NAME
> '50MHZ_CLK_SRC'
> '@TEST_LIB.TEST(SCH_1):50MHZ_CLK_
On 11月2日, 上午9时27分, Peng Yu wrote:
> On Sun, Nov 1, 2009 at 7:02 PM, alex23 wrote:
> > On Nov 2, 8:11 am, Peng Yu wrote:
> >> I prefer organized my code one class/function per file (i.e per module
> >> in python). I know the majority of programmers don't use this
> >> approach. Therefore, I'm won
On 10月30日, 下午4时44分, Bruno Desthuilliers wrote:
> metal a écrit :
>
> > The actual situation is I'm coding with a immuable set-like datatype
> > XSet which supports XSet(['al']) & XSet(['ah'] = XSet(['ax']
>
> I assume it was &
On 10月30日, 上午8时03分, metal wrote:
> The actual situation is I'm coding with a immuable set-like datatype
> XSet which supports XSet(['al']) & XSet(['ah'] = XSet(['ax'] if I
> declare ax is consists of al and ah
>
A typo, XSet(['al']) |
On 10月30日, 上午11时59分, Steven D'Aprano wrote:
> On Thu, 29 Oct 2009 19:02:01 -0700, metal wrote:
> > I used this quickndirty way, any good idea to solve this problem?
>
> It's not a problem that wants solving, it's a feature that wants paying
> attention to.
>
I used this quickndirty way, any good idea to solve this problem?
def miter(iterable):
cache = set()
while True:
try:
for x in iterable:
if x not in cache:
cache.add(x)
yield x
break
except Runt
On 10月30日, 上午9时03分, Benjamin Peterson wrote:
> metal gmail.com> writes:
>
>
>
> > '11' + '1' == '111' is well known.
>
> > but it suprises me '11'+'1' IS '111'.
>
> > Why? Obviously they are two d
On 10月30日, 上午8时49分, Chris Rebert wrote:
> On Thu, Oct 29, 2009 at 5:43 PM, metal wrote:
> > '11' + '1' == '111' is well known.
>
> > but it suprises me '11'+'1' IS '111'.
>
> > Why? Obviously they
'11' + '1' == '111' is well known.
but it suprises me '11'+'1' IS '111'.
Why? Obviously they are two differnt object.
Is this special feature of imutable object?
--
http://mail.python.org/mailman/listinfo/python-list
The actual situation is I'm coding with a immuable set-like datatype
XSet which supports XSet(['al']) & XSet(['ah'] = XSet(['ax'] if I
declare ax is consists of al and ah
"That" means I can't explian it very well 'cause my english...
Now I try to make some mess like this...I know it's not good to
Consider the following:
class Parent:
def some_method(self):
return Parent(...)
class Child:
def some_method(self):
...
return Parent.some_method(self)
Environment:
PythonWin 2.5.4 (r254:67916, Apr 27 2009, 15:41:14) [MSC v.1310 32 bit
(Intel)] on win32.
Portions Copyright 1994-2008 Mark Hammond - see 'Help/About PythonWin'
for further copyright information.
Evil Code:
class Foo:
def __init__(self, *args):
print args
Fo
On 10月11日, 下午5时30分, ryles wrote:
> On Oct 11, 3:04 am, metal wrote:
>
>
>
> > Environment:
>
> > PythonWin 2.5.4 (r254:67916, Apr 27 2009, 15:41:14) [MSC v.1310 32 bit
> > (Intel)] on win32.
> > Portions Copyright 1994-2008 Mark Hammond - see 'Hel
I wonder the reason for ELIF. it's not aligned with IF, make code ugly
IMHO
OR maybe better?
if foo == bar:
...
or foo == baz:
...
or foo == bra:
...
else:
...
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
Can not dump class object created on runtime.
Is there anybody can help me? Thank.
Following is testing code:
import pickle
from new import classobj
class A:
def __str__(self):
return self.__class__.name
if __name__ == "__main__":
c = classobj('B', (A, ), {}) # crea
>>> import re
>>>
>>> if __name__ == "__main__":
... lst = [281, 713, 832, 1281, 1713, 1832, 2281, 2713, 2832]
... for item in lst:
... if re.match("^1?(?=281)|^1?(?=713)|^1?(?=832)", str(item)):
... print "%d invalid" % item
... else:
... print "%d v
The operator is and is not test for object identity: x is y is true if and
only if x and y are the same objects.
>>> x = 1
>>> y = 1
>>> x is y
True
Is this right? Why? Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Thanks. Please refer to following snipt:
1 >>> class Printable(type):
2 ... def __str__(cls):
3 ... return "This is class %s" % cls.__name__
4 ...
5 >>> class C(object):
6 ... __metaclass__ = Printable
7 ...
8 >>>
9 >>> C.__str__
10
11 >>>
12 >>> print C
13 This is class C
I see,
25 matches
Mail list logo