Start new process by function ?

2005-03-10 Thread George Sakkis
Is it possible to start a new process by specifying a function call (in similar function to thread targets) instead of having to write the function in a separate script and call it through os.system or os.spawn* ? That is, something like def foo(): pass os.spawn(foo) Thanks in advance, George

S-exression parsing

2005-03-11 Thread George Sakkis
The S-expression parser below works, but I wonder if it can be simplified; it's not as short and straightforward as I would expect given the simplicity of S-expressions. Can you see a simpler non-recursive solution ? George # usage >>> parseSexpression("(a (b c) (d))"

Jython Phone Interview Advice

2005-03-15 Thread George Jempty
I'm undergoing a phone interview for a Jython job today. Anybody have practical advice for me? I haven't worked with Python in years, but I have been working with Java in the meantime (resume at http://scriptify.com/george_jempty_resume.pdf). I've been reading up: my old "Quick Python" (Harris/M

Re: Jython Phone Interview Advice

2005-03-15 Thread George Jempty
Paul Watson wrote: > > Gee, George. I wonder if the interviewing manager or anyone in their > company has access to newsgroups? Then I hope they would see that I was trying to properly prepare for the interview. I've given it to them straight so far: I'm no Python/Jython g

Re: Jython Phone Interview Advice

2005-03-15 Thread George Jempty
D H wrote: > George Jempty wrote: > > Also, considering Javascript will be a substantial component of my job, > > I'm noticing that Javascript's array/"hash" literal syntax is EXACTLY > > the same as that for Python lists/dictionaries. This could lead to &

Re: Jython Phone Interview Advice

2005-03-16 Thread George Jempty
Jeremy Bowers wrote: > On Tue, 15 Mar 2005 03:21:19 -0800, George Jempty wrote: > > I'm noticing that Javascript's array/"hash" literal syntax is EXACTLY the > > same as that for Python lists/dictionaries. > > No it isn't, quite. > > T

Re: GUI toolkit question

2005-03-17 Thread Harry George
[EMAIL PROTECTED] writes: > I'm building an app that operates on tuples (typically pairs) of > hierarchical structures, and i'd like to add a GUI to display my > internal representation of them, and simplify manipulations/operations > on them. My requirements are: > > 1) Draw a single 3D repres

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread George Sakkis
at uses dictionary of sets internally. It turns out I've used setdefault 8 times in this module alone ! George -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread George Sakkis
o a scalar or appending to a list -- is that essential; a self-respecting program should make this obvious by the name of the parameter anyway ("dictionary.accumulate('hello', words)" vs "a.accumulate('hello', b)"). George -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread George Sakkis
n rule, and the justification for applying it in this case instead of subclassing should better be pretty strong; so far I'm not convinced though. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread George Sakkis
he contents. > (There may be exceptions, but I can't think of any at the moment) > > Does anyone else think this is a problem? > > Michael Yep, at least three more people in this thread: - http://tinyurl.com/4bsdf - http://tinyurl.com/3seqx - http://tinyurl.com/6db27 George -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread George Sakkis
"John Machin" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > George Sakkis wrote: > > +1 on this. The new suggested operations are meaningful for a subset > of all valid dicts, so they > > should not be part of the base dict API. If any v

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread George Sakkis
cality beats purity" zen rule, and the > > justification for applying it in > > this case instead of subclassing should better be pretty strong; so > far I'm > > not convinced though. > > > > George > > It is bad OO design, George. I want to be a bit more become mo

Re: Pre-PEP: Dictionary accumulator methods

2005-03-19 Thread George Sakkis
gt; > Michael That's the equivalent of reduce() for mappings. Given the current trend of moving away from traditional functional features (lambda,map,filter,etc.), I would guess it's not likely to become mainstream. George -- http://mail.python.org/mailman/listinfo/python-list

Re: RELEASED Python 2.4 (final)

2004-11-30 Thread Harry George
cd .. 4. When another python version shows up, copy the go23 to go24, edit it for py23-->py24, and start building. Use either version at the commmand line or in other scripts via py23 or py24. NOTE: In cgi's, give the full path, e.g.: #!/usr/local/bin/python2.3 -- Har

SOAPpy/ZSI/Twisted SOAP over stdin/stdout?

2004-11-30 Thread Harry George
Normally the SOAP Servers are designed to take control of a port and run their own sockets via inheritance from SocktServer. But under inetd and xinetd, the port is controlled elsewhere and the service just gets the stdin/stdout. I need to configure (or tweak) one of the SOAP servers to use that c

Re: SOAPpy/ZSI/Twisted SOAP over stdin/stdout?

2004-12-01 Thread Harry George
Harry George <[EMAIL PROTECTED]> writes: > Normally the SOAP Servers are designed to take control of a port and > run their own sockets via inheritance from SocktServer. > > But under inetd and xinetd, the port is controlled elsewhere and the > service just gets the st

Re: How did you learn Python?

2004-12-03 Thread Harry George
"Shawn Milo" <[EMAIL PROTECTED]> writes: > I was just wondering what the best books were for learning Python. > > Which books are good for getting started, and which should be saved for > later, or or not useful except as a reference for the learned? > > I have a decent programming background in

style query: function attributes for return codes?

2004-12-10 Thread george young
... return GOOD_CONN But if this is a small utility function that belongs inside a larger module/class, I would like to have it's return values closely associated with the function, not just another value in the parent class. Is anybody using function attributes like this? Is

Re: style query: function attributes for return codes?

2004-12-10 Thread george young
On Fri, 10 Dec 2004 16:40:25 GMT Steven Bethard <[EMAIL PROTECTED]> threw this fish to the penguins: > george young wrote: > > This is obviously just evil, since a misspelling in the string > > return is treacherous. I'm considering function attributes: > > >

For loop extended syntax

2005-03-20 Thread George Sakkis
ething like: [x*y-z for (x,y,z=0) in (1,2,3), (4,5), (6,7,8)] instead of the less elegant explicit loop version that has to check for the length of each sequence. What do you think ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: For loop extended syntax

2005-03-20 Thread George Sakkis
"Kay Schluehr" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > > This would be very > > useful for list/generator comprehensions, for example being able to > write something like: > > > > [x*y-z for (x,y,z=0) in (1,2,3), (4,5), (6,7,8)]

Re: For loop extended syntax

2005-03-20 Thread George Sakkis
"Matteo Dell'Amico" <[EMAIL PROTECTED]> wrote: > George Sakkis wrote: > > I'm sure there must have been a past thread about this topic but I don't > > know how to find it: How > > about extending the "for in" syntax so that X can

Re: For loop extended syntax

2005-03-20 Thread George Sakkis
"Heiko Wundram" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > On Sunday 20 March 2005 20:47, George Sakkis wrote: > > Not always. Say for example that you're doing some 2D geometry stuff, and > > later you have to extend it to 3D. In this

Re: For loop extended syntax

2005-03-20 Thread George Sakkis
"Heiko Wundram" <[EMAIL PROTECTED]> wrote: > Am Sonntag, 20. März 2005 22:22 schrieb George Sakkis: > > Once more, the 2D/3D example was just that, an example; my point was not to > > find a specific solution to a specific problem. > > And my point being:

Re: missing? dictionary methods

2005-03-21 Thread George Sakkis
methods. In contrast to the recent pre-PEP about dict accumulating methods, set() and make() (or whatever they might be called) are meaningful for all dicts, so they're good candidates for being added to the base dict class. As for naming, I would suggest reset() instead of set(), to em

Re: For loop extended syntax

2005-03-21 Thread George Sakkis
in python one day; it is pretty obvious what it would do for anyone familiar with function argument tuples. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Pre-PEP: Dictionary accumulator methods

2005-03-21 Thread George Sakkis
> > d = defaultdict(list)() > d["x"].append(1) > d["x"].append(2) > d["y"].append(1) > print d > > Michele Simionato Best solution so far. If it wasn't for the really bad decision to add the dict(**kwargs) constructor, I'd love to see something like d = dict(valType=int) d["x"] += 1 George -- http://mail.python.org/mailman/listinfo/python-list

Set literals

2005-03-21 Thread George Sakkis
How about overloading curly braces for set literals, as in >>> aSet = {1,2,3} - It is the standard mathematic set notation. - There is no ambiguity or backwards compatibility problem. - Sets and dicts are in many respects similar data structures, so why not share the same delimiter ? *ducks*

Re: Set literals

2005-03-21 Thread George Sakkis
> - There is no ambiguity or backwards compatibility problem. ...at least if it wasn't for the empty set.. hmm... -- http://mail.python.org/mailman/listinfo/python-list

Re: Set literals

2005-03-21 Thread George Sakkis
, but for now there > will not be syntax support for sets. > > Read the section on 'Set Notation' in: > http://www.python.org/peps/pep-0218.html > > Tim Delaney Thanks for the link; obviously, I wasn't aware of the proposal and its rejection. looking-forward-to-python-3K-ly yours, George -- http://mail.python.org/mailman/listinfo/python-list

Re: Set literals

2005-03-21 Thread George Sakkis
.__iter__ iterates through the dict's keys, so the set a in your example doesn't know anything about the dict's values. You can go back and forth a set and a dict if you store the dict's items instead: >>> a = set({1:0,2:0,3:0}.iteritems()) >>> a set([(1,0), (2,0), (3,0)]) >>> dict(a) {1:0, 2:0, 3:0} Regards, George -- http://mail.python.org/mailman/listinfo/python-list

Re: sorting a dictionary?

2005-03-21 Thread George Sakkis
mydict.items(), > key=sortkey): > > print '%-6s %s' % word_freq > > > > Thank you scott, but 'sorted' itself is not a python > library function. So I assume by > "sorted(mydict.items()", you meant the object of > mydict.items() which has been sorted, right? sorted() is a new builtin in python 2.4: http://www.python.org/2.4/highlights.html George -- http://mail.python.org/mailman/listinfo/python-list

