Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Greg Ewing
can start wherever you want. You can't slice them, true, but you can't have everything. :-) -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Greg Ewing
age syntax would be rather high :-) Not to mention the sanity of everyone's editors when they try to do bracket matching! -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinf

Re: Why Python does *SLICING* the way it does??

2005-04-21 Thread Greg Ewing
): return list.__getitem__(self, i - self.base) # etc... -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Re: generate De Bruijn sequence memory and string vs lists

2014-01-24 Thread Greg Ewing
ple? Whatever it is, it seems like there should be a more efficient way than materialising the whole umpteen-gigabyte sequence. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

paramiko transport and invoke_shell

2016-01-20 Thread greg . szewski
=via_host, via_user='user2', via_auth='pass2') print ssht.run('uname -a') print ssht.run_in_shell('sudo su - user') ssht.run_in_shell('password_for_above') print ssht.run_in_shell('id') # above id should return user Regards Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: Classes

2014-11-03 Thread Greg Ewing
but the way the paragraph is worded, it sounds like it's just been blindly lifted from some Java or C++ book. -- Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: IDE for python

2014-05-28 Thread Greg Schroeder
like about it. Greg -- https://mail.python.org/mailman/listinfo/python-list

Re: IDE for python

2014-05-28 Thread Greg Schroeder
On Wed, 2014-05-28 at 22:55 +1000, Chris Angelico wrote: > On Wed, May 28, 2014 at 9:46 PM, Greg Schroeder wrote: > >> > Please suggest, if we have any free ide for python development. > > > > Anything that writes text is fine. > > I recommend the standard text e

Suds and Complex Sequences

2013-09-17 Thread Greg Lindstrom
to do this. Does anyone out there know how I can generate the request? Thanks for your time, Greg Lindstrom -- https://mail.python.org/mailman/listinfo/python-list

Re: ANN: PyGUI 2.5

2011-09-14 Thread Greg Ewing
more than one view of a model are at odds with the way Tk works. Anyone who wants to have a go at it is welcome to try, though. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: TK + MVC

2011-10-02 Thread Greg Ewing
Emeka wrote: Greg, Do you have an example where the Controller is connected? No, in fact I've never really felt the need for anything called a Controller in the GUI stuff I've done. I just have Models and Views. Models hold the data, and Views display it and handle input. If you c

Overlaying PDF with data

2011-12-22 Thread Greg Lindstrom
ng with health care forms which are quite complex (over 150 fields to potentially populate) and would like to do it as painlessly as possible. I'm running Python 2.7 on Windows. Thanks for any advice you may have, --greg -- http://mail.python.org/mailman/listinfo/python-list

Web Testing Frameworks

2013-02-12 Thread Greg Lindstrom
ation/documentation/training on how to test a web site? Thanks! --greg -- http://mail.python.org/mailman/listinfo/python-list

access to preallocated block of memory?

2005-12-14 Thread Greg Copeland
e reserved block and a length, and have the memory accessible. Is there some existing python object/facility I can use or will I need to create a custom module? Any tips, hints, or pointers would certainly be appreciated! Thanks, Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: access to preallocated block of memory?

2005-12-15 Thread Greg Copeland
So array can not map a pre-existing chunk of memory? I did not port the mmap module because such semantics don't exist on VxWorks. Based on comments thus far, it looks like mmap is my best bet here? Any other options? -- http://mail.python.org/mailman/listinfo/python-list

Re: why does php have a standard SQL module and Python doesn't !?

2005-12-15 Thread Greg Copeland
To build on Heiko's comment's, and to be clear, Python does have a standard interface description, to which many SQL interfaces are available. -- http://mail.python.org/mailman/listinfo/python-list

Re: access to preallocated block of memory?

2005-12-15 Thread Greg Copeland
for any confusion my original question may of created. I was rushed when I posted it. Hopefully this posting will be more clear as to my intentions and needs. Sincerely, Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: access to preallocated block of memory?

