Re: Recommend decent Computer Science books

2012-06-27 Thread Greg
On Wednesday, June 27, 2012 2:00:03 PM UTC-7, David Thomas wrote: > Hi I know that this is a group about Python. But I am just wondering if > anybody can recommend any introductory/good books on Conputer Science. > > Kind regards I recommend "Python Programming: An Introduction to Computer Scie

Re: Having trouble getting Hello World to appear

2022-04-21 Thread Greg
I downloaded and installed the auto version of the software. I go to the director C:\google-python-exercises> *python hello.py* I am running Windows. What am I doing incorrectly? I had the zip file installed under my One Drive and then moved it to my C drive Patiently waiting, G

Verifying I installed Python correctly

2022-04-25 Thread Greg
I am trying to get Hello World to appear under my directory. The files of *C:\Users\gd752>cd C:\google-python-exercises> python hello.py* *The system cannot find the path specified.* *C:\Users\gd752>cd C:\google-python-exercises>* *The syntax of the command is incorrect.* I installed version 3.1

odd behavior

2005-11-11 Thread Greg
Forgive me, and be kind, as I am just a newby learning this language out of M.L. Hetland's book. The following behavior of 2.4.1 seems very strange >>> x = ['aardvark', 'abalone', 'acme', 'add', 'aerate'] >>> x.sort(key=len) >>> x ['add', 'acme', 'aerate', 'abalone', 'aardvark'] >>> x.sort(re

Read 16 bit integer complex data

2005-04-07 Thread Greg
number, next 16 bits represent the imaginary. I've looked at the "unpack" command, but from what I can tell it isn't really efficient for a large data sample. Is there a command or method around to read in large amounts of 16 bit complex data? Thanks in advance for your help,

Re: Read 16 bit integer complex data

2005-04-07 Thread Greg
That worked, thanks a lot. Greg -- http://mail.python.org/mailman/listinfo/python-list

encoding problem with BeautifulSoup - problem when writing parsed text to file

2011-10-05 Thread Greg
Hi, I am having some encoding problems when I first parse stuff from a non-english website using BeautifulSoup and then write the results to a txt file. I have the text both as a normal (text) and as a unicode string (utext): print repr(text) 'Branie zak\xc2\xb3adnik\xc3\xb3w' print repr(utext) u

Re: encoding problem with BeautifulSoup - problem when writing parsed text to file

2011-10-05 Thread Greg
teven D'Aprano wrote: > On Wed, 05 Oct 2011 16:35:59 -0700, Greg wrote: > > Hi, I am having some encoding problems when I first parse stuff from a > > non-english website using BeautifulSoup and then write the results to a > > txt file. > > If you haven't alrea

Re: SDL doesn't cope well with FreeSans

2006-07-26 Thread greg
Carl Banks wrote: > Greg Ewing wrote: > > The characters come out slightly > > higglety-pigglety -- randomly displaced up or down > > a pixel or so from the baseline. > It would depend on how you're displaying them, I would think. I've seen the same thing happ

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-20 Thread greg
e anywhere near to succeeding. http://www.cosc.canterbury.ac.nz/greg.ewing/python_gui/ -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: import confused by contents of working directory

2006-06-03 Thread greg
ed to the directory containing the test program. The moral is not to put your test program in the same directory as your package files. (Or if you must, have it delete sys.path[0] before importing anything.) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Selection in Tkinter Text widget.

2006-06-03 Thread greg
be one selection visible at a time, so that it's always clear what you're operating on. (They seem to be breaking that now in MacOSX, which I think is a backward step...) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: New to Python: Do we have the concept of Hash in Python?

2006-06-03 Thread greg
#x27;ll be interesting to see whether you *still* want to switch back to Ruby after getting to know Python for two years! -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Allowing zero-dimensional subscripts

2006-06-10 Thread greg
Carl Banks wrote: > Think of it this way: an array with n-dimensions of length 3 would have > 3**n total entries. How many entries would a 0-dimensional array have? > 3**0 == 1. Er, hang on a minute. Along which dimension of this 0-dimensional array does it have a length of 3? :-)

Re: Adding extra frames to traceback in C module