Re: Anonymus functions revisited

2005-03-22 Thread George Sakkis
r the function is > done? Yeap.. a simple one-liner can do the trick: def makeVars(**nameVals): sys._getframe(1).f_locals.update(nameVals) try: b except NameError: print "Before makeVars: NameError" else: print "Before makeVars: Not NameError" makeVars(b=2) try: b except

Re: Anonymus functions revisited

2005-03-23 Thread George Sakkis
> multiple return values, formatted strings and outputs, ...). All the following are possible: >>> (x,y,z) = (1,2,3) >>> (x,y,z) = [1,2,3] >>> [x,y,z] = (1,2,3) >>> [x,y,z] = [1,2,3] What exactly do you mean by "don't have anything like list unpacking" ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: Pattern matching from a text document

2005-03-23 Thread George Sakkis
; Any help would be greatly appreciated. > > Ben. Ben, can you post a sample line from the document and indicate the fields you want to extract? I'm sure it will be easier to help you this way. George ~ "If a slave say to his m

Re: Anonymus functions revisited : tuple actions

2005-03-24 Thread George Sakkis
;t look accessible to mere mortals :-) I'm not sure if the mind boggling is more due to the syntax with the '->' and all or the semantics, but it goes in the oppposite direction from my initial proposal (having defaults in for loops) with respect to readability. Regards, George -- http://mail.python.org/mailman/listinfo/python-list