2005-12-15 Thread Greg Copeland
I think you're getting caught in OS/platform semantics rather than a python solution. I already have access to the block on memory...I simply need information about existing python facilities which will allow me to expose the block to python as a native type...from which I can read byte for byte a

Re: access to preallocated block of memory?

2005-12-15 Thread Greg Copeland
Based on the answers thus far, I suspect I'll being traveling this road shortly. Thanks, Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: access to preallocated block of memory?

2005-12-15 Thread Greg Copeland
Dang it. That's what I suspected. Thanks! Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: access to preallocated block of memory?

2005-12-16 Thread Greg Copeland
That certainly looks interesting. I'll check it out right now. Thanks! Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Shed Skin (Python-to-C++ Compiler) 0.0.5.9

2005-12-16 Thread Greg Copeland
I've been following this project with great interest. If you don't mind me asking, can you please include links, if available, when you post updates? Great Stuff! Keep in coming! Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: access to preallocated block of memory?

2005-12-16 Thread Greg Copeland
What license does the code use? The PKG-INFO file says its MIT? This accurate? I'm still looking over the code, but it looks like I can do exactly what I need with only minor changes. -- http://mail.python.org/mailman/listinfo/python-list

Re: SMP, GIL and Threads

2005-12-16 Thread Greg Copeland
atify your concurrent access requirements. Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: PythonWin troubleshooting

2005-12-17 Thread Greg Chapman
just delete the above key, and PythonWin will recreate it the next time it is run). I guess there is no guarantee that you will not run into this again, but, as I said, I have not seen it recur with the latest builds of PythonWin. --- Greg Chapman -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido at Google

2005-12-22 Thread Greg Stein
Guido would acknowledge a query, but never announce it. That's not his style. This should have a positive impact on Python. His job description has a *very* significant portion of his time dedicated specifically to working on Python. (much more than his previous "one day a week" jobs have given hi

Re: Guido at Google

2005-12-22 Thread Greg Stein
50% "on" 100% "with" On 12/22/05, Jay Parlar <[EMAIL PROTECTED]> wrote: > > On Dec 22, 2005, at 2:20 PM, Greg Stein wrote: > > Guido would acknowledge a query, but never announce it. That's not his > > style. > > > > This shoul

Application Portability?

2005-12-29 Thread greg . kujawa
I have a CRM application that I've written in Ruby that currently runs on Win32 clients as well as Linux ARM clients (Sharp Zaurus PDA's). The application uses Qt for its GUI presentation and XMLRPC calls to push/pull contact data back and forth. It suits my purposes, but I am looking to port it to

Re: Application Portability?

2005-12-30 Thread greg . kujawa
Neil Benn wrote: > Hello, > > I know that this isn't a fashionable thing to write on a > dynamic language newsgroup but I would really recommend switching to > Java for your work if you are looking at recoding it. I'm running Java > on handhelds and it works well. If you want to use dy

Re: exec a string in an embedded environment

2006-01-11 Thread Greg Copeland
sing it for some time now. Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: exec a string in an embedded environment

2006-01-12 Thread Greg Copeland
I would be happy to share my point with you. In fact, I'm fixing a minor memory leak (socket module; vxWorks specific) in Python 2.3.4 (ported version) today. My port is actually on BE XScale. Email me at g t copeland2002@@ya hoo...com and I'll be happy to talk more with you. -- http://mail.py

SDL doesn't cope well with FreeSans

2006-07-26 Thread Greg Ewing
, too. The fonts that come with MacOSX don't have these problems, so the fault doesn't seem to be with SDL or FreeType. Has anyone else noticed this? If it's a problem with the quality of FreeSans, can anyone recommend a free Helvetica-like font family that doesn't have this proble

Re: How to catch python's STDOUT

2006-07-31 Thread Greg Ewing
n replace sys.stdout with any object having a write() method which does whatever you want with the output. You can similarly replace sys.stderr to capture output written to standard error. -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://ww