2006-06-10 Thread greg
cfile); Py_XDECREF(py_funcname); Py_XDECREF(empty_tuple); Py_XDECREF(empty_string); Py_XDECREF(py_code); Py_XDECREF(py_frame); } -- Greg -- http://mail.python.org/mailman/listinfo/python-list

ANN: PyGUI 1.7.2

2006-06-10 Thread greg
PyGUI 1.7.2 is now available: http://www.cosc.canterbury.ac.nz/~greg/python_gui/ This version adds support for multiple mouse buttons, mouse enter and leave events, enhancements to the BlobEdit example application, and a big pile of other enhancements and bug fixes. See the CHANGES.txt file

ANN: PyGUI 1.7.2-1

2006-06-10 Thread greg
I have uploaded a new PyGUI 1.7.2 package to correct a couple of errors in the setup.py file. http://www.cosc.canterbury.ac.nz/~greg/python_gui/ - What is PyGUI? -- PyGUI is an experimental highly-Pythonic cross-platform GUI API

Re: ANN: PyGUI 1.7.2-1

2006-06-12 Thread greg
at. It appears that you've encountered another one. I'm using a different method of dealing with this now, which will probably fix your problem as well. I've attached a replacement for GUI/Cocoa/Applications.py. Let me know if it works for you. -- Greg # # Pyth

ANN: Albow - A simple widget library for Pygame

2006-12-06 Thread greg
ALBOW - A Little Bit of Widgetry for PyGame --- Version 1.0 This is a very basic, no-frills widget set for creating a GUI using PyGame. It was originally developed for my PyWeek 3 competition entry, Sneak. I am documenting and releasing it as a separate pac

Re: merits of Lisp vs Python

2006-12-09 Thread greg
Bill Atkins wrote: > And mistakes in nesting show up as mistakes in > indenting. Er, hang on a moment... how do you *know* when you've got a mistake in indending? You must be visually verifying the indentation... rather like one does with Python code... -- Greg -- http://mail.python.

Re: Automatic debugging of copy by reference errors?

2006-12-09 Thread greg
reason being that the assignment is modifying the dictionary holding the namespace of the main module, which is referred to by the main module itself. So you are "changing an object that is being referred to by a living object". -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-11 Thread greg
acro expansion. You'd also need some very heavy-duty type inferencing. Python is extremely dynamic, even more so than Lisp. That's why compiling Python is hard, not because it doesn't have macros. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-11 Thread greg
On the plus side, Python makes less demands on the capabilities of the editor. All you really need is block-shifting commands. Bracket matching is handy for expressions but not vital, and you certainly don't need bracket-based auto-indenting. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Automatic debugging of copy by reference errors?

2006-12-11 Thread greg
such as adding two vectors, produces a new vector holding the result. In that case, two vectors could happily share a reference to a list of values (as long as there is nothing else that might modify the contents of the list). -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-11 Thread greg
lines of Python, I would estimate. Seeing as you asked, how much Python code have you or Ken edited? -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-11 Thread greg
ouldn't be Python any more, it'd be Lisp. And then all those great libraries wouldn't work with it, because they're for Python, not Lisp. :-( -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-11 Thread greg
Bill Atkins wrote: > greg <[EMAIL PROTECTED]> writes: > > > There's no way you could compile Python to efficient > > machine code just by macro expansion. You'd also need > > some very heavy-duty type inferencing. > > A compiler shifts a lot of deci

Re: merits of Lisp vs Python

2006-12-12 Thread greg
[EMAIL PROTECTED] wrote: > Does the word "TRONDANT" hold some special meaning for you? Er, no, in fact my brain raises a KeyError on it. Is it supposed to mean anything? -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-12 Thread greg
atically determine what the + operator needs to do here. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-12 Thread greg
think "kludgy" is a bit unfair, since this is a result of doing things in a very simple and uniform way -- rather a Lispy concept, I would have thought. :-) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-12 Thread greg
ed as "pathologically dynamic". All that dynamism is handy sometimes, but it does get in the way of improving efficiency. Often discussions take place on python-dev about ways to selectively limit the dynamism to make some optimisation possible. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-12 Thread greg
p would probably have required using macros. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-12 Thread greg
icitly if you need. This gives you exactly the same capabilities as symbols in Lisp. For example, due to the automatic interning, the string comparison in the following is just a pointer comparison: fred = 'hello' if fred == 'hello': print 'Greetings&#x