Re: An Abridged Python Tutorial

2005-03-24 Thread George Sakkis
But know this in advance > your idea has no chance > should the BDFL not consent > > If you find this account is amiss, > please avoid the temptation to hiss. > Simply offer a patch, > to apply with dispatch > and if you seek Zen, import this! > > > Michael Outstanding ! Great piece Michael :-) George -- http://mail.python.org/mailman/listinfo/python-list

Re: Anonymus functions revisited : tuple actions

2005-03-25 Thread George Sakkis
"Kay Schluehr" <[EMAIL PROTECTED]> wrote: > To make my intention clear for another time, also for George who > mistrusts these exercises alltogether. I want to derive a syntax and > semantics for anonymus functions ( called "tuple-actions" ) that are > gen

Re: Anonymus functions revisited

2005-03-25 Thread George Sakkis
refer it over explicit try/except (but of course I'm biased :-)). Kay is proposing something even more general and powerful, and it will be interesting to see if all this brainstorming can be brought forward more 'formally', e.g. at a PEP or pre-PEP level. Regards, George -- http://mail.python.org/mailman/listinfo/python-list

Re: left padding zeroes on a string...

2005-03-25 Thread George Sakkis
gt; > >032 > > Of course, I need to cast the result back to a string to use it. Why > doesn't the first example work? That's not correct; int2 is a string so you can use it directly (and probably rename it to something more appropriate). > -cjl Regar

str vs dict API size (was 'Re: left padding zeroes on a string...')

2005-03-25 Thread George Sakkis
expandtabs', 'find', 'index', 'isalnum', > 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', > 'join', 'ljust', 'lower', 'lstrip', 'replac

Re: str vs dict API size (was 'Re: left padding zeroes on a string...')

2005-03-25 Thread George Sakkis
of review for that reason and so we don't have language bloat. > > Larry Bates Language bloat is subjective of course, but I fail to see why putting in dict.reset and dict.add should be harder than, say, str.swapcase or str.capitalize. George -- http://mail.python.org/mailman/listinfo/python-list

Re: itertools to iter transition (WAS: Pre-PEP: Dictionary accumulator methods)

2005-03-29 Thread George Sakkis
) + iter(y) := itertools.chain(iter(x), iter(y)) iter(x) * 3 := itertools.chain(* itertools.tee(iter(x), 3)) George -- http://mail.python.org/mailman/listinfo/python-list