ANN: Quest for the Holy Grail (a PyGame game)

2006-07-31 Thread Greg Ewing
age: http://www.cosc.canterbury.ac.nz/greg.ewing/grailquest/index.html It requires Python 2.3 or later and PyGame with SDL_image and SDL_ttf support. That's all! Comments, suggestions and amusing gameplay anecdotes are welcome. Have fun, -- Greg Ewing, Computer Science Dept, University of Canterbury, Ch

Re: time.localtime() Format Question

2006-08-20 Thread Greg Krohn
I'm sorry I didn't have time to grep your entire post, but maybe this will help: >>> import time >>> t = time.localtime() >>> t (2006, 8, 20, 12, 48, 52, 6, 232, 1) >>> time.strftime('%a, %d %b %Y', t) 'Sun, 20 Aug 2006' -greg -- http://mail.python.org/mailman/listinfo/python-list

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

2006-10-20 Thread Greg Ewing
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: What is Expressiveness in a Computer Language

2006-06-21 Thread Greg Buchholz
George Neuner wrote: > You can't totally prevent it ... if the index computation involves > types having a wider range, frequently the solution is to compute a > wide index value and then narrow it. But if the wider value is out of > range for the narrow type you have a problem. > ...snip... > > T

Re: What is Expressiveness in a Computer Language

2006-06-26 Thread Greg Buchholz
Chris F Clark wrote: > Thus, as we traverse a list, the first element might be an integer, > the second a floating point value, the third a sub-list, the fourth > and fifth, two more integers, and so on. If you look statically at > the head of the list, we have a very wide union of types going by.

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Greg Buchholz
Chris F Clark wrote: > Very impressive. It looks right to me and simple enough to > understand. I must find the time to learn a modern FP language. Can > you write a fold for this that prints the data as a binary tree of > triples? I have to believe it isn't that hard {- Refactoring this a

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Greg Buchholz
ray, so you can't use an index from one array with a different array. You'll probably also enjoy the paper... "Eliminating Array Bound Checking Through Dependent Types" http://citeseer.ist.psu.edu/xi98eliminating.html ...and DML itself... http://www.cs.bu.edu/~hw

Re: What is Expressiveness in a Computer Language

2006-06-27 Thread Greg Buchholz
ng like... (define (apply fun args) (eval (cons fun args))) ...but "eval" seems a little like overkill. Is there a better way? Greg Buchholz -- http://mail.python.org/mailman/listinfo/python-list

Re: [Pyrex] pyrex functions to replace a method (Re: replace a method in class: how?)

2006-06-27 Thread Greg Ewing
ore putting it in the class. I have suggested that builtin functions should be given the same method-binding behaviour as interpreted functions. The idea wasn't rejected out of hand, but I don't think anything has been done about it yet. -- Greg -- http://mail.python.org/mailman/listinfo/python-list

using TreeBuilder in an ElementTree like way

2006-06-27 Thread Greg Aumann
I am trying to write some python code for a library that reads an XML-like language from a file into elementtree data structures. Then I want to be able to read and/or modify the structure and then be able to write it out either as XML or in the original format. I really want the api for the XM

Re: [Pyrex] pyrex functions to replace a method (Re: replace a method in class: how?)

2006-06-28 Thread Greg Ewing
class C(str): pass C.ord = new.instancemethod(ord, None, C) c = C("a") print c.ord() -- Greg -- http://mail.python.org/mailman/listinfo/python-list

Python business software?

2006-11-23 Thread Greg Lindstrom
so it would be an option. Thanks for you help, --greg -- http://mail.python.org/mailman/listinfo/python-list

Re: merits of Lisp vs Python

2006-12-09 Thread Greg Menke
Paul Rubin writes: > [EMAIL PROTECTED] (Rob Warnock) writes: > > Weird. This is exactly why I use *Lisp* -- because it stays > > completely readable even if you don't use it on a daily basis!!! > > Hmm. I haven't used Lisp in a while and no longer find it so > readable