Re: merits of Lisp vs Python

2006-12-12 Thread greg
George Sakkis wrote: > I'm sure there should be more convincing examples for macros, but > neither this nor the 'unless' syntax sugar cuts it. Also, the new 'with' statement and associated protocol covers much of the ground that was left out by the existin

Re: merits of Lisp vs Python

2006-12-13 Thread greg
at Python *doesn't* have this. :-) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-13 Thread greg
Skill() skill.title = title skill.annotations = annotations skill.hints = hints skills[name] = skill This gives you a dictionary of Skill instances indexed by name, each one having a title and lists of annotation and hint strings. The rest of the system can process this however required. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Conditional iteration

2006-12-13 Thread greg
at wrote: > It is not the addional line containing 'if x > 0:' that bothers me, but the > additional indentation. I don't find the additional indentation bothersome. In fact I think it's helpful, because it makes it obvious that there is something else going on

Re: Multiple inheritance and __slots__

2006-12-14 Thread greg
u can only do that for one base class at a time. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-14 Thread greg
a line or two, this is not usually much of a problem, and is arguably more readable anyway. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Conditional iteration

2006-12-14 Thread greg
at wrote: > I think by approving > > a = b if condition else c Again, this allows something to be written as an expression that formerly could only be written as a statement, which is a much bigger gain than just crunching two statements into one. -- Greg -- http://mail.python.or

Re: Conditional iteration

2006-12-14 Thread greg
ry slightly to give another statement, and opinions differ on whether it would improve or hurt readability. Furthermore, Guido has considered this exact idea before, promoted using the same arguments, and rejected it, so it's unlikely he would change his mind this time around. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: speed of python vs matlab.

2006-12-14 Thread greg
ng that they have comparable performance. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: The Famous Error Message: "ImportError: No module named python_script"

2006-12-14 Thread greg
e various ways of specifying additional places to look for imported modules, but that should be enough to get you going. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: The Famous Error Message: "ImportError: No module named python_script"

2006-12-14 Thread greg
by some chance you've got "Hide filename extensions" turned on in your View options, TURN IT OFF. It'll cause no end of confusion when you're trying to program. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread greg
time with the odd feature that capacitance came out in units of length. Picture the scene: Hobbyist walks into Dick Smith store and says "I'd like a 5cm capacitor, please." -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread greg
skill.reverse(resx, opnds) There's no need to macro-expand this code into every reversal function, when it can be done once as part of the framework that calls the reversal functions. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread greg
e and ordinary functions and methods operating on that data structure. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread greg
oes a manual correction process come out as simple as "don't > bother fixing the indentation if you don't care."? I think the point is that correcting indentation in Python is the equivalent of fixing misplaced parentheses in Lisp, and that they're about equally difficult. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread greg
n some people assume it will be without ever having tried it. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread greg
that the Lisp way is superior to the Python way in all respects, based on my experience with both. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread greg
Python demonstrating the gist of what could be done. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: CLPython (was Re: merits of Lisp vs Python)

2006-12-15 Thread greg
ing. Although I think I'd rather target Scheme than CL if I were doing it -- cleaner language, small yet still extremely good implementations available. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread greg
hon as it is in Lisp, but that doesn't mean it can't be done. (I agree that the proffered example was not an instance of "code is data", though.) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread greg
.signed_value, or whatever else is required. If this still doesn't cover the requirements, please explain and I'll try to adapt it accordingly. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread greg
in what looks like a procedural style, even though it's still purely functional. Read about "monads" if you want to know more -- it's truly mind-expanding (and possibly head-exploding:-) stuff... -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread greg
ction. This is even more evident in Smalltalk, where *all* control structures, without exception, are expressed in terms of code blocks, possibly with parameters. And Smalltalk has no macros, either, btw. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread greg
fine your own infix operators. And it doesn't even require a macro. :-) (Finding the trick to implementing this is left as an exercise for the googler.) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread greg
this disease from C). -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-15 Thread greg
ype "help", "copyright", "credits" or "license" for more information. >>> cmp("hello", "world") -1 >>> cmp([1,3], [1,2]) 1 -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-16 Thread greg
ght be able to handle this using a general method that searches the tree for a specified tag, e.g. env.find_tag("signed_value") -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-16 Thread greg
y it, for example, C. A Python tuple is like a C struct, and a Python list is like a C array. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-17 Thread greg
ys in which C structs are different from Python tuples, and C arrays are different from Python lists. But they're not the aspects I'm drawing an analogy between. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-18 Thread greg
the way they're used. This is the kind of thing for which Python tuples are mainly designed -- use as a struct whose members happen to be named by integers rather than strings. If you still don't understand, then I'm afraid I've run out of ideas on how to explain it. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-18 Thread greg
x27;, 'refresh', 'delete')) ], title = 'Barebones RSS Reader v1.0') self.channels = [ parse_rss_from_url(url) for url in [ 'http://planet.lisp.org/rss20.xml', 'http://feeds.theonion.com/theonion/daily']] def add_feed(self): ... def delete_feed(self): ... # etc. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: python-hosting.com projects: dead?

