Re: what's OOP's jargons and complexities?

2005-01-28 Thread Dan Perl
"PA" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > On Jan 29, 2005, at 01:09, Martin Ambuhl wrote: > >> Xah Lee wrote his usual masturbatory crap: > > Well... I have to admit that I tremendously enjoyed such "masturbatory > crap" (sic). > > Eagerly looking toward the next insta

Re: naive doc question

2005-01-29 Thread Dan Perl
"Michael Hartl" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > i.e., http://docs.python.org/lib/typesmapping.html > If you look on the index page of the Python Library Reference (http://docs.python.org/lib/genindex.html), you will find "dictionary object", which will take you ex

Re: [perl-python] sending email

2005-01-29 Thread Dan Perl
I recommend the example in the Python Library Reference as a better example: http://www.python.org/doc/lib/SMTP-example.html. You can also find the entire description of the smtplib module in the same section (http://www.python.org/doc/lib/module-smtplib.html). Xah Lee's example is missing:

Re: Regarding exception handling

2005-01-30 Thread Dan Perl
closes You would need the try-finally statement only if you expect it to handle other exceptions than socket.error or if the socket.error is re-raised in the "except" clause. Otherwise, the try-finally statement is redundant because no socket.error are getting out of the try-ex

[Python-Announce] cfgparse v01_00 released

2005-01-30 Thread Dan Gass
Enjoy, Dan Gass -- http://mail.python.org/mailman/listinfo/python-list

Re: Regarding exception handling

2005-01-30 Thread Dan Perl
= ... was placed inside the try/finally, but > if an exception occures and s doesn't get bound to an object, then > s.close() in both examples will raise a NameError on s. That is a very good point. I missed it. Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: Regarding exception handling

2005-01-30 Thread Dan Perl
eption handling This handles all the socket exceptions in one shot. The only problem is that different problems may have to be handled differently. For instance, you may need to handle a transmission that failed in the middle differently than a failure to open the socket. Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: cfgparse v01_00 released

2005-02-01 Thread dan . gass
reciated. I've spent a fair amount of time implementing and testing features that I don't really use in order to be able to contribute this to the Python community. If you would like to see it (or see specific features it has) in the standard library I encourage you to make comments at http://www.python.org/moin/ConfigParserShootout Regards, Dan Gass -- http://mail.python.org/mailman/listinfo/python-list

(no subject)

2005-02-01 Thread Dan Smyth
uture, the compiler will take precedenceconfigure: WARNING: ## - ##configure: WARNING: ## Report this to the python lists.  ##configure: WARNING: ## --------- ## Dan Smyth   Dan Gaidin -- Tai Shar Phoenix"Dovie&#

Re: How do you do arrays

2005-02-01 Thread Dan Perl
For instance, in your example, you may later do a "del iMatrix[2]" and then you wouldn't really be able to use iMatrix like an array anymore. But, depending on your application, a dictionary may be perfectly suitable. Hope this helps. Dan "Thomas Bunce" <[EMAIL P

Re: [perl-python] string pattern matching

2005-02-01 Thread Dan Perl
d to be warned about the quality of these tutorials". Dan "Daniel Fackrell" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Perhaps a message to the effect of "These messages are specifically > disowned > by the groups to which they are posted,

Re: how to write a tutorial

2005-02-02 Thread Dan Perl
ympics too. 99% of people don't practice any of those sports at a competitive level. Who the hell does pole vaulting or throws a javelin? Sorry, maybe I should have posted this in the "next Xah Lee post contest" thread. Dan -- http://mail.python.org/mailman/listinfo/python-list

Compilation problems for Python 2.4 on SGI machines

2005-02-02 Thread Dan Smyth
stropts.h: in the future, the compiler will take precedenceconfigure: WARNING: ## - ##configure: WARNING: ## Report this to the python lists.  ##configure: WARNING: ## --------- ## Dan Smyth   Dan Gaidin -- Tai Shar Phoenix&qu

mounting a filesystem?

2005-02-03 Thread Dan Stromberg
Is there a python module that can mount a filesystem? More specifically, a loopback filesystem with a particular offset, under linux? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

advice needed for simple python web app