Re: itertools to iter transition (WAS: Pre-PEP: Dictionaryaccumulator methods)

2005-03-29 Thread George Sakkis
ere stored internally as keys in a dict and the values were not used. Even when initializing with the same value is necessary, this can be accomplished in 2.4 with essentially the same performance in one line (dict((i,value) for i in iterable)). The few more keystrokes are just not worth an e

Re: Python interpreter error: unsupported operand type(s) for -: 'tuple' and 'int'

2005-03-29 Thread George Yoshida
# Convert the date format to the seconds since epoch for i in xrange( len(dates) ): thissecond = parseDate(dates[i][1]) seconds += (thissecond, ) -- george -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorater inside a function? Is there a way?

2005-04-02 Thread George Sakkis
foo('1',[2,'3']) Traceback (most recent call last): ... TypeError: container expected ([2, '3'] given) >>> foo('1',[2,3,4]) Traceback (most recent call last): ... TypeError: container of size 3 expected ([1, 2, 3, 4] given) George -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with splitting

2005-04-02 Thread George Sakkis
invocation > should show why they are there, though darned if I can think of a good way > to put it into words. If you don't want any null strings at the beginning or the end, an equivalent regexp is: >>> whitespaceSplitter_2 = re.compile("\w+|\s+") >>> whitespaceSplitter_2.findall("1 2 3 \t\n5") ['1', ' ', '2', ' ', '3', ' \t\n', '5'] >>> whitespaceSplitter_2.findall(" 1 2 3 \t\n5 ") [' ', '1', ' ', '2', ' ', '3', ' \t\n', '5', ' '] George -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorater inside a function? Is there a way?

2005-04-03 Thread George Sakkis
module's clients. In my module, the default is ENABLE_TYPECHECKING = __debug__. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Decorater inside a function? Is there a way?

2005-04-03 Thread George Sakkis
ed) lines it's a bit long to qualify for a recipe :-) George -- http://mail.python.org/mailman/listinfo/python-list

Testing threading

2005-04-05 Thread George Sakkis
t()) pool = PooledExecutor(minPoolSize=4) for n,s in pool.dispatch(tasks): print "The square root of %d is %s" % (n,s) George -- http://mail.python.org/mailman/listinfo/python-list