2006-12-19 Thread greg
ot that they're shutting down existing ones. Unless *my* reading comprehension skills have completely abandoned me. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: python-hosting.com projects: dead?

2006-12-20 Thread greg
of these accounts letting them know what you've done and how to get it re-enabled. Just shutting it down without any word could be seen as a bit rude. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: python-hosting.com projects: dead?

2006-12-20 Thread greg
Richard Jones wrote: > Actually, to clarify the DEFAULT configuration for Trac is to leave it open > to spam. That sounds like a really bad choice of default. A bit like the way Windows comes with all the "let anyone in the world send me a virus" options turned on...

Re: tuple.index()

2006-12-20 Thread greg
se them that way, but if you use them differently, you're on your own and can't complain if they don't have all the features you want. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-20 Thread greg
d size *and* immutable -- and the list, for everything else. So it's not really that lists are intended *only* for homogeneous collections, but for anything that can't be represented as a tuple for whichever reason. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-20 Thread greg
ist affects is what order the strings and agents are processed in. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

ANN: PyGUI 1.6

2006-02-12 Thread greg
PyGUI 1.6 is now available: http://www.cosc.canterbury.ac.nz/~greg/python_gui/ The major change in this version is that the Mac version is based on Cocoa instead of Carbon. This should provide a much better base for future development, but it does mean that MacOSX will now be required. (This

PyGUI 1.6: A Note for MacOSX Users

2006-02-28 Thread greg
ption of the project goals, see the PyGUI web page at the above address. The current version is available from: http://www.cosc.canterbury.ac.nz/~greg/python_gui/ -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 354: Enumerations in Python

2006-03-01 Thread greg
Steven D'Aprano wrote: > You can't shell an egg that isn't there. Yesterday upon the stair I shelled an egg that wasn't there. I'd shell the thing again today If only I could find a way. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 354: Enumerations in Python

2006-03-01 Thread greg
but that looks too much like 'e-number' rather than 'enum-ber'. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 354: Enumerations in Python

2006-03-01 Thread greg
t relies on them being integers or having those integer values. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 354: Enumerations in Python

2006-03-01 Thread greg
write the name twice, making the construct far less elegant. Maybe *this* is a good argument for making the enum object a class? Or maybe it's an argument for allowing decorators to operate on things other than functions, so you could write something like @enum Weekdays = ('mon', 'tue', etc...) -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 354: Enumerations in Python

2006-03-01 Thread greg
m these should wrap around. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Annoying behaviour of the != operator

2005-06-10 Thread greg
of arbitrary ordering would be to provide an ordering for all objects, whatever they might be. Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-03 Thread greg
add to it over time to cover any bugs that turn up. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 3107 and stronger typing (note: probably a newbie question)

2007-07-04 Thread greg
Roy Smith wrote: > greg <[EMAIL PROTECTED]> wrote: > > Then you get a bug report, you fix it, and you add a test > > for it so that particular bug can't happen again. > The TDD zealots would tell you you've got the order wrong. Instead of > "fix,

Re: Building a Python app with Mozilla

2007-07-04 Thread greg
ontained -- Aqua buttons just don't scale down like that. :-( -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Portable general timestamp format, not 2038-limited