Re: merits of Lisp vs Python

2006-12-11 Thread Greg Menke
Paul Rubin writes: > André Thieme <[EMAIL PROTECTED]> writes: > > > import module > > > module.function = memoize(module.function) > > > > Yes, I mentioned that a bit earlier in this thread (not about the > > "during runtime" thing). > > I also said that many macros onl

Re: merits of Lisp vs Python

2006-12-11 Thread Greg Johnston
Stephen Eilert wrote: > So, let's suppose I now want to learn LISP (I did try, on several > occasions). What I would like to do would be to replace Python and code > GUI applications. Yes, those boring business-like applications that > have to access databases and consume those new-fangled web-ser

Re: Numarray, numeric, NumPy, scpy_core ??!!

2006-01-23 Thread greg . landrum
i?id=138791 (that's one of the applicable bug reports). A workaround to this problem is to add the option '-ffloat-store' to your CFLAGS. -greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Dual Core outlook

2006-02-07 Thread Greg Copeland
The short answer is, "maybe". Python will be CPU bound but not I/O bound. This means you can have multiple threads concurrently performing I/O. On the other hand, if you have two threads which are CPU bound, only one will run at a time. Having said that, there are plenty of ready work arounds.

PyDev/Eclipse Help

2006-02-20 Thread Greg Lindstrom
OK, I *know* it means I can't load PythonProjectWizard, but you get my drift, right?). Thanks for your help...see yo in Dallas!--greg -- http://mail.python.org/mailman/listinfo/python-list

inheritance with new-style classes - help

2005-05-06 Thread Greg Copeland
ngbut okay...let's look some more... >>> x.__dict__ {'_attrib': 'base'} What??! Where the heck did self._childAttrib go? And why? Can someone please shine some light here? Please? Thanks in advance, Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: inheritance with new-style classes - help

2005-05-06 Thread Greg Copeland
BTW, this is on Python 2.3.4. -- http://mail.python.org/mailman/listinfo/python-list

Re: inheritance with new-style classes - help

2005-05-06 Thread Greg Copeland
Doh! Child's __init__ was declared as __init(). Fixing that took care of it! Sorry for wasting the bandwidth! Cheers, Greg -- http://mail.python.org/mailman/listinfo/python-list

Re: pyvm -- faster python

2005-05-11 Thread Greg Ewing
ly intended to apply to *compiled* languages. -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Launch file in Notepad

2005-05-12 Thread Greg Krohn
If the \t was entered as a command line arg it will be interpreted as a \ and a t. For example: #test.py import sys b1 = sys.argv[1] b2 = "C:\test.txt" print b1 print b2 will result in this: C:\>test.py C:\test.txt C:\test.txt C: est.txt -greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Documentation (should be better?)

2005-05-12 Thread Greg Ewing
nk it would make a big difference in this area. -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Re: pygame on win32, image.fromstring()

2005-05-14 Thread Greg Krohn
;P" is for 8bit pallete indices. When I look at the properties of aceclub.bmp, Windows says it's Bit Depth is 4. I'm not sure if they're talking about the same thing, though. If so, you could probably use PIL to convert the depth. -greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Modifying a built-in function for logging purposes

2005-05-14 Thread Greg Krohn
ion... > > Bye. > Would this work? _file = file def file(path, mode): print path, mode return _file(path, mode) -greg -- http://mail.python.org/mailman/listinfo/python-list

Re: A Specific PyGame

2005-05-17 Thread Greg Krohn
razy, but I'm not finding any visited links that are productive. > I've also extracted everything out of .mozilla/.../history.dat. As you > can see, I'm looking for a specific answer to my specific query. > Perhaps you are thinking of GvR (Guido van Robot): http://gvr.so

Re: wxpython and wxtextctrl

2005-05-18 Thread Greg Krohn
new. The wxTextCtrl notation (vs wx.TextCtrl) is the old way (but it IS kept around for backwards compatablility). My guess is that your code is for for a newer version of wxPython than what you actually have. Try printing the version from in your code: import wxPyhon print wxPython.__version__

Re: Q: "...Learning with Python" ...a property that addition and multiplication have...

2005-05-25 Thread Greg Ewing
I would consider this more about thinking like a mathematician than a computer scientist!) -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Just remember that Python is sexy