Puzzling OO design problem

2005-04-08 Thread George Sakkis
her a general design pattern or some clever python metaprogramming hack ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: Puzzling OO design problem

2005-04-08 Thread George Sakkis
with two versions each). > > -jackdied I intentionally abstracted the problem to remove the irrelevant details, but here's a more concrete (though still simplified) example. I hope it is more clear now. George #= def worldModelFactory(version): if

Re: Puzzling OO design problem

2005-04-08 Thread George Sakkis
ind an appropriate design pattern that avoids the need for the dummy classes. Any ideas for (2) or (3) ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Equivalent to Java Interfaces?

2005-04-08 Thread George Sakkis
ml). Protocols in a way extend (no pun intended) typical interfaces by giving more flexibility to independent components to talk to each other. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Puzzling OO design problem

2005-04-09 Thread George Sakkis
"Michael Spencer" <[EMAIL PROTECTED]> wrote: > > George, > > since you explicit allowed metaprogramming hacks :-), how about something like > this (not tested beyond what you see): > > [snipped] > Nice try, but ideally all boilerplate classes would r

Re: Puzzling OO design problem

2005-04-09 Thread George Sakkis
n the lattice is the addition of new columns (versions). > Interesting question. I learned a lot while thinking about that. > > - Dirk I learned too, and I'm glad for this learning side-effect :-) Thanks ! George -- http://mail.python.org/mailman/listinfo/python-list

Re: Puzzling OO design problem

2005-04-09 Thread George Sakkis
ing like a template-based code generating script that creates all the boilerplate code for each version before you start customising it ? This could be an option, though you'd better be pretty sure that the template is frozen; you don't want to go back and fill in the template more

Re: Puzzling OO design problem

2005-04-11 Thread George Sakkis
n each version. So I tried to refine this recipe a little and I pushed down the boilerplate code from 3 lines to one word; laziness is a virtue :-) Below is the test only; I posted the main module to http://rafb.net/paste/results/Hweu3t19.html to avoid messing

Re: Global Variables

2005-04-12 Thread George Sakkis
Use 'global': def change_filename(): global filename filename=raw_input() def change_path(): global path path=raw_input() Even better, don't use globals at all; in 99% if the time, there are better ways to achieve the same effect. George -- http://mail.pyt

Re: def a((b,c,d),e):

2005-04-19 Thread George Sakkis
s and *varargs were allowed too; check http://tinyurl.com/dcb2q for a relevant thread. George -- http://mail.python.org/mailman/listinfo/python-list

Re: def a((b,c,d),e):

2005-04-19 Thread George Sakkis
note which names in the expression refer to other arguments instead of the enclosing scope. Also the binding of arguments to values would no more be considered "parallel"; the order of the bindings would be significant, and even worse, it would have to be computed for each call, as the prologLikeSum example shows. Probably-I'm-just-rambling-ly yrs George -- http://mail.python.org/mailman/listinfo/python-list

Re: def a((b,c,d),e):

2005-04-19 Thread George Sakkis
e been using IPython for some months now as my standard interpreter; with features such as tab completion, logged history, 'macros' and integration with the shell, shortcuts are everywhere ! Tab completion does not work for named function arguments yet, but it should be possible with introspection. George -- http://mail.python.org/mailman/listinfo/python-list

Decorator pattern for new-style classes ?

2005-04-23 Thread George Sakkis
not called for missing special methods. The workarounds I saw or can think of are so ugly that I prefer to to use an old-style class after a long time :-/ George -- http://mail.python.org/mailman/listinfo/python-list

Re: HTML cleaner?

2005-04-24 Thread George Sakkis
Probably you're looking for Beautiful Soup: http://www.crummy.com/software/BeautifulSoup/ George -- http://mail.python.org/mailman/listinfo/python-list

Injecting code into a function