2007-07-04 Thread greg
James Harris wrote: > With that the time would range to +/- 9000 > quintillion years (18 digits) Use the Big Bang as the epoch, and you won't have to worry about negative timestamps. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: object references/memory access

2007-07-04 Thread greg
y of today's desktop unix systems. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: MethodType/FunctionType and decorators

2007-07-04 Thread greg
self' and a reference to the underlying function. This is known as a "bound method". (You also get an instancemethod if you look the method up in the class, i.e. A.method but in that case the instancemethod doesn't contain a value for 'self', and is known as an

Re: Building a Python app with Mozilla

2007-07-10 Thread greg
point was that using native widgets is not in itself enough to ensure a native experience. There are conventions about *how* the widgets are used, and other things about the behaviour that don't relate to widgets at all. Native widgets are certainly a better thing to start from, though

Re: Portable general timestamp format, not 2038-limited

2007-07-10 Thread greg
decide if and when the Big Crunch is going to happen, we may be able to figure out once and for all how many bits we need in the timestamp. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: object references/memory access

2007-07-10 Thread greg
e requirement. It seems like this would have been an even more important issue in the timesharing environments where unix originated. You wouldn't want everyone's text editors suddenly starting to take half a second to respond to keystrokes just because someone launched "cc -O4 foo.

Re: The best platform and editor for Python

2007-07-10 Thread greg
Nicola Musatti wrote: > It's in *commercial* projects that > features nobody really needs are not implemented. Profit is > fundamental in convincing you that you really need the features. In Soviet Russia, you don't need features, features need *you*. -- Greg -- http://mail

Re: os.wait() losing child?

2007-07-10 Thread greg
ght be safer to do while pids: ... -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: os.wait() losing child?

2007-07-11 Thread greg
(lambda x,y: x and (y>=10), counts): break continue print "Child Process %d (%d) terminated, restarting" % (i, pid), p[i] = Popen('sleep 1', shell=True) pids[p[i].pid] = i print "(%d)" % p[i].pid -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Can I change one line in a file without rewriting the whole thing?

2007-07-14 Thread greg
ne in the file needs to be re-written, one way or another. If you're doing this sort of thing a lot, and need it to be faster than reading and rewriting the file, you may need to look into using a more sophisticated format on disk than a plain file. -- Greg -- http://mail.python.org/ma

Re: Circular import problem

2007-07-14 Thread greg
every module that uses it. Importing something more than once does no harm. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

ANN: Snobol 1.0

2007-07-22 Thread greg
ry.ac.nz/greg.ewing/python/Snobol.tar.gz There's no manual yet, but there's a fairly complete set of docstrings and some test cases to figure it out from. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Floats as keys in dict

2007-08-01 Thread greg
a different data structure. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Redirecting stderr to null and revert

2007-08-07 Thread greg
7;, not the one in os). Then your revertStderr function will work. BTW I'd arrange for the reversion to be done in a try-finally, e.g. nullStderr() try: do_something() finally: revertStderr() so you won't get stuck with a redirected stderr if an exception occurs, and thereby not be able to see the traceback! -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Importing * From a Package

2007-08-07 Thread greg
hasn't been imported before, it has to be loaded into memory, which is expensive. If it has been imported before, then you're just creating another reference to the same module object, which is very cheap. An import * just does the cheap part, and leaves you to explicitly ask for the expensive

Re: Something in the function tutorial confused me.

2007-08-07 Thread greg
lowing version: def f(x, y = []): y = [] y.append(x) print y f(17) f(42) Try to work out what it will do, then try it, and see if you understand why it does what it does. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Issues of state

2007-08-08 Thread greg
an HTTP one. It persists throughout the entire use session of the application, for one thing, and there is heaps of state being kept on both sides of the connection. There's also a very high communication bandwidth between them. There's really no comparison. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Issues of state

2007-08-08 Thread greg
r interface. In fact, the more state is kept, the *less* bandwidth you need, because communication can make use of shared context to compress the messages. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Something in the function tutorial confused me.

2007-08-08 Thread greg
"assignment", mean the same thing to the person on the other end. The interpreter always interprets things unambiguously. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

  1   2   3   4   5   6   7   8   9   10   >