2005-02-03 Thread Dan Perl
should also be as simple as possible to administrate. I would be even interested in building a very simple web app server if there is a framework that has all the basic components and there is good documentation for how to use it. Thanks, Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: advice needed for simple python web app

2005-02-03 Thread Dan Perl
"Paul Rubin" <http://[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Dan Perl" <[EMAIL PROTECTED]> writes: >> Basically, what I'm looking for is a web server that accepts an HTTP >> request and invokes a python script. But I woul

Re: advice needed for simple python web app

2005-02-03 Thread Dan Perl
apps. Twisted feels more "developed" but also more complex at the same time. I wanted opinions before I invest the time in studying either one of them. Your opinion helps. Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: advice needed for simple python web app

2005-02-03 Thread Dan Perl
"Paul Rubin" <http://[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Dan Perl" <[EMAIL PROTECTED]> writes: >> The application is just something I'm playing with to learn a little bit >> on >> web apps. It uses an HTML form

Re: advice needed for simple python web app

2005-02-03 Thread Dan Perl
"Michele Simionato" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dan Perl: >> The application is just something I'm playing with to learn a little > bit on >> web apps. It uses an HTML form to send an email. The form takes > inputs

Re: advice needed for simple python web app

2005-02-03 Thread Dan Perl
"Brian Beck" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > From my experience, this appears to be the order from low-level to > high-level interfaces: > > 1. mod_python: As complex as you need it to be, since you can control > anything about the request & response process. But m

Re: advice needed for simple python web app

2005-02-04 Thread Dan Perl
"Paul Rubin" wrote in message news:[EMAIL PROTECTED] > If you're just trying to get a conceptual understanding of web > programming, I suggest you start with cgi. > > Next you might want to read Philip and Alex's Guide to Web Publishing: > > http://philip.greenspun.com

(no subject)

2005-02-04 Thread Dan Smyth
--- ##configure: WARNING: ## Report this to [EMAIL PROTECTED]. ##configure: WARNING: ## ##   Do you know what is happening here?  Thanks.   Dan Smyth Brigham Young University   Dan Gaidin -- Tai Shar Phoenix"Dovie'andi se tovya sagain" --

Re: [perl-python] get web page programatically

2005-02-04 Thread Dan Perl
"Xah Lee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] # note the line # from import # it reads the library and import the function name # to see available functions in a module one can use "dir" # import urllib; print dir(urllib) After about a month, this tutorial has finally r

Re: Converting strings to dates

2005-02-04 Thread Dan Bishop
Chermside, Michael wrote: > I'm trying to convert a string back into a datetime.date. > > First I'll create the string: > > > Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on > win32 > Type "help", "copyright", "credits" or "license" for more information. > >>> import time, da

Re: How to read POSTed data

2005-02-05 Thread Dan Perl
"Håkan Persson" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi. > > I am trying to set up a simple HTTP-server but I have problems reading > data that is beeing POSTed. > > class httpServer(BaseHTTPServer.BaseHTTPRequestHandler): >def do_POST(self): >input = self.rf

CGI POST problem was: How to read POSTed data

2005-02-05 Thread Dan Perl
is only on the latest version in CVS and it states that what is in the 2.4 release works. All this tells me that it could be a "fragile" part in the standard library. So it could be even a bug in the standard library, but for now I am assuming that I'm doing something wr

Re: sos!

2005-02-05 Thread Dan Perl
ed yet: http://aspn.activestate.com/ASPN/Cookbook/Python/ It is especially good because it contains simple, short recipes that illustrate a specific use of python and these recipes are organized in categories. Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: sos!

2005-02-05 Thread Dan Perl
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > > Dan Perl wrote: >> [...] > Aren't you in the wrong newsgroup? :-) Aren't you funny? -- http://mail.python.org/mailman/listinfo/python-list

Re: CGI POST problem was: How to read POSTed data

2005-02-05 Thread Dan Perl
"M.E.Farmer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dan, > I was wondering how you were coming with your project. > I had wondered if i had missed something going the CherryPy route > instead of CGI. Now I see that you have had a bit of a snag

Re: sos!