2005-04-25 Thread George Sakkis
ally in the end of the function if there are more than one exit points. I guess a solution will involve a good deal bytecode hacking, on which i know very little; if there's a link to a (relatively) simple HOWTO, it would be very useful. Thanks, George -- http://mail.python.org/mailman/listinfo/python-list

Re: Injecting code into a function

2005-04-25 Thread George Sakkis
t sys > sys.settrace(trace_returns) > > foo(1,2) > Thanks, that's the closest to what I wanted. A minor point I didn't quite get from the documentation is how to set a local trace instead of a global (sys) trace. Also, there's no sys.gettrace() to return the current tracer; is there a way around this ? George -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythonic way to do static local variables?

2005-04-25 Thread George Sakkis
bject): def foo(self): try: Foo.foo.im_func.x += 1 except AttributeError: Foo.foo.im_func.x = 1 return Foo.foo.x foo = Foo().foo for i in xrange(10): print foo() Hope this helps, George -- http://mail.python.org/mailman/listinfo/python-list

Re: Quote-aware string splitting

2005-04-25 Thread George Sakkis
2'] > I don't know if this is as good as CSV's splitter, but it works reasonably well for me: import re regex = re.compile(r''' '.*?' | # single quoted substring ".*?" | # double quoted substring \S+ # all the rest ''', re.VERBOSE) print regex.findall(''' This is 'single "quoted" string' followed by a "double 'quoted' string" ''') George -- http://mail.python.org/mailman/listinfo/python-list

Re: Quote-aware string splitting

2005-04-25 Thread George Sakkis
RBOSE) Oh, and if your strings may span more than one line, replace re.VERBOSE with re.VERBOSE | re.DOTALL. George -- http://mail.python.org/mailman/listinfo/python-list

Re: Injecting code into a function

2005-04-25 Thread George Sakkis
n-interactively ? I tried running it from a script or importing it from a module but it returns None. Very strange... George -- http://mail.python.org/mailman/listinfo/python-list

Re: Injecting code into a function

2005-04-25 Thread George Sakkis
he cookbook: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/410698. George -- http://mail.python.org/mailman/listinfo/python-list

Komodo syntax checking for python2.4

2005-04-26 Thread George Sakkis
s anyone have the same problem with background syntax checking on 2.4 ? Thanks, George -- http://mail.python.org/mailman/listinfo/python-list

Re: Komodo syntax checking for python2.4

2005-04-26 Thread George Sakkis
"Trent Mick" wrote: > George, > > My suspicion is that the difference is that you are using a Cygwin > Python and it is using Un*x-style process return values. What do the > following return for your Python. > > For me on Windows (with ActivePython 2.4): >

Re: Good morning or good evening depending upon your location. I want to ask you the most important question of your life. Your joy or sorrow for all eternity depends upon your answer. The question is: Are you saved? It is not a question of how good you are, nor if you are a church member, but are you saved? Are you sure you will go to Heaven when you die? GOOGLE·NEWSGROUP·POST·151

2005-04-27 Thread George Sakkis
wrote in message news:[EMAIL PROTECTED] > Reports to [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], > [EMAIL PROTECTED], [EMAIL PROTECTED] > > And do not feed the troll! I'm afraid he's not a troll. He's just a lame spammer, doesn't need feeding to survive... In any case, the hell with

Numeric/Numarray equivalent to zip ?

2005-04-30 Thread George Sakkis
this excellent library, but if not, both would be useful to know. Thanks, George -- http://mail.python.org/mailman/listinfo/python-list

Recovering deleted files

2013-12-26 Thread George Tang
I am new to python and was trying to program with txt files, and tried to move the txt file to a new directory. i did not read very carefully about what shutil.move(src, dst) does and it deleted some of my files. How do i recover my lost files. plz help! -- https://mail.python.org/mailman/listi

Re: tuples in conditional assignment (Ben Finney)

2015-11-24 Thread George Trojan
Ben Finney writes: Ben Finney Date: 11/24/2015 04:49 AM To: python-list@python.org George Trojan writes: The following code has bitten me recently: t=(0,1) x,y=t if t else 8, 9 print(x, y) (0, 1) 9 You can simplify this by taking assignment out of the picture:: >>>

