Re: Endianness conversion

2007-02-24 Thread Dan Sommers
uld use in the standard library, or do I have to > write my own C extension? You could try the struct module. If your input comes in fixed sized chunks, just call struct.unpack and struct.pack once per chunk. HTH, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> Atoms are

Re: Endianness conversion

2007-02-25 Thread Dan Sommers
On Sat, 24 Feb 2007 17:27:12 +, Toby wrote: > Dan Sommers wrote: >> You could try the struct module. If your input comes in fixed sized >> chunks, just call struct.unpack and struct.pack once per chunk. > > Thanks, but it was a bit awkward to use for big chunks. de

Re: Jobs: Lisp and Python programmers wanted in the LA area

2007-02-26 Thread Dan Bensen
Tech HR wrote: > easier to train a Java programmer or a Perler on Python than Lisp. Are your technical problems simple enough to be solved by Python trainees? -- Dan www.prairienet.org/~dsb -- http://mail.python.org/mailman/listinfo/python-list

Re: Jobs: Lisp and Python programmers wanted in the LA area

2007-02-26 Thread Dan Bensen
> Tech HR wrote: > easier to train a Java programmer or a Perler on Python than Lisp. Dan Bensen wrote: > Are your technical problems simple enough to be solved by Python > trainees? Aahz wrote: > If they're already good programmers, yes. Sure, but who are these good prog

Re: Is type object an instance or class?

2007-02-26 Thread Dan Bishop
On Feb 26, 8:00 pm, "JH" <[EMAIL PROTECTED]> wrote: > Hi > > I found that a type/class are both a subclass and a instance of base > type "object". > > It conflicts to my understanding that: > > 1.) a type/class object is created from class statement > 2.) a instance is created by "calling" a class

Re: How to use cmp() function to compare 2 files?

2007-02-26 Thread Dan Bishop
On Feb 26, 10:09 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > i have 2 files which are different (1 line difference): > $ diff groupresult20070226190027.xml groupresult20070226190027-2.xml > 5c5 > < x:22 y:516 w:740 h:120 area: > --- > > > x:22 y:516 w:740 h:1202 area: > > But when

Re: os.system and quoted strings

2007-02-27 Thread Dan Bishop
On Feb 27, 9:16 am, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Tue, 27 Feb 2007 06:24:41 -0800, svata wrote: ... > > import time > > import os > > > dir = "C:\\Documents and Settings\\somepath\\" > > I believe that Windows will accept forward slashes as directory > separators, so you can write

fork/exec with input redirection

2007-11-26 Thread Dan Upton
parently doesn't work. Is there some other way to accomplish what I'm going for? Thanks, -dan -- http://mail.python.org/mailman/listinfo/python-list

Re: fork/exec with input redirection

2007-11-27 Thread Dan Upton
uot;--mode", "gtp", "<", "13x13.tst"]) > > > > > but this apparently doesn't work. Is there some other way to > > > accomplish what I'm going for? > > > > > Thanks, > > > -dan > > >

Re: Bit Operations

2007-11-28 Thread Dan Upton
once (in Java) with bytes not having the value I expected unless I did the and-magic, but I wasn't clear on why. Is it an issue with the word otherwise possibly not being zeroed out? -dan -- http://mail.python.org/mailman/listinfo/python-list

Re: "Python" is not a good name, should rename to "Athon"