2005-02-05 Thread Dan Perl
"jordan2856977" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Dan Perl" <[EMAIL PROTECTED]> wrote in message > news:<[EMAIL PROTECTED]>... >> <[EMAIL PROTECTED]> wrote in message >> news:[EMAIL PROTECTED] >

Re: CGI POST problem was: How to read POSTed data

2005-02-05 Thread Dan Perl
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dan Perl wrote: > >> how is a multipart POST request parsed by CGIHTTPServer? > > It isn't; the input stream containing the multipart/form-data content > is passed to the CGI script, which can choos

Re: Avoiding deadlocks in concurrent programming

2005-06-22 Thread Dan Sommers
need that many queries. As Paul noted, RDBMSes are well- studied and well-understood; they are also extremely powerful when used to their potential. Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Plain text email?

2005-06-27 Thread Dan Sommers
d Yo! ? That depends on the client. IMO, HTML belongs on web pages, not in email. YMMV. Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: When someone from Britain speaks, Americans hear a "British accent"...

2005-06-29 Thread Dan Sommers
ause of the region's cultural isolation, perhaps the locals here do actually speak as they did (and as their ancestors in England did) a few hundred years ago. Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading output from a child process non-blockingly

2005-06-29 Thread Dan Sommers
On Wed, 29 Jun 2005 15:45:20 +0200, Thomas Guettler <[EMAIL PROTECTED]> wrote: > Check out.log with "tail" or "less +F". Do you see the data appear in > small chunks? ... You'll need "tail -f", I think. Regards, Dan -- Dan Sommers <http://www.

Re: Programmers Contest: Fit pictures on a page

2005-06-29 Thread Dan Sommers
both directions. Anyway, after a couple more years and a few more releases, the program could handle arbitrary polygons, shapes with various types of curved edges, arbitrary flaws in the material (mostly for knots in sheets of plywood), and I'm sure a few more things I don't remember right

Re: Help please: How to assign an object name at runtime

2005-06-29 Thread Dan Sommers
s will create a dictionary that maps the string 'ca1017' to a newly created Machine object. HTH, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Programmers Contest: Fit pictures on a page

2005-06-30 Thread Dan Sommers
7;s some sort of irony or something in there about not writing the best genetic algorithm, but I can't quite put my finger on it. Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: precision problems in base conversion of rational numbers

2005-07-05 Thread Dan Bishop
Brian van den Broek wrote: > Hi all, > > I guess it is more of a maths question than a programming one, but it > involves use of the decimal module, so here goes: > > As a self-directed learning exercise I've been working on a script to > convert numbers to arbitrary bases. It aims to take any of w

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-05 Thread Dan Bishop
Devan L wrote: > Claiming that sum etc. do the same job is the whimper of > someone who doesn't want to openly disagree with Guido. > > Could you give an example where sum cannot do the job(besides the > previously mentioned product situation? Here's a couple of examples from my own code: # from

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-06 Thread Dan Sommers
s? Lots more hard-to-find errors from code like this: filehandle = open( 'somefile' ) do_something_with_an_open_file( file_handle ) filehandle.close( ) Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Lisp development with macros faster than Python development?..

2005-07-06 Thread Dan Sommers
f Code looked like, but that's even farther off-topic) Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Create datetime instance using a tuple.