Python 3.1 test issue

2015-12-16 Thread George Trojan
uot;: null, "failfast": false, "output_on_failure": false, "use_resources": ["curses", "network", "decimal", "cpu", "subprocess", "urlfetch"], "pgo": false, "timeout": null}] gtrojan 22889 336 0 17:36 pts/11 00:00:00 grep --color=auto 15758 Is this a problem? George -- https://mail.python.org/mailman/listinfo/python-list

Re: Python 3.1 test issue

2015-12-18 Thread George Trojan
On 12/16/2015 8:07 PM, Terry Reedy wrote: On 12/16/2015 1:22 PM, George Trojan wrote: I installed Python 3.1 on RHEL 7.2. According to the output below, you installed 3.5.1. Much better than the years old 3.1. This was not my only mistake. I ran the test on Fedora 19, not RHEL 7.2. The

Re: If you were starting a project with XML datasource using python

2015-01-05 Thread George Silva
ay just have fewer > > "options" for how to notate basic data. > > JSON corresponds much more closely to Python data types, but > converting from one to the other can't improve matters any. > > ChrisA > -- > https://mail.python.org/mailman/li

when to use == and when to use is

2014-03-10 Thread George Trojan
efficient? My use-case scenario are matplotlib objects, the __eq__ operator might involve a bit of work. The "if" statement is a selector in a callback. I know that obj is one of obj_0, ..., or none of them. I do not care if obj_1 is equal to obj_2. George -- https://mail.python.org/mailma

Micro Python -- a lean and efficient implementation of Python 3

2014-06-03 Thread Damien George
Hi, We would like to announce Micro Python, an implementation of Python 3 optimised to have a low memory footprint. While Python has many attractive features, current implementations (read CPython) are not suited for embedded devices, such as microcontrollers and small systems-on-a-chip. This is

anaconda bug?

2015-03-16 Thread George Trojan
TCL_LIBRARY="$TCL_LIBRARY" TCL_LIBRARY="/home/gtrojan/miniconda3/lib/tcl8.5" export TCL_LIBRARY _OLD_TK_LIBRARY="$TK_LIBRARY" TK_LIBRARY="/home/gtrojan/miniconda3/lib/tk8.5" export TK_LIBRARY I have found somewhat similar bug report: https://github.com/conda/conda/issues/348. George -- https://mail.python.org/mailman/listinfo/python-list

Re: Re: anaconda bug?

2015-03-17 Thread George Trojan
fails. So the other fix would be to manually create symlinks after running pyvenv, or modify Continuum Analytics pyvenv to do that. There is no issue with pyvenv when Python is built from the source, the first directory in the path is where tcl is found by configure and that does not change in virtual environment. I found another similar bug report here: https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/Q9xvJT8khTs Looks this has not been fixed. George -- https://mail.python.org/mailman/listinfo/python-list

MicroPython 1.4.1 released

2015-04-04 Thread Damien George
n fixed and the docs have been improved. A full change log is available at https://micropython.org/resources/micropython-ChangeLog.txt . For more information about the project please visit http://micropython.org/ https://github.com/micropython/micropython Best regards, Damien George. -- https://ma

problem with netCDF4 OpenDAP

2015-08-14 Thread George Trojan
equested URL /pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc.dds was not found on this server. ncdump: http://www1.ncdc.noaa.gov/pub/data/cmb/ersst/v3b/netcdf/ersst.201507.nc: NetCDF: file not found George -- https://mail.python.org/mailman/listinfo/python-list

Re: Unbuffered stderr in Python 3

2015-11-03 Thread George Trojan
aceback (most recent call last): Here buffer is flushed on close, after typing ^C. (devenv-3.4.1) dilbert@gtrojan> python x.py False ^CaTraceback (most recent call last): George -- https://mail.python.org/mailman/listinfo/python-list

Re: Unbuffered stderr in Python 3