2007-11-30 Thread Dan Upton
On Nov 30, 2007 11:17 AM, Matt Nordhoff <[EMAIL PROTECTED]> wrote: > Tim Chase wrote: > > (You'd think this was the Lisp ML, not Python... ) > > Atsp? :-) > -- Athp? Wait, no, Microsoft already claimed that one... -- http://mail.python.org/mailman/listinfo/python-list

Re: "Python" is not a good name, should rename to "Athon"

2007-12-01 Thread Dan Upton
On Dec 1, 2007 12:34 PM, Bjoern Schliessmann <[EMAIL PROTECTED]> wrote: > Dotan Cohen wrote: > > C was named after the B programming language, as it was inspired > > and meant to replace it. C++ is obviously C+1 > > Strictly speaking, C++ evalutes to C, but C is incremented > afterwards. > I guess

Re: How can i find a file size on the web ?

2007-12-02 Thread Dan Upton
On Dec 2, 2007 11:55 AM, Abandoned <[EMAIL PROTECTED]> wrote: > Hi.. > Can i find a file size witdhout download? > For example: www.roche.com/rochea_z_sp.pdf > How can i find its size with python ? When you send an HTTP request, most servers will respond with the content length. For instance, if

Re: "Python" is not a good name, should rename to "Athon"

2007-12-03 Thread Dan Upton
On Dec 3, 2007 4:34 PM, Russ P. <[EMAIL PROTECTED]> wrote: > > > I'm amazed that anyone here answered this obvious troll... > > I doubt the original post was a troll, but the statement above clearly > is. > > You are entitled to your opinion about the idea of changing the name > of the language, bu

Re:

2007-12-12 Thread Dan Upton
On Dec 11, 2007 8:19 PM, katie smith <[EMAIL PROTECTED]> wrote: > > I tried googling and yahooing to find the answer and there was to many > conflicting results so i just decided to ask to simple question here. > > How do i could the number of letters in a string no a single letter all of > them. >

Re: lotus nsf to mbox

2007-12-15 Thread Dan Poirier
On Dec 15, 5:18 am, Fabian Braennstroem <[EMAIL PROTECTED]> wrote: > I am wondering, if anyone tried to convert lotus nsf mails > to a mbox format using python!? It would be nice, if anyone > has an idea, how to do it on a linux machine. I've used jython to access notes databases through the Notes

Re: [OT] Fractions on musical notation

2007-12-16 Thread Dan Upton
> Since the US, at least, uses whole/half/quarter/eighth/sixteenth... > notes, three-quarter and six-eight time falls out... I don't think this is technically true, but I've never been able to tell the difference. -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] Fractions on musical notation

2007-12-17 Thread Dan Upton
On Dec 16, 2007 10:32 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > > "Dan Upton" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > |> Since the US, at least, uses > whole/half/quarter/eighth/sixteenth... > | > notes, three-

Re: [OT] Any Python lullabies?

2006-04-18 Thread Dan Sommers
gt; but he somehow wasn't very interested :) Then isn't that the perfect lullaby material? ;-) Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> "I wish people would die in alphabetical order." -- My wife, the genealogist -- http://mail.python.org/mailman/listinfo/python-list

Re: Writing backwards compatible code - when?

2006-04-18 Thread Dan Sommers
#x27;t. I thought it was more cohesive, but googling for python "what's new" turns up a collection of such documents in various places. Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> "I wish people would die in alphabetical order." -- My wife

Re: bug in modulus?

2006-04-23 Thread Dan Bishop
[EMAIL PROTECTED] wrote: > Hmmm. I understand. I'd suggest that someone just drop a link from the > Library reference manual as the divmod entry over there seems to > contradict it. > > """ > divmod(a, b) > > Take two (non complex) numbers as arguments and return a pair of > numbers consisting of t

Re: can anyone advise me

2006-04-27 Thread Dan Sommers
and 1, since x is now 2. And another x. Since this might be homework, I'll stop at a hint: you need to think about when you want each printed line to end, and make sure that you tell python to end it there. Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> &quo

Re: ending a string with a backslash

2006-05-01 Thread Dan Bishop
John Salerno wrote: > I have this: > > subdomain = raw_input('Enter subdomain name: ') > > path = r'C:\Documents and Settings\John Salerno\My Documents\My > Webs\1and1\johnjsalerno.com\' + subdomain > > Obviously the single backslash at the end of 'path' will cause a > problem, and escaping it with

Re: Converting floating point to string in non-scientific format