2005-07-06 Thread Dan Bishop
Qiangning Hong wrote: > On 6 Jul 2005 02:01:55 -0700, Negroup <[EMAIL PROTECTED]> wrote: > > Hi, all. > > I would like to know if it is possible to create a datetime instance > > using a tuple instead of single values. > > > > I mean: > > >>> from datetime import datetime > > >>> t = (1, 2, 3) > >

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-06 Thread Dan Bishop
Devan L wrote: > > Here's a couple of examples from my own code: > > > > # from a Banzhaf Power Index calculator > > # adds things that aren't numbers > > return reduce(operator.add, > > (VoteDistributionTable({0: 1, v: 1}) for v in electoral_votes)) > > return sum([VoteDistributionTable({0:1,

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-06 Thread Dan Sommers
On Wed, 06 Jul 2005 15:18:31 GMT, Ron Adam <[EMAIL PROTECTED]> wrote: > Dan Sommers wrote: >> On Wed, 06 Jul 2005 14:33:47 GMT, >> Ron Adam <[EMAIL PROTECTED]> wrote: >> >>> Since this is a Python 3k item... What would be the consequence of >>>

Re: map/filter/reduce/lambda opinions and background unscientific mini-survey

2005-07-06 Thread Dan Sommers
med "this": class A: method __init__(): this.x = 0 method make_my_day(foo): this.x += foo there-aren't-enough-winks-in-the-universe'ly yours, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Problem with sha.new

2005-07-09 Thread Dan Sommers
path > f = open(path) > sha = sha.new(f.read()) ^^^ Now the name "sha" no longer refers to the sha module, but to the object returned by sha.new. Use a different name. > sha.update(f.read()) > print sha.hexdigest() Regards, Dan

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-10 Thread Dan Sommers
meters do_something_with_y() where "self" in "self.x" and "self.y" would have to match the first parameter (so that the pathological among us could write this: def __init__(this, this.x, y, this.z): do_something_with_y() instead). (Sorry if this

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-10 Thread Dan Sommers
On Sun, 10 Jul 2005 20:11:38 -0400, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Dan Sommers" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> That's a pretty big change; now all formal parameters beginning with >> an

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-11 Thread Dan Sommers
On Mon, 11 Jul 2005 08:34:45 +0200, Reinhold Birkenfeld <[EMAIL PROTECTED]> wrote: > Kay Schluehr wrote: >> Dan Sommers schrieb: >> >>> How about this: >>> >>> def __init__(self, self.x, y, self.z): >>> # self.x, self.z from fi

Re: __autoinit__

2005-07-11 Thread Dan Sommers
e "help", "copyright", "credits" or "license" for more information. >>> x, x['abc'] = {}, 3 >>> print x {'abc': 3} >>> x, x['abc'], x['abc'][4] = {}, range(10), - >&

Re: Inconsistency in hex()

2005-07-12 Thread Dan Bishop
Steven D'Aprano wrote: > hex() of an int appears to return lowercase hex digits, and hex() of a > long uppercase. > > >>> hex(75) > '0x4b' > >>> hex(75*256**4) > '0x4BL' > > By accident or design? Apart from the aesthetic value that lowercase hex > digits are ugly, should we care? > > It wo

Re: System calls not using correct permissions?

2005-07-14 Thread Dan Sommers
nning, what version of Python you're running, an actual error message, a traceback, what your program is supposed to do that you think it isn't doing, etc.), it's absolutely impossible for anyone to make even an educated guess. See also www.catb.org/~esr/faqs/smart-question

Re: Generating a list of None

2005-07-14 Thread Dan Sommers
On 14 Jul 2005 19:28:14 -0700, "Nicolas Couture" <[EMAIL PROTECTED]> wrote: > if vals == [None * len(vals)]: if vals == [None] * len(vals): Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: System calls not using correct permissions?

2005-07-15 Thread Dan Sommers
guess, but one of (the many) reasons not to use tcsh is that it has some very strange (to me, anyway) rules about which startup files (e.g., .login) to run when. Perhaps one of your such files is being executed in one case and not the other, and is doing something relevant to an environment variable

Re: goto

2005-07-18 Thread Dan Bishop
rbt wrote: > On Mon, 2005-07-18 at 12:27 -0600, Steven Bethard wrote: > > Hayri ERDENER wrote: > > > what is the equivalent of C languages' goto statement in python? > > > > Download the goto module: > > http://www.entrian.com/goto/ > > And you can use goto to your heart's content. And to the

Re: getting the class name of a subclass

2005-07-20 Thread Dan Sommers
_name__ > print "Class ",A.__name__ Why "A.__name__" and not "self.__class__.__name__"? Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting environment variables for tcsh session

2005-07-21 Thread Dan Sommers
best you can do is have your script output the right commands and have your shell read them. See "Command Substitution" in the tcsh man page. Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Setting environment variables for tcsh session

2005-07-22 Thread Dan Sommers
` $ echo $foo bar or you could it like this: changefoo.py: print 'foo bar' end of changefoo.py Then the shell session would look like this: % setenv `python changefoo.py` % echo $foo bar But we're veering dangerously off topic for c

Re: consistency: extending arrays vs. multiplication ?

2005-07-23 Thread Dan Bishop
Soeren Sonnenburg wrote: > Hi all, > > Just having started with python, I feel that simple array operations '*' > and '+' don't do multiplication/addition but instead extend/join an > array: > > a=[1,2,3] > >>> b=[4,5,6] > >>> a+b > [1, 2, 3, 4, 5, 6] > > instead of what I would have expected: > [5

Re: how to write a line in a text file

2005-07-25 Thread Dan Sommers
line > * re-open the file for writing: f = open('filename.txt', 'w') > * write the list to the file: f.writelines(content) > * close the file: f.close() HTH, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Packages and modules

2005-07-26 Thread Dan Richter
I'm trying to create a package+module structure, specifically a "test" package with all the unit tests. I'd like to have a package (directory) "test" that has various test modules, and I'd also like "test" itself to be a module that runs all the tests. Is this not possible? I created a directory c

Re: Ten Essential Development Practices

2005-07-28 Thread Dan Sommers
;Namespaces are > one honking great idea -- let's do more of those!" Then I shall be > enlightened. And when the one obvious way to do something *is* be obvious at first, then I shall be Dutch! Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Ten Essential Development Practices

2005-07-28 Thread Dan Sommers
n to be working on at the time, but such is the nature of Zen. Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Ten Essential Development Practices

2005-07-29 Thread Dan Sommers
l. But as usual, Zen is not easily nailed to a tree. Was Tim writing about developing Python itself, or about developing other programs with Python? Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Ten Essential Development Practices

2005-07-29 Thread Dan Sommers
On 29 Jul 2005 07:45:33 -0700, [EMAIL PROTECTED] (Aahz) wrote: > In article <[EMAIL PROTECTED]>, > Dan Sommers <[EMAIL PROTECTED]> wrote: >> >> Was Tim writing about developing Python itself, or about developing >> other programs with Python? > Yes.

Re: How to do this?

2005-07-30 Thread Dan Sommers
ute "fun()" and > "fun2()", foo will call "self.__base.fun()" or "self.__base.fun2()". > when a attr can't be find in foo, it's will try to search 'self.__base". I > think this maybe need to use "__getattr__" and "

Re: showing help(M) when running module M standalone

2005-07-30 Thread Dan Sommers
.__doc__" > Works but does not seem right using exec for such a task. So don't use exec. > any hint would be great! for x in __all__: print x.__doc__ HTH, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: functions without parentheses

2005-07-30 Thread Dan Sommers
On Sat, 30 Jul 2005 18:42:59 GMT, [EMAIL PROTECTED] (Bengt Richter) wrote: > or > arr = (ArrayElementAggregator() > 11 12 13 > 21 22 23 > ) What was that again about every other computer language wanting to be Lisp? ;-) Regards, Dan

Re: showing help(M) when running module M standalone

2005-07-30 Thread Dan Sommers
On Sat, 30 Jul 2005 22:02:49 +0200, Chris <[EMAIL PROTECTED]> wrote: > I tried that, problem is that __all__ containts strings... Oops. I should have looked before I lept. Sorry, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: showing help(M) when running module M standalone

2005-07-30 Thread Dan Sommers
On Sat, 30 Jul 2005 22:02:49 +0200, Chris <[EMAIL PROTECTED]> wrote: > I tried that, problem is that __all__ containts strings... Okay, that's twice I've lept before I looked. How about this: for a in __all__: print globals()[a].__doc__ HTH, Dan --

Re: Comparison of functions

2005-07-31 Thread Dan Bishop
Steven D'Aprano wrote: > On Sat, 30 Jul 2005 16:43:00 +, Adriano Varoli Piazza wrote: > > > If you want to treat numbers as strings, why not convert them before > > sorting them? > > Because that changes the object and throws away information. I think he meant doing something like ->>> lst =

Re: why no arg, abs methods for comlex type?

2005-08-05 Thread Dan Sommers
More OO, yes. More readable, not IMO. > I would also like to see some more functions to make > calculations with complex number more convenient [ ... ] > maybe there exists some proposals aiming this goal? SciPy or Numeric? Regards, Dan -- Dan Sommers <http://www.tombstoneze

Re: why no arg, abs methods for comlex type?

2005-08-05 Thread Dan Bishop
Terry Reedy wrote: > "Daniel Schüle" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] ... > > unfortunately there is no arg method to get the angle > > of the complex number > > I agree that this is a deficiency. I would think .angle() should be a > no-param method like .conjugate(),

Re: Fat and happy Pythonistas (was Re: Replacement for keyword 'global' good idea? ...)

2005-08-06 Thread Dan Sommers
are permutations of configuration options in the text formatter. Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Wheel-reinvention with Python

2005-08-06 Thread Dan Sommers
ow about HTML? Except for toasters, almost every computing device sold these days contains an HTML interpreter, and a great deal of embedded systems create HTML and use HTTP as an administrative interface. Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Does FTPLIB have a 'local change directory' ?

2005-08-06 Thread Dan Sommers
On Sun, 07 Aug 2005 01:28:31 GMT, "python newbie" <[EMAIL PROTECTED]> wrote: > I'd like to be able to first > ftplib.lcd( "c:\myfiles\morefiles" ) > and then just > storbinary( picture.gif .. ). > But the python doc doesn't show any L

Re: How to determine that if a folder is empty?

2005-08-08 Thread Dan Sommers
inition of "out there," yes, some OS's grant those privileges separately. Apollo (eventually bought out by HP) Aegis (mostly like *nix, but just different enough to trip me up again and again) used to be one. The more secure the environment, the more likely certain privileges do *no

Re: don't understand instanse creation

2005-08-09 Thread Dan Sommers
bove line creates a new instance attribute __data1, and binds it to a copy of __data2. > print "__data1: ", self.__data1 > print "__data2: ", self.__data2 [ example snipped ] HTH, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Spaces and tabs again

2005-08-13 Thread Dan Sommers
lash, Python 4.0 will ban leading spaces and require > tabs Why not petition the unicode people to include PYTHON INDENT and PYTHON DEDENT code points, and leave the display up to the text editors? ;-) Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Testing for presence of arguments

2005-08-17 Thread Dan Sommers
vateClass: print "required_argument was probably not present" else: print "required_argument was present" It's not impossible fool f, but an external module has to try very hard to do so. (All code untested.) Regards, Dan -- Dan Sommers <

Re: Module Name Conflicts

2005-08-18 Thread Dan Sommers
fix_sys_path_to_find_python_cmd_first() import cmd as python_cmd Obviously, then, 'cmd' does not reference either module; you'd have to use java_cmd and python_cmd as appropriate. HTH, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> -- http://mail.python.org/mailman/listinfo/python-list

Re: Module Name Conflicts

2005-08-18 Thread Dan Sommers
On Thu, 18 Aug 2005 16:46:42 -0700, Robert Kern <[EMAIL PROTECTED]> wrote: > Dan Sommers wrote: [ something that obviously doesn't work ] > That doesn't work. The first module is recorded as 'cmd' in > sys.modules and gets reused on the second import. Yes, y

Re: GIS Related Scripting Issue

2005-08-19 Thread Dan Patterson
you might want to try http://forums.esri.com/forums.asp?c=93 and post in the geoprocessing section with code details "Fredrik Lundh" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Mike Rose wrote: > >> I am currently using ArcGIS 9.1 and was referred to this list to ask my >> questi

Re: stdin -> stdout

2005-08-19 Thread Dan Sommers
On Fri, 19 Aug 2005 15:26:27 GMT, "max(01)*" <[EMAIL PROTECTED]> wrote: > ps: in perl you ca do this: > ... > while ($line = ) >{ > print STDOUT ("$line"); >} > ... import fileinput import sys for line in fileinput.input(): sys.st

Logging all activity on a tty/pty?

2005-08-23 Thread Dan Stromberg
Is there a way, using python, to (voluntarily) log all activity in a given shell, in a way that should work on pretty much all *ix's with a port of python? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: List of integers & L.I.S.

2005-09-07 Thread Dan Sommers
y # ascending and also pruning sequences that obviously can't "win" It's not much to go on, but that bit after the ";" is the algorithm I use. I can't tell you how fast it runs in big-O notation, but my old 500 MHz PowerMac G4 digested lists of tens or hundre

Re: Question About Logic In Python

2005-09-18 Thread Dan Bishop
James H. wrote: > Greetings! I'm new to Python and am struggling a little with "and" and > "or" logic in Python. Since Python always ends up returning a value > and this is a little different from C, the language I understand best > (i.e. C returns non-zero as true, and zero as false), is there a

Re: Confused with methods

2005-02-06 Thread Dan Perl
"jfj" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I don't understand. > We can take a function and attach it to an object, and then call it > as an instance method as long as it has at least one argument: > > # > class A: > pass > > def foo(x): > print x > > A.foo

Re: CGI POST problem was: How to read POSTed data

2005-02-06 Thread Dan Perl
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Dan Perl wrote: > >> how is a multipart POST request parsed by CGIHTTPServer? > [...] > CGIHTTPServer, on the other hand, I have never really trusted. I would > suspect that fella. It turns out I was w

Re: How to read POSTed data

2005-02-06 Thread Dan Perl
x27;t use cgi. Any opinions on that? Is there a history there? I don't know enough about HTTP, especially about its history, but was this a change in the HTTP specification at some point? Thanks, Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: How to read POSTed data

2005-02-06 Thread Dan Perl
. Is the parent's os.environ passed to the subprocesses created with popen2/popen3 on Windows? cgi.FieldStorage.read_urlencoded needs the content-length that should be passed through os.environ. Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: Python versus Perl ?

2005-02-06 Thread Dan Perl
"Alex Martelli" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > snacktime <[EMAIL PROTECTED]> wrote: > >> The one drawback coming from the perl world is that you don't have as >> many options when it comes stuff like application frameworks, and some > > URK -- _my_ feeling is that w

Re: How to read POSTed data

2005-02-06 Thread Dan Perl
"Dan Perl" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Thanks, Pierre, this got me much further but I hit another stumbling > block. I can see now that CGIHTTPServer writes all the header lines into > os.environ and creates a subprocess for the

Re: Questions about mathematical signs...

2005-02-06 Thread Dan Bishop
Jeff Epler wrote: > On Sun, Feb 06, 2005 at 12:26:30PM -0800, administrata wrote: > > Hi! I'm programming maths programs. > > And I got some questions about mathematical signs. ... > > 2. Inputing fractions like (a / b) + (c / d), It's tiring work too. > >Can it be simplified? > > Because of th

Re: CGI POST problem was: How to read POSTed data

2005-02-06 Thread Dan Perl
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > CGIHTTPServer, on the other hand, I have never really trusted. I would > suspect that fella. CGIHTTPServer wasn't the culprit after all, it was os.py. See bug report "[ 1100235 ] Scripts started with CGIHTTPServer: missing cgi envir

Re: CGI POST problem was: How to read POSTed data

2005-02-07 Thread Dan Perl
"M.E.Farmer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Sweet! > Glad you fixed it, and documented it all! > Thanks for the followups. > Now the next poor soul to stumble in can get the right fix. > Never know when it could be me ;) Thanks for the comments. I did indeed post

Re: Python on WWW - beginners question: what to choose?

2005-02-07 Thread Dan Perl
http://pyre.third-bit.com/pyweb/index.html You may find also this interesting as a list to several links related to this topic: http://www.python.org/moin/WebProgramming Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: python code with indention

2005-02-07 Thread Dan Perl
"Xah Lee" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > is it possible to write python code without any indentation? I read just today in a tutorial that "Python on the other hand, does not even allow changes in code's indentation". Maybe the author of that tutorial can help?

Re: negative integer division

2005-02-08 Thread Dan Bishop
Mark Jackson wrote: > Imbaud Pierre <[EMAIL PROTECTED]> writes: > > integer division and modulo gives different results in c and python, > > when negative numbers > > are involved. take gdb as a widely available c interpreter > > print -2 /3 > > 0 for c, -1 for python. > > more amazing, modulos o

<    6   7   8   9   10   11   12   13   14   15   >