2005-05-26 Thread Greg Ewing
xception". (Of course, you could get straight from "index" to "exception" that way too, but then there wouldn't be any excuse for mentioning sex. :-) -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Pyrex: step in for loop

2005-05-26 Thread Greg Ewing
7;d suggest using the for-loop to iterate over a contiguous range of integers and an expression that maps the loop variable to whatever you want. If you want the maximum possible speed, it *may* be faster to use a while loop instead and do your own index updating. But profile to make sure. --

Python Challenge 10?

2005-05-26 Thread Greg Ewing
Can someone give me a hint for No. 10? My MindBlaster card must be acting up -- I can't seem to tune into the author's brain waves on this one. I came up with what I thought was a perfectly good solution, but apparently it's wrong. :-( -- Greg Ewing, Computer Science Dept

Re: What are OOP's Jargons and Complexities?

2005-06-01 Thread Greg Ewing
Pascal just a little has resulted in a very successful family of languages (UCSD, Turbo, Apple Pascal, etc.) -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Python as client-side browser script language

2005-06-01 Thread Greg Ewing
ldn't be any difficulty with that. Python objects have complete control over which attributes can be read or written by Python code. That, together with restricting what the open() function can do, ought to provide a pretty good sandbox. -- Greg Ewing, Computer Science Dept, Univers

Re: Beginner question: Logs?

2005-06-02 Thread Greg Ewing
ly rarely be used. Better still, don't even *mention* it to a beginner. They don't need to know about it. At all. Really. -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Two questions

2005-06-02 Thread Greg Ewing
*have* to make them available to all other countries as well... not good for non-proliferation... -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Re: [python-gtk] problem with multiple inheritance

2005-06-02 Thread Greg Ewing
andles inheritance from built-in types. You can only inherit from more than one built-in type if they have compatible C structures, and it appears that the two you're trying to inherit from aren't compatible. You'll have to think of some way of doing whatever you're trying to do w

Re: the python way?

2005-06-07 Thread Greg McIntyre
I like this solution. For some reason it made me want to write a Ruby version of it. Possibly something about the title and the fact that Ruby enthusiasts are always going on about "the Ruby way". VOWELS = 'aeiouy'.split('') def reinterpolate(word) letters = word.split('').sort_by{rand} v

School Administration Software

2005-06-07 Thread Greg Lindstrom
Any advice you have would be welcome. Thanks, --greg -- Greg Lindstrom 501 975.4859 (office) Senior Programmer501 219-4455 (fax) NovaSys Health [EMAIL PROTECTED] Little Rock, Arkansas "We are the music makers, and we are the dreamers of dreams.&

Re: Wxpython demo crashes

2005-06-07 Thread Greg Krohn
Pekka Karjalainen wrote: > I'm using WinXP (Finnish), Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC > v.1310 32 bit (Intel)] on win32 and wxPython 2.6.0.1. > > When I go to the Process and Events section in the wxDemo and run the > Process demo, bad things can happen. It crashes. I think the cras

Re: need some cgi help please

2005-06-08 Thread Greg Ewing
anything, is it? Are there any other files that it *can* open? -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Re: OO re-factoring (was Pythonese/Efficiency/Generalese critique [on Tutor])

2005-06-08 Thread Greg Ewing
ything OO. OO isn't necessarily better than non-OO. It's a means to an end, not an end in itself. -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing func_closure?