2006-05-01 Thread Dan Bishop
Madhusudhanan Chandrasekaran wrote: > Hi all: > > When I try to convert a float variable into string via repr() or str() > function, i get the value as is, i.e '0.1e-7' in IEEE 754 format. > Instead how can force the created string to represent the floating > point in non-scientific fashion (non IE

Re: returning none when it should be returning a list?

2006-05-01 Thread Dan Bishop
Edward Elliott wrote: [in reponse to some prime-number code] > 5. you can do better than checking every odd number (next+2) to find the > next prime, but I'm too tired to look into it right now. it may require > more complex machinery. You only need to check the prime numbers up to sqrt(n). If y

Re: NaN handling

2006-05-06 Thread Dan Bishop
Ivan Vinogradov wrote: > > > > NaNs are handled. > > Throwing an exception would be nice in regular Python (non-scipy). > > This works to catch NaN on OSX and Linux: > > # assuming x is a number > if x+1==x or x!=x: > #x is NaN x != x works, but: >>> x = 1e100 >>> x + 1 == x True -- http

Re: printing list

2006-05-07 Thread Dan Sommers
;license" for more information. >>>> a=[1,2,3,4,5] >>>> print ', '.join (a) > Traceback (most recent call last): > File "", line 1, in ? > TypeError: sequence item 0: expected string, int found >>>> print ', '.join

Re: advanced number recognition in strings?

2006-05-09 Thread Dan Sommers
st the code somewhere if anyone is interested. > x = 0.032 +/- 0.5 x 10(-4) > y = 0.032 +/- 1.0 x 10(-4) > print x == y > print out? Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> "I wish people would die in alphabetical order." -- My wife, the genealogist -- http://mail.python.org/mailman/listinfo/python-list

Re: distutils

2006-05-09 Thread Dan Crosta
David S. wrote: > I have a what I a typical source tree, something like: > fsi\ > - common\ # some modules > - db\ # some modules > - someutility\ # my script > > I would like to create a setup script to install my script as a script as well > as the modules that is depends on, but where should th

Re: distutils

2006-05-09 Thread Dan Crosta
David S. wrote: > Thank you. This introduces a new problem for me. I have other scripts that I > want to install likewise. But now I have to overwrite setup.py for each > install. > > Alternatively, I can create script1setup.py, script2setup.py, etc. That would > be fine except that there are

Re: python rounding problem.

2006-05-09 Thread Dan Bishop
Grant Edwards wrote: ... > Did they actually have 60 unique number symbols and use > place-weighting in a manner similar to the arabic/indian system > we use? The Bablyonians did use a place-value system, but they only had two basic numerals: a Y-like symbol for 1 and a <-like symbol for ten. Thes

Re: python rounding problem.

2006-05-09 Thread Dan Bishop
Grant Edwards wrote: > On 2006-05-09, Dan Bishop <[EMAIL PROTECTED]> wrote: > > Grant Edwards wrote: > > ... > >> Did they actually have 60 unique number symbols and use > >> place-weighting in a manner similar to the arabic/indian system > >> we us

Re: data entry tool

2006-05-10 Thread Dan Sommers
just the opposite: that's 2MB of things someone else wrote in order that your application code remain small. Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> "I wish people would die in alphabetical order." -- My wife, the genealogist -- http://mail.python.org/mailman/listinfo/python-list

[OT] Unix Tools (was: deleting texts between patterns)

2006-05-12 Thread Dan Sommers
c/p' -e'/xyz/,$p' file.txt Or even awk '/abc/,/xyz/' file.txt Excluding the abc and xyz lines is left as an exercise to the interested reader. Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> "I wish people would die in alphabetical order." -- My wife, the genealogist -- http://mail.python.org/mailman/listinfo/python-list

Re: common practice for creating utility functions?

2006-05-15 Thread Dan Sommers
, then there's nothing wrong with a function consisting solely of another function call. If you end up with a lot of those tiny functions, though, and they persist through multiple development cycles, then you may be making a systematic mistake in your design. Regards, Dan -- Dan Sommers <ht

Re: round numbers in an array without importing Numeric or Math?

2006-05-16 Thread Dan Sommers
7;, u'58.6', u'97.8', u'10.0', u'9.6', u'28.1'] Then you'll have to convert your strings to floats first: [int(float(x)+0.5) for x in Test] HTH, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> "I wish people would die

Re: I'm just not cut out for web programming, I guess :)

2006-05-17 Thread Dan M
On Wed, 17 May 2006 20:51:07 +, John Salerno wrote: > Ok, I've tinkered with this thing for a while, and I keep fixing little > problems, but I always get a 500 Internal Server error when I go to this > site: > > I don't necessarily even want help just yet, I'd like to figure it out > myse

Re: MySQLdb - parameterised SQL - how to see resulting SQL ?

2006-05-17 Thread Dan Sommers
pysqlite and the API spec, I'd say no, not a standard way. OTOH, eventually, mysqldb has to create that SQL in order to pass it to the database for execution, so it's probably as simple as finding the right place to put a "print" statement and/or to store the fi