2015-11-03 Thread George Trojan
Forwarded Message Subject:Re: Unbuffered stderr in Python 3 Date: Tue, 03 Nov 2015 18:03:51 + From: George Trojan To: python-list@python.org On 11/03/2015 05:00 PM, python-list-requ...@python.org wrote: On Mon, 02 Nov 2015 18:52:55 +1100, Steven

tuples in conditional assignment

2015-11-23 Thread George Trojan
The following code has bitten me recently: >>> t=(0,1) >>> x,y=t if t else 8, 9 >>> print(x, y) (0, 1) 9 I was assuming that a comma has the highest order of evaluation, that is the expression 8, 9 should make a tuple. Why this is not the case? George -- http

Re: PEP8 and 4 spaces

2014-07-04 Thread George Silva
tand that he has yet to master the > intricacies of pip, but I'm sure that'll come with practice, or has he > given up? > > > -- > My fellow Pythonistas, ask not what our language can do for you, ask what > you can do for our language. > > Mark Lawrence > > --- &g

Re: PEP8 and 4 spaces

2014-07-04 Thread George Silva
> I assume any sane editor has similar functionality. I see my coworkers > using vim, sublime, eclipse, and X-code. They all appear to do these > things, and I would thus classify any of them as sane editors. I'm sure > there are others. If the tool you're (in the generic sense of "you") > usin

Re: Topological Overlap

2014-08-16 Thread George Silva
ference > I am trying to find the topological overlap of that data > > I have been searching for any sample in python but i dont seem to find > any. > > Any suggestion in start with are appreciated > > > Thanks > Lav > > -- > https://mail.python.org/mailman/li

Re: PyCharm refactoring tool?

2014-09-15 Thread George Silva
seems > to describe a number of code refactorings which aren't available for Python > code. For example, I don't see an "invert boolean" refactoring. > > How useful is PyCharm's refactoring subsystem? > > Thx, > > Skip > > > -- >

strange numpy behaviour

2014-10-08 Thread George Trojan
>>> a=np.ma.array([0, 1], dtype=np.int8, mask=[1, 0]) >>> a masked_array(data = [-- 1], mask = [ True False], fill_value = 99) >>> a.data array([0, 1], dtype=int8) >>> a.filled() array([63, 1], dtype=int8) <--- Why 63? >>> What do you think? George -- https://mail.python.org/mailman/listinfo/python-list

Error Importing MySQLdb

2012-01-08 Thread David George
Hello there, I have been trying for awhile now to get MySQLdb working. I am currently getting this error when trying to import it: >>> import MySQLdb Traceback (most recent call last): File "", line 1, in File "build/bdist.macosx-10.7-intel/egg/MySQLdb/init.py", line 19, in File "build/bdist

Re:

2012-01-08 Thread David George
Sean Wolfe wrote: is anybody out there? On Sat, Jan 7, 2012 at 5:07 AM, abdullah zuberi wrote: hello ? Hello there Sean, How are you doing? -- http://mail.python.org/mailman/listinfo/python-list

Failure to build Python 3.3.2 SSL Module

2013-05-01 Thread George T
1m20.759s user2m6.167s sys 0m8.557s """ Thanks in advance! Cheers, George -- http://mail.python.org/mailman/listinfo/python-list

Problem with writing an interface for system() call...

2006-01-09 Thread haynes george
hi .. I was reading the tutorial "Extending and Embedding the python interpreter" available with python .. http://www.python.org/doc/2.2.3/ext/ext.html As per given in the tutorial i created an interface to the system() system call. this is the code of my module Code: #include static PyObj

Re: search multiple dictionaries efficiently?

2006-01-17 Thread George Sakkis
icts): return [d.get(value) for d in dicts if value in d] >>> a = {'x':1, 'y':2} >>> b = {'y':4, 'z':7} >>> lookup('y', a, b) [2, 4] It's not the *most* efficient way because value is looked up twice if it is co

<    1   2   3   4   5   6   7   8   9   10   >