2005-06-08 Thread Greg Ewing
specific example. As far as I know, there is currently no supported way of directly creating or modifying cell objects from Python; it can only be done by some obscure trickery. So the docs are telling the truth here, in a way. :-) -- Greg Ewing, Computer Science Dept, University of Canterbury,

Re: circular import Module

2005-06-08 Thread Greg Ewing
le1 import somename because somename won't yet have been defined in file1 at the time file2 is imported. -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Re: \r\n or \n notepad editor end line ???

2005-06-08 Thread Greg Ewing
Peter Hansen wrote: > (I don't believe there's a "wU" and conceptually it's sort > of meaningless anyway, If we ever get quantum computers, presumably "wU" will write the newlines in all possible formats simultaneously... -- Greg Ewing, Comput

Re: Embedding: many interpreters OR one interpreter with many thread states ?

2005-06-08 Thread Greg Ewing
ly, despite there being apparent support in the API. So I suggest using a single interpeter with multiple threads. -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Re: __init__.py in packages

2005-06-08 Thread Greg Ewing
ch simpler! -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg _versions = [ ("Carbon", "Mac"), ("gtk", "Gtk"), ] from os import environ as _env _platdir = _env.ge

Re: Annoying behaviour of the != operator

2005-06-08 Thread Greg Ewing
ethods work. They don't make any semantic assumptions. It's arguable that there should perhaps be some default assumptions made, but the Python developers seem to have done the Simplest Thing That Could Possibly Work, which isn't entirely unreasonable. -- Greg Ewing, Comp

Re: Annoying behaviour of the != operator

2005-06-08 Thread Greg Ewing
e justification. Some others: * Numeric arrays, where comparisons return an array of booleans resulting from applying the comparison to each element. * Computer algebra systems and such like, which return a parse tree as a result of evaluating an expression. -- Greg Ewing, Computer Science D

Re: Annoying behaviour of the != operator

2005-06-08 Thread Greg Ewing
> This gives the wacky world where > "[(1,2), (3,4)].sort()" works, whereas "[1+2j, 3+4j].sort()" doesn't. To solve that, I would suggest a fourth category of "arbitrary ordering", but that's probably Py3k material. -- Greg Ewing, Computer Science D

Re: Abstract and concrete syntax

2005-06-08 Thread Greg Ewing
nal language, but Python is not a functional language. In imperative programming, often you just do something for its side effect, and there's no obvious value to return. Forcing everything to return a value just for the sake of conceptual purity is an artificiality, in my view. -

Re: circular import Module

2005-06-13 Thread Greg Ewing
dependent modules. -- Greg Ewing, Computer Science Dept, University of Canterbury, Christchurch, New Zealand http://www.cosc.canterbury.ac.nz/~greg -- http://mail.python.org/mailman/listinfo/python-list

Re: FAQ: __str__ vs __repr__

2005-06-15 Thread Greg Krohn
Basically __repr__ should return a string representaion of the object, and __str__ should return a user-friendly pretty string. So maybe: class Person: ... def __repr__(self): return '' % (self.name, self.age, self.sign) def __str__(self): return self.name See this for a bett

Re: Help needed with translating perl to python

2007-06-26 Thread Greg Armer
, 1, 1) ; >> return chr($firstval) . chr($lastval) ; >> >> } > >2. What does shift do above? 'shift' accesses the first argument passed to the function, in this case the value of length($msg) >3. is the '.' operator just + in python? In principle yes. -- Greg Armer [EMAIL PROTECTED] http://www.codelounge.org If it would be cheaper to repair the old one, the company will insist on the latest model. -- http://mail.python.org/mailman/listinfo/python-list

Creating Packages

2007-07-14 Thread Greg Lindstrom
step. I believe this package would be helpful to those of us dealing with text files. How do I go about making it available? Thanks, --greg -- http://mail.python.org/mailman/listinfo/python-list