Re: Which is More Efficient?

2006-05-18 Thread dan . gass
Measure it and find out. Sounds like a little investment in your time learning how to measure performance may pay dividends for you. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python sqlite and regex.

2006-05-19 Thread Dan Sommers
sql = 'select foo from test where foo regex %s' cur.execute( sql, tuple( fooregex ) ) See the DP API spec for more information. Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> "I wish people would die in alphabetical order." -- My wife, the genealogist -- http://mail.python.org/mailman/listinfo/python-list

Re: Python sqlite and regex.

2006-05-19 Thread Dan Sommers
' matches one or more characters, and '?' matches > any single character - maybe add '#' to match any single digit and '@' > to match any single alpha character). Doesn't SQL already have lightweight wildcards? SELECT somefield FROM sometable WHE

Re: Python sqlite and regex.

2006-05-19 Thread Dan Sommers
On Fri, 19 May 2006 18:52:38 GMT, "Paul McGuire" <[EMAIL PROTECTED]> wrote: > "Dan Sommers" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Doesn't SQL already have lightweight wildcards? >> >> SELECT somefield FR

Re: Decimal and Exponentiation

2006-05-19 Thread Dan Bishop
Tim Peters wrote: ... > Wait <0.3 wink>. Python's Decimal module intends to be a faithful > implementation of IBM's proposed standard for decimal arithmetic: > > http://www2.hursley.ibm.com/decimal/ > > Last December, ln, log10, exp, and exponentiation to non-integral > powers were added to th

Re: dict!ident as equivalent of dict["ident"]

2006-05-21 Thread Dan Sommers
at the "Bunch" recipe in the Python Cookbook: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52308 Regards, Dan -- Dan Sommers <http://www.tombstonezero.net/dan/> "I wish people would die in alphabetical order." -- My wife, the genealogist -- http://mail.python.org/mailman/listinfo/python-list

Re: Software Needs Philosophers

2006-05-22 Thread Dan Mercer
h should act as a warning to all who employ the Socratic Method. Sadly, it doesn't. Dan Mercer -- http://mail.python.org/mailman/listinfo/python-list

Why can't timedeltas be divided?

2006-05-24 Thread Dan Bishop
If I try to write something like: num_weeks = time_diff / datetime.timedelta(days=7) I get: TypeError: unsupported operand type(s) for /: 'datetime.timedelta' and 'datetime.timedelta' Of course, one could extend the timedelta class to implement division, def _microseconds(self):

Re: Optional code segment delimiter?

2007-12-29 Thread Dan Bishop
On Dec 29, 12:41 pm, Matt Nordhoff <[EMAIL PROTECTED]> wrote: > xkenneth wrote: > > Is it possible to use optional delimiters other than tab and colons? > > > For example: > > > if this==1 { > > print this > > } > > > > Heheheh.. Wow! I

Re: Is there a string function to trim all non-ascii characters out of a string

2007-12-31 Thread Dan Bishop
On Dec 31, 2:20 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > Is there a string function to trim all non-ascii characters out of a > string? > Let say I have a string in python (which is utf8 encoded), is there a > python function which I can convert that to a string which composed o

Re: Basic inheritance question

2008-01-06 Thread Dan Bishop
On Jan 5, 4:53 am, Bjoern Schliessmann wrote: > [EMAIL PROTECTED] wrote: > > Jeroen Ruigrok van der Werven wrote: > >> self.startLoc = start > >> self.stopLoc = stop > > > Thanks! Of course it should. Old Java habits die slowly. > > That's not really a Java habit. In Java and C++, personally I lik

Re: for loop without variable

2008-01-09 Thread Dan Sommers
ot;in" operator may work better: for thing in array_or_file_or_dictionary: do_something_with(thing) HTH, Dan -- Dan Sommers A death spiral goes clock- <http://www.tombstonezero.net/dan/> wise north of the equator. Atoms are n

Re: *** American nationalism is FAKE and its MYTHS are LIES, YANK BASTARDS RAPED BY THEIR OWN MARINES - ***

2008-01-12 Thread Dan Upton
On Jan 12, 2008 5:15 PM, ChairmanOfTheBored <[EMAIL PROTECTED]> wrote: > On Sat, 12 Jan 2008 11:50:07 -0800 (PST), [EMAIL PROTECTED] wrote: > > >THERMUCK > > Is a goddmned retard. > -- > http://mail.python.org/mailman/listinfo/python-list > Why was this ever on the Python list (I assume it start

bags? 2.5.x?

2008-01-14 Thread Dan Stromberg
Is there a particular reason why bags didn't go into 2.5.x or 3000? I keep wanting something like them - especially bags with something akin to set union, intersection and difference. -- http://mail.python.org/mailman/listinfo/python-list

Re: bags? 2.5.x?

2008-01-17 Thread Dan Stromberg
On Mon, 14 Jan 2008 20:41:27 +0100, Wildemar Wildenburger wrote: > Dan Stromberg wrote: >> Is there a particular reason why bags didn't go into 2.5.x or 3000? >> >> I keep wanting something like them - especially bags with something >> akin to set union, inters

Re: bags? 2.5.x?

2008-01-21 Thread Dan Stromberg
On Thu, 17 Jan 2008 18:18:53 -0800, Raymond Hettinger wrote: >> >> I keep wanting something like them - especially bags with something >> >> akin to set union, intersection and difference. >> >> > How about this recepie >> > http://www.ubookcase.com/book/Oreilly/ >> >> The author of the bag class

A design problem

2008-01-30 Thread Dan Upton
s I go along and then dump them out to disk at the end of the Python program's execution. I feel like Python's lists or dictionaries should be useful here, but I'm not really sure how to apply them, particularly in a "Python-like" way. For anybody who made it all the way

Re: Will Python on day replace MATLAB?????????????????????????????????????????????????????

2008-01-31 Thread Dan Upton
> with ImpulseC and the graphing capabilities of GNU Plot and SciPy in http://gnuplot-py.sourceforge.net/ -- http://mail.python.org/mailman/listinfo/python-list

Re: CDA conversion

2008-02-01 Thread Dan Upton
/xiph.org/paranoia/ ), which is for Linux and has a SVN repository you can get the code from. Probably not the answer you were looking for, but maybe it's a start ;) -dan -- http://mail.python.org/mailman/listinfo/python-list

Re: bags? 2.5.x?

2008-02-01 Thread Dan Stromberg
On Wed, 23 Jan 2008 08:51:13 +0100, Christian Heimes wrote: > Dan Stromberg wrote: >> Is there a particular reason why bags didn't go into 2.5.x or 3000? >> >> I keep wanting something like them - especially bags with something >> akin to set union, intersection a

Re: Dear David (was: MyHDL project)

2008-02-07 Thread Dan Upton
On Feb 7, 2008 8:59 PM, ajaksu <[EMAIL PROTECTED]> wrote: > On Feb 7, 10:05 pm, "Blubaugh, David A." <[EMAIL PROTECTED]> wrote: > > I do not understand why people such as yourself cannot construct > > anything but insults and complaints. > > I can help with that. People asked politely a few days ag

Re: Reducing types