Re: Help Understanding mx.ODBC Error

2007-04-18 Thread Greg Corradini
unded. Thanks again Greg Corradini Steve Holden wrote: > > Greg Corradini wrote: >> Hello All, >> A few weeks ago, I wrote two scripts using mx.ODBC on an Access DB. Among >> other things, both scripts create new tables, perform a query and then >> populate the tables

Re: Help Understanding mx.ODBC Error

2007-04-19 Thread Greg Corradini
Steve Holden wrote: > > Greg Corradini wrote: > [actually, her wrote it here but I moved it to the bottom] >> Steve Holden wrote: >>> Greg Corradini wrote: >>>> Hello All, >>>> A few weeks ago, I wrote two scripts using mx.ODBC on an Access DB. &

Re: Using python with MySQL

2007-05-01 Thread Greg Donald
nt me > to some documentation for accessing MySQL via python. Something of the > "Python and MySQL for Dummies" caliber would be about my speed, but of > course I will be thankful for anything offered. http://mysql-python.sourceforge.net/ -- Greg Donald http://destiney.com/

1.#QNAN Solution

2007-05-08 Thread Greg Corradini
planation about the cause of this problem. Any ideas? Thanks Greg Corradini -- View this message in context: http://www.nabble.com/1.-QNAN-Solution-tf3710941.html#a1037 Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list

Re: 1.#QNAN Solution

2007-05-08 Thread Greg Corradini
Thanks for you help Grant Grant Edwards wrote: > > On 2007-05-08, Greg Corradini <[EMAIL PROTECTED]> wrote: > >> I'm running descriptive stats on mileages from a database >> (float numbers, about a million records). My sum returns >> 1.#QNAN, which I unde

Boolean confusion

2007-05-09 Thread Greg Corradini
d." Based on what is said above, shouldn't my first expression ( string.find('020914A','.') and len('020914A') > 10) evaluate to false b/c my 'x' is false? And shouldn't the second expression evaluate to True? Thanks for your help Gr

Re: Boolean confusion

2007-05-09 Thread Greg Corradini
Thank you Diez and Antoon for demystifing this problem. I see where I've been going wrong. Diez B. Roggisch-2 wrote: > > Greg Corradini wrote: > >> >> Hello all, >> I'm having trouble understanding why the following code evaluates as it >> does: &

Re: Boolean confusion

2007-05-09 Thread Greg Corradini
On 2007-05-09, Greg Corradini <[EMAIL PROTECTED]> wrote: > > Hello all, > I'm having trouble understanding why the following code evaluates as it > does: > >>>> string.find('020914A','.') and len('020914A') > 10 >

os.popen on windows: loosing stdout of child process

2007-05-11 Thread Greg Ercolano
When I use os.popen(cmd,'w'), I find that under windows, the stdout of the child process disappears, instead of appearing in the DOS window the script is invoked from. eg: C:\> type foo.py import os import sys file = os.popen("nslookup", 'w') file.write("google.com\n") file

Re: Installing Python in a path that contains a blank

2007-05-21 Thread Greg Donald
On 5/21/07, John Machin <[EMAIL PROTECTED]> wrote: > Is there not a similar trick on MacOS X? It's called a symlink: ln -s /Users/gdonald /foo -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list

Understanding mxODBC Insert Error

2007-07-29 Thread Greg Corradini
Hello, I'm trying to perform a simple insert statement into a table called Parcel_Test (see code below). Yet, I get an error message that I've never seen before (see traceback below). I've tried to put a semicolon at the end of the sql statement, but with no luck. Any ideas from more experienced m

Re: Wing IDE for Python v. 3.0 beta1 released

2007-08-01 Thread Greg Donald
nd addressed all my questions over about a 3 or 4 day email conversation. -- Greg Donald http://destiney.com/ -- http://mail.python.org/mailman/listinfo/python-list

<    4   5   6   7   8   9   10   11   12   >