2008-02-10 Thread Dan Bishop
On Feb 10, 1:19 pm, [EMAIL PROTECTED] wrote: > For me Python is useful to write code that gives *correct* results, > allowing me to write it in a short & simple way, with quick debugging > cycles (and for other purposes, like to write dynamic code, to use it > as glue language to use libraries, to

Re: Solve a Debate

2008-02-15 Thread Dan Bishop
On Feb 15, 10:24 am, nexes <[EMAIL PROTECTED]> wrote: > Alright so me and my friend are having argument. > > Ok the problem we had been asked a while back, to do a programming > exercise (in college) > That would tell you how many days there are in a month given a > specific month. > > Ok I did my

Re: Floating point bug?

2008-02-16 Thread Dan Bishop
On Feb 14, 8:10 pm, Zentrader <[EMAIL PROTECTED]> wrote: > > That's a misconception. The decimal-module has a different base (10 > > instead of 2), and higher precision. But that doesn't change the fact > > that it will expose the same rounding-errors as floats do - just for > > different numbers.

Re: Critique of first python code

2008-02-16 Thread Dan Bishop
On Feb 8, 7:30 pm, Zack <[EMAIL PROTECTED]> wrote: >[snip] > > The generators you show here are interesting, and it prodded me on how > to add tuples but at the moment (I'm a python newbie) the generator > seems less readable to me than the alternative. After some input from > Scott David Daniels I

Re: How about adding rational fraction to Python?

2008-02-27 Thread Dan Bishop
On Feb 26, 11:21 pm, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Feb 26, 11:55 pm, Paul Rubin wrote: > > > So use: return sum(number_list) / float(len(number_list)) > > That makes it somewhat more explicit what you want. Otherwise > > But that fails for a list of Dec

Re: call by reference howto????

2008-02-27 Thread Dan Bishop
On Feb 27, 6:02 pm, Tamer Higazi <[EMAIL PROTECTED]> wrote: > Hi! > Can somebody of you make me a sample how to define a function based on > "call by reference" ??? > > I am a python newbie and I am not getting smart how to define functions, > that should modify the variable I passed by reference.

Re: How about adding rational fraction to Python?

2008-02-29 Thread Dan Bishop
On Feb 29, 12:55 am, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote: > On Thu, 28 Feb 2008 10:39:51 -, Steven D'Aprano > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > > > By that logic, we should see this: > > > >>> len("a string") > > '8' > > Why? len() is a functio

Re: OT: Failed saving throw

2008-03-05 Thread Dan Upton
On 5 Mar 2008 07:36:37 -0800, Aahz <[EMAIL PROTECTED]> wrote: > For anyone who hasn't heard, E. Gary Gygax died yesterday. Some people > think we should build a tomb in his honor. ;-) Yeah, I just saw a tribute on Order of the Stick: http://www.giantitp.com/comics/oots0536.html -- http://mail

Re: Why """, not '''?

2008-03-05 Thread Dan Bishop
On Mar 5, 7:24 pm, Matt Nordhoff <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: > > Surely it would depend on the type of text: pick up any random English > > novel containing dialogue, and you're likely to find a couple of dozen > > pairs of quotation marks per page, against a few apostrophes

Re: tcp

2008-03-08 Thread Dan Stromberg
On Sun, 02 Mar 2008 23:05:27 -0500, Roy Smith wrote: > In article > <[EMAIL PROTECTED]>, > Gabriel Genellina <[EMAIL PROTECTED]> wrote: > >> On 2 mar, 17:21, [EMAIL PROTECTED] wrote: >> >> > This worked: >> > >> > import socket >> > from time import time >> > >> > for i in range( 20 ): >> >    

Re: Regarding coding style

2008-03-08 Thread Dan Bishop
On Mar 8, 1:31 pm, Grant Edwards <[EMAIL PROTECTED]> wrote: ... > > What I really can't stand are the pointy-haired comment blocks > at the beginnings of C/C++ functions that do things like tell > you the name and return type of the function and list the names > and types of the parameters. Gee, t

Re: execute

2008-03-09 Thread Dan Upton
't used it. Also, you might check the subprocess module -- http://docs.python.org/lib/module-subprocess.html . -dan -- http://mail.python.org/mailman/listinfo/python-list

Re: tcp client socket bind problem

2008-03-12 Thread Dan Stromberg
On Sun, 09 Mar 2008 22:21:59 -0700, natambu wrote: > I have a linux box with multiple ip addresses. I want to make my python > client connect from one of the ip addresses. Here is my code, no matter > what valid information I put in the bind it always comes from the > default ip address on the ser

Re: no more comparisons

2008-03-12 Thread Dan Bishop
On Mar 12, 6:52 pm, Alan Isaac <[EMAIL PROTECTED]> wrote: > Paul Rubin wrote: > > The cmp option should not be removed. However, requiring > > it to be specified as a keyword parameter instead of just > > passed as an unlabelled arg is fine. > > Sure; I would have no problem with that. > > But tha

Re: macro in python

2008-03-12 Thread Dan Stromberg
On Wed, 27 Feb 2008 16:24:02 +0530, bharath venkatesh wrote: > hi .. > how to create macro in python for set of instruction that is done > frequently but too less in number to ignore the overhead of function > call ... > hi ..    how to create macro in python for set of > instruction that is d

Re: no more comparisons

2008-03-13 Thread Dan Bishop
On Mar 13, 7:38 pm, Alan Isaac <[EMAIL PROTECTED]> wrote: > Mark Dickinson wrote: > > Sorting tuples, where the second item in the tuple should > > have the opposite ordering to the first is going to be > > a bit of a pain. Or even worse, where the ordering of the > > second item depends on the va

Re: Convert int to float

2008-03-15 Thread Dan Bishop
On Mar 15, 4:43 pm, Guido van Brakel <[EMAIL PROTECTED]> wrote: > Hello > > I have this now: > > > def gem(a): > > g = sum(a) / len(a) > > return g > > > print gem([1,2,3,4]) > > print gem([1,10,100,1000]) > > print gem([1,-2,3,-4,5]) > > It now gives a int, but i would like to see floats.

Re: Immutable and Mutable Types

2008-03-16 Thread Dan Bishop
Bernard Lim wrote: > Hi, > > I'm reading the Python Reference Manual in order to gain a better > understanding > of Python under the hood. > > On the last paragraph of 3.1, there is a statement on immutable and mutable > types as such: > > > Depending on implementation, for immutable types, opera

Re: String To List

2008-03-17 Thread Dan Bishop
On Mar 17, 1:15 am, Girish <[EMAIL PROTECTED]> wrote: > I have a string a = "['xyz', 'abc']".. I would like to convert it to a > list with elements 'xyz' and 'abc'. Is there any simple solution for > this?? > Thanks for the help... eval(a) will do the job, but you have to be very careful about usi

Re: Python to C/C++

2008-03-20 Thread Dan Stromberg
On Wed, 19 Mar 2008 10:24:16 -0700, Patrick Mullen wrote: > (sorry michael, didn't mean to personal post > > On Wed, Mar 19, 2008 at 9:24 AM, Michael Wieher wrote: > > I think py2exe does this, but it might be a bit bloated > > No, py2exe basically bundles the main script and the interpreter >

Re: forkpty not working?

2008-03-20 Thread Dan Stromberg
If you google a bit, I believe you'll find one or more python modules for working with ssh. Also, if you want to roll your own, the easiest way to get around the password requirement is to use ssh passwordless authentication using DSA or RSA public/private keypairs: http://stromberg.dnsalias.

Re: NameError: name 'guess' is not defined

2008-03-22 Thread Dan Bishop
On Mar 22, 10:44 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > > > I am very new to both programming and Pyhton and while trying to do > > some practice using A byte of python an Error pops up on the IDLE > > shell. I am using windows XP. PLease see below. > >

Re: python hash() function

2008-03-25 Thread Dan Bishop
On Mar 25, 9:22 pm, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Alvin Delagon" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > | Hello, > | > | >>> hash("foobar") > | -1969371895 > | > | Anyone can explain to me how the hash() function in python does its work? > A > | link to its

Re: what does ^ do in python

2008-03-26 Thread Dan Stromberg
On Wed, 26 Mar 2008 19:45:34 +0100, Heiko Wundram wrote: > Am Mittwoch, 26. März 2008 19:04:44 schrieb David Anderson: >> HOw can we use express pointers as in C or python? > > There's no such thing as a pointer in Python, so you can't "express" > them either. Was this what you were trying to ask

Re: Why does python behave so? (removing list items)

2008-03-26 Thread Dan Bishop
On Mar 26, 5:12 pm, Thomas Dybdahl Ahle <[EMAIL PROTECTED]> wrote: > On Wed, 2008-03-26 at 23:04 +0100, Michał Bentkowski wrote: > > Why does python create a reference here, not just copy the variable? > > Python, like most other oo languages, will always make references for =, > unless you work on

Re: counting using variable length string as base

2008-03-26 Thread Dan Bishop
On Mar 27, 1:15 am, Grimsqueaker <[EMAIL PROTECTED]> wrote: > Hi, I'm fairly new to Python and to this list. I have a problem that > is driving me insane, sorry if it seems simple to everyone, I've been > fighting with it for a while. :)) > > I want to take a variable length string and use it as a

Re: Pythonic list/tuple/dict layout?

2009-01-25 Thread Dan Bishop
On Jan 25, 2:18 am, Akira Kitada wrote: > Hi, > > There is more than one way to write a list/tuple/dict in Python, > and actually different styles are used in standard library. > As a hobgoblin of little minds, I rather like to know which style is > considered "Pythonic" > in the community. > > I

Re: nth root

2009-01-30 Thread Dan Goodman
f (10**100)**(1./13) (floats have about 7 and doubles about 16). Dan Tim wrote: In PythonWin I'm running a program to find the 13th root (say) of millions of hundred-digit numbers. I'm using n = 13 root = base**(1.0/n) which correctly computes the root to a large number of

Re: nth root

2009-01-31 Thread Dan Goodman
urate than a double. So for example int(1e100**(1./3)) is a long way from being the integer part of the true cube root (it's between 10**18 and 10**19 away). Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: nth root

2009-01-31 Thread Dan Goodman
. :-) Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is c.l.py becoming less friendly?

2009-02-05 Thread Dan Upton
On Thu, Feb 5, 2009 at 11:00 AM, mk wrote: > > (duck) > > 542 comp.lang.python rtfm > > 467 comp.lang.python shut+up > > 263 comp.lang.perl rtfm > > 45 comp.lang.perl shut+up > But over how many messages for each group? Wouldn't the percentage of messages containing those be more interesting than

Re: Is c.l.py becoming less friendly?

2009-02-05 Thread Dan Upton
On Thu, Feb 5, 2009 at 12:37 PM, Tim Rowe wrote: > 2009/2/5 Tim Chase : > >> Is this where we tell you to shut up? ;-) > > [snip] > >> It would also be interesting to see how many of those posts are concentrated >> in certain threads > > And, as you have clearly demonstrated, how many of those po

SQL error

2009-02-11 Thread Dan McKenzie
MySQLdb/connections.py", line 35, in defaulterrorhandler raise errorclass, errorvalue _mysql_exceptions.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'to,from,bytes,

Re: code challenge: generate minimal expressions using only digits 1,2,3

2009-02-20 Thread Dan Goodman
This sounds kind of similar to a problem I posted to this list last year, you might find that thread gives you some ideas: http://mail.python.org/pipermail/python-list/2008-January/474071.html Dan -- http://mail.python.org/mailman/listinfo/python-list

Re: Off Topic: Re: Obama's Birth Certificate - Demand that US presidential electors investigate Obama's eligibility

2008-12-04 Thread Dan Upton
[snip > > > Follow-ups again set to talk.politics. Of course that may be futile in > dealing with this kind of scumbag. > > -- > --Bryan Also, changing newsgroups followups doesn't affect replying to the mailing list. -- http://mail.python.org/mailman/listinfo/python-list

Re: [OT] stable algorithm with complexity O(n)

2008-12-13 Thread Dan Upton
On Sat, Dec 13, 2008 at 2:00 PM, David Hláčik wrote: >> Unless I grossly miss out on something in computer science 101, the lower >> bound for sorting is O(n * log_2 n). Which makes your task impossible, >> unless there is something to be assumed about the distribution of numbers in >> your sequen

Re: stable algorithm with complexity O(n)

2008-12-15 Thread Dan Upton
On Mon, Dec 15, 2008 at 11:05 AM, wrote: >> Non-comparison sorts are a useful technique, but it's changing the >> problem, and they are only useful in very limited circumstances. There's >> a good reason that most sort routines are based on O(n*log n) comparison >> sorts instead of O(n) bucket so

Re: stable algorithm with complexity O(n)

2008-12-22 Thread Dan Upton
On Mon, Dec 22, 2008 at 12:29 PM, wrote: > On Dec 15, 10:00 pm, "cmdrrickhun...@yaho.com" > wrote: >> It can be proven that you cannot sort an arbitrarily large set of >> numbers, given no extra information, faster than O(n log n). > > Cormen Leiserson and Rivest, "Algorithms", have a short clea

SVG & Canvas: Graphics for the Web

2008-12-26 Thread Tokyo Dan
Is there a Python library that can draw/write graphics to web browsers vis SVG & Canvas via some kind of Python to javascript translation/ compilation? -- http://mail.python.org/mailman/listinfo/python-list

Re: If your were going to program a game...

2009-01-02 Thread Tokyo Dan
On Jan 3, 12:02 am, J Kenneth King wrote: > Tokyo Dan writes: > > If your were going to program a game in python what technologies would > > you use? > > > The game is a board game with some piece animations, but no movement > > animation...think of a chess king

If your were going to program a game...

2009-01-06 Thread Tokyo Dan
If your were going to program a game in python what technologies would you use? The game is a board game with some piece animations, but no movement animation...think of a chess king exploding. The game runs in a browser in a window of a social site built around the game. The social site has login

<    14   15   16   17   18   19   20   21   22   23   >