Re: IsString

2005-12-15 Thread Steven D'Aprano
On Thu, 15 Dec 2005 08:22:37 +, Steve Holden wrote: > Hear, hear. However you describe it Python is what it is, and this > interminable discussion about its similarities with and differences from > various concepts (most lately call by name/call by value) doesn't much > aid understanding fo

Re: doubt on csv file

2005-12-15 Thread Dan M
> here is what am trying to do, first am trying to open it in a read > mode, and checking each row by row , if it is not found till my last > row, i want to append it to the last row , so how should i do that. > > file = open ('C:\some.csv','r') > reader = csv.reader(file) > for row in reader: >

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Mike Meyer
[EMAIL PROTECTED] writes: > The point is again, "obvious" is not so obvious sometimes. You keep leaving out the context. We're writing *python*. What's obvious when you're writing python won't be when you're writing FORTRAN, or Scheme, or O'Caml, or Eiffel, or Generally (not always, I'll admi

Re: ?: in Python

2005-12-15 Thread Steven D'Aprano
On Wed, 14 Dec 2005 20:17:28 -0500, Andy Leszczynski wrote: > I can tell you what is not elegant in the if else: approach. It is > logically a one operation while you are forced to use varaible "a" > twice. Fundamental flaw IMO. "Logically" one operation? def twenty_countries_in_seven_days_bus

Re: IsString

2005-12-15 Thread Steven D'Aprano
On Wed, 14 Dec 2005 18:17:57 -0800, Tuvas wrote: > I don't know if I can help with this much, I'm still somewhat new to > python, but it is my understanding that "simple" variable, ei, strings, > ints, etc, although they don't have such names, behave like variables, > ei, if you pass them to a fun

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Dave Benjamin
On Thu, 15 Dec 2005, Richie Hindle wrote: > [Steve] >> Since Python is Turing-complete > > Is there some equivalent of Godwin's Law that we can invoke at this > point? 8-) None that I know of, but perhaps there should be. =) Note that in this particular thread, we could have invoked the real Go

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Dave Benjamin
On Thu, 15 Dec 2005, Simon Brunning wrote: > On 12/15/05, Steve Holden <[EMAIL PROTECTED]> wrote: >> Aahz wrote: >>> python -c 'import this' >> >> Faster: >> >>python -m this > > So, there's two ways to do it. ;-) Yes, but which way do you do it if you're Dutch? -- http://mail.python.org

Re: RoR like (was : SPE 0.8.1.b Python IDE...)

2005-12-15 Thread Dave Benjamin
On Thu, 15 Dec 2005, Adrian Holovaty wrote: > bruno at modulix wrote: >> RoR is not an IDE, it's a web framework. The closest things in Python >> are TurboGears (good Ajax/js support via Mochikit), Subway (never >> tested), and Django (no Ajax support AFAIK). > > Note that "no Ajax support" is mi

Re: doubt on csv file

2005-12-15 Thread muttu2244
hey thanks a lot for that it worked . -- http://mail.python.org/mailman/listinfo/python-list

Re: Tuples

2005-12-15 Thread Xavier Morel
Tuvas wrote: > Let's say I make a program something like follows: > > x=[] > x.append([1,2,3]) > x.append([4,5,6]) > print x > print x[0] > print x[0][1] > x[0][1]=5 > > Okay, everything works here as expected except the last line. Why won't > this work? Thanks for the help! > Works for me, do y

Re: RoR like (was : SPE 0.8.1.b Python IDE...)

2005-12-15 Thread Xavier Morel
Adrian Holovaty wrote: > bruno at modulix wrote: >> RoR is not an IDE, it's a web framework. The closest things in Python >> are TurboGears (good Ajax/js support via Mochikit), Subway (never >> tested), and Django (no Ajax support AFAIK). > > Note that "no Ajax support" is misleading. Of course yo

Re: doubt on csv file

2005-12-15 Thread Dan M
On Thu, 15 Dec 2005 16:09:51 -0800, muttu2244 wrote: > hey thanks a lot for that it worked . Excellent! Glad to be of assistance :) -- http://mail.python.org/mailman/listinfo/python-list

problem with "os.spawnle(os.P_NOWAIT,'C:\info.exe')"

2005-12-15 Thread muttu2244
hi all i tried running a exe file info.exe from the spawnle cmd, its running fine from the interactive mode, but when i try to run the same info.exe file from a python file, its giving me the following error: ## Traceback (most recent ca

Re: IsString

2005-12-15 Thread Chris Mellon
> Terminology is important, because we understand the world through > language. If your language is confused or misleading, your understanding > will also be confused or incomplete. I think the issue is pretty simple, myself: With mutable objects, Python has the semantics normally associated wit

Re: ActivePython and Amara

2005-12-15 Thread Jay
that like displays all the items, i want to just get one two three and such. Can't i get just the first three and i also want them to display individually such as title1 = just the title of item 1 and descp = would be the descrp of item one, and so one... I dont need a list of all titles... Is ther

Re: IsString

2005-12-15 Thread Chris Mellon
On 12/15/05, Chris Mellon <[EMAIL PROTECTED]> wrote: > > > Terminology is important, because we understand the world through > > language. If your language is confused or misleading, your understanding > > will also be confused or incomplete. > > I think the issue is pretty simple, myself: > > Wit

RE: IsString

2005-12-15 Thread Delaney, Timothy (Tim)
Chris Mellon wrote: > >> Terminology is important, because we understand the world through >> language. If your language is confused or misleading, your >> understanding will also be confused or incomplete. > > I think the issue is pretty simple, myself: > > So you could say that Python has bot

Python IDE (was: PythonWin troubleshooting)

2005-12-15 Thread chuck
Apparently not too many people use or are interested in PythonWin. I'm giving up on it. It used to work pretty good. I'm lucky that I have found PyScripter (http://www.mmm-experts.com/) a python IDE for the windows platform which is much more stable and has more features that PythonWin. If you

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread John Hazen
* Chris Mellon <[EMAIL PROTECTED]> [2005-12-15 06:09]: > (Am I dating myself? Do teenagers still put studs on their jackets?) No. They put studs in their lips, tongues, eyebrows, navels, and sexual organs. Oh, and ears. (How quaint.) -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread chuck
> People keep talking about Python's wealth of web frameworks as if it > were a bad thing. I disagree somewhat. While variety and choice are nice, sometimes having too many choices may inhibit people from trying the language because they don't know where to start in terms of framworks. Maybe I'm

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Roy Smith
In article <[EMAIL PROTECTED]>, John Hazen <[EMAIL PROTECTED]> wrote: > * Chris Mellon <[EMAIL PROTECTED]> [2005-12-15 06:09]: > > (Am I dating myself? Do teenagers still put studs on their jackets?) > > No. They put studs in their lips, tongues, eyebrows, navels, and sexual > organs. > > Oh,

Re: IsString

2005-12-15 Thread Mike Meyer
Chris Mellon <[EMAIL PROTECTED]> writes: > I think the issue is pretty simple, myself: > With mutable objects, Python has the semantics normally associated > with pass-by-reference. Except when it doesn't. For instance, if that were true, then in this: >>> def inc(x): ... x = x + [1] ... >>> y

Re: Python IDE (was: PythonWin troubleshooting)

2005-12-15 Thread Martin Miller
You might want to also to consider the Komodo IDE from ActiveState (the same company that produces ActivePython and hosts the ASPN Cookbook). This isn't an endorsement -- I have no experience with it -- but its feature set looks good [see http://activestate.com/Products/Komodo]. If someone with

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Kay Schluehr
Tolga wrote: > As far as I know, Perl is known as "there are many ways to do > something" and Python is known as "there is only one way". Could you > please explain this? How is this possible and is it *really* a good > concept? Do you know about the existence of god, just or scientific truth? Of

Re: Python IDE (was: PythonWin troubleshooting)

2005-12-15 Thread limodou
15 Dec 2005 18:03:27 -0800, Martin Miller <[EMAIL PROTECTED]>: > You might want to also to consider the Komodo IDE from ActiveState (the > same company that produces ActivePython and hosts the ASPN Cookbook). > This isn't an endorsement -- I have no experience with it -- but its > feature set look

Re: in Python

2005-12-15 Thread Andrew Koenig
"Andy Leszczynski" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > How can do elegantly in Python: > > if condition: >a=1 > else: >a=2 I believe that before long Python will support a=1 if condition else 2 -- http://mail.python.org/mailman/listinfo/python-list

Re: doubt on csv file

2005-12-15 Thread skip
shiva> am trying to search whtr my string is found in a csv file, if its shiva> not found i have to append it at the last row of a csv file, How shiva> can i do that?? Given that you specified a csv file, I presume you want to maintain the proper semantics. You clearly know how to re

Re: Problem with Lexical Scope

2005-12-15 Thread [EMAIL PROTECTED]
Well, the the comparison operations are just a special case really.I don't know about the obfuscation contest. I've attempted to make an extensible library. def lt(*fields): return collect(fields, lambda x, y: x < y) def gt(*fields): return collect(fields, lambda x, y: x > y) def gte(*fi

Re: SVG rendering with Python

2005-12-15 Thread richard
Andreas Lobinger wrote: > richard wrote: >> Dennis Benzinger wrote: >>>Does anybody know of a SVG rendering library for Python? >> Google "python svg" > > ... to find what? The answer to the OP's question. Richard -- http://mail.python.org/mailman/listinfo/python-list

Re: Haskell Typeclasses

2005-12-15 Thread Alex Martelli
Kay Schluehr <[EMAIL PROTECTED]> wrote: ... > > typeclass mapping: > > def __getitem__(self, key): > > _notthere=[] > > result = self.get(key, _notthere) > > if result is notthere: raise KeyError > > return result > > def get(self, key, default): > > try: return self[key]

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread Alex Martelli
chuck <[EMAIL PROTECTED]> wrote: > > People keep talking about Python's wealth of web frameworks as if it > > were a bad thing. > > I disagree somewhat. While variety and choice are nice, sometimes > having too many choices may inhibit people from trying the language > because they don't know wh

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread Robert Kern
Alex Martelli wrote: > I agree with chuck. I've seen excellent programmers explain why for > some urgent problem they chose Ruby on Rails rather than Java or Python: > Ruby has ONE web framework (that matters), so the choice was finished > there; to evaluate properly 50 frameworks for Java or 20

Re: Robotics and parallel ports

2005-12-15 Thread Peter Hansen
Isaac T Alston wrote: > I've never actually built a robot or anything like that > before, so I'm welcome to any advice I can get! I've heard programming via > USB is hard, so that's why I'm using the parallel port (serial ports are > said to be slow when sending a lot of data (I think)). How much

Re: special operator =+

2005-12-15 Thread Peter Hansen
[EMAIL PROTECTED] wrote: > kenny Nguyen>Does anyone know the operator "=+"? > > It isn't an operator, it's equivalent to = (assignment) only. Though actually it would try to call the __pos__ method on the object prior to binding it to the name on the left side. (Much as - would call the __neg_

Re: ActivePython and Amara

2005-12-15 Thread James
Jay, You are practically asking the community to write your 4 line program for you. Read Alex's post (first one in this thread, 2nd and 3rd paragraphs) slowly and carefully again. If you understand the absolute basics of Python, you would not be asking this question, nor the previous one. You are

Re: ?: in Python

2005-12-15 Thread Kent Johnson
Andy Leszczynski wrote: > How can do elegantly in Python: > > if condition: >a=1 > else: >a=2 > > like in C: > > a=condition?1:2 > a = condition and A or B is concise but will fail if A can evaluate as false, e.g. a = condition and None or 2 # won't do what you want I tend to use 'con

Re: Swig-Mingw-DistUtil Extension - Entry Point Not Found?

2005-12-15 Thread kevin . dahlhausen
I was able to build a working extension module under 2.4 / cygwin-mingw by declaring the following: short ** _imp___ctype = 0; ( I put it at the top of my swig .i file ). This potentially dangerous tip is from: http://www.nabble.com/msvcr71-t336430.html -- http://mail.python.org/mailman/listin

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread Alex Martelli
Robert Kern <[EMAIL PROTECTED]> wrote: ... > Picking RoR because you want to do the project in Ruby makes sense. > Picking Ruby because it only has one web framework is as silly as picking > one Python web framework at random. Just because RoR is the only Ruby web > framework around doesn't mean

Enumeration idioms: Values from different enumerations

2005-12-15 Thread Ben Finney
[quoting private email with permission] Antoon Pardon wrote: > I just downloaded your enum module for python [from the Cheeseshop] > and played a bit with it. IMO some of the behaviour makes it less > usefull. Feedback is appreciated. I'm hoping to provide a "one obvious way" to do enumerations i

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > To put it another way: one reason I love Python is that I strongly > subscribe to the idea that there should preferably be only one obvious > way to do something. Unfortunately, this principle is very badly broken > by the multiplicity of Python web fram

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread Alex Martelli
Paul Rubin wrote: > [EMAIL PROTECTED] (Alex Martelli) writes: > > To put it another way: one reason I love Python is that I strongly > > subscribe to the idea that there should preferably be only one obvious > > way to do something. Unfortunately, this principle is very

Re: ActivePython and Amara

2005-12-15 Thread Jay
i knew someone would snap on me... lol. Its not that i dibt ubderstand all of python, its just that i dont understand this specific module since i couldnt find any good tutorials on this specific module. its not the whole programming part, its just the module. I made my program jsut how i wanted it

Re: Enumeration idioms: Values from different enumerations

2005-12-15 Thread Peter Hansen
Ben Finney wrote: > These are valid concerns. I can't see how to reconcile these against > the desire for values from different enums to fail comparison. > > Am I alone in my tri-state view of enumeration value comparisons? Can > anyone else defend why values from different enumerations should not

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

2005-12-15 Thread seb . haase
This was my point though: I found the *description* - but no wordon WHICH implementation to get WHERE ? Don't get me wrong - I like Python and I will stick to it for some time to come ... but WHY are the places to get those SQL implementations not better marked: Just try to google for "python sql"

Re: ActivePython and Amara

2005-12-15 Thread Jay
i knew someone would snap on me... lol. Its not that i dibt ubderstand all of python, its just that i dont understand this specific module since i couldnt find any good tutorials on this specific module. its not the whole programming part, its just the module. I made my program jsut how i wanted it

Problem with os.path

2005-12-15 Thread Daya Kiran Sunkara
Hi All, I have a program which fetches the list of files inside a directory. For fetching this list I am making use of the glob.glob method which takes path as a parameter. For building the path I am making use of os.path.join. My code looks somewhat like this:

The difference between "import package.module" and "from package import module"(about pymol)

2005-12-15 Thread Xiao Jianfeng
Hello, In pymol I can use "from chempy import Atom" but "import chempy.Atom" doesn't work. It says,"ImportError: No module named Atom". What is going wrong ? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread Robert Kern
Alex Martelli wrote: > Robert Kern <[EMAIL PROTECTED]> wrote: >... > >>Picking RoR because you want to do the project in Ruby makes sense. >>Picking Ruby because it only has one web framework is as silly as picking >>one Python web framework at random. Just because RoR is the only Ruby web >>f

Re: Problem with os.path

2005-12-15 Thread Pelmen
sorry? if i'm wrong? but i'm think you have to use double slash, to prevent escape-interpreting as '\n' for example -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread Mike Meyer
[EMAIL PROTECTED] (Alex Martelli) writes: > Robert Kern <[EMAIL PROTECTED]> wrote: >... >> Picking RoR because you want to do the project in Ruby makes sense. >> Picking Ruby because it only has one web framework is as silly as picking >> one Python web framework at random. Just because RoR is

Re: Enumeration idioms: Values from different enumerations

2005-12-15 Thread Mike Meyer
Peter Hansen <[EMAIL PROTECTED]> writes: > For example, if enumerations are intended to reduce the likelihood of > certain types of errors (where the use of typical =3 "constants" > might be more prone to errors), then perhaps this suggests that > passing errors silently is bad. That is, tryin

Visual Python : finished ?

2005-12-15 Thread Do Re Mi chel La Si Do
Hi! See : http://www.activeperl.com/Products/Visual_Perl/?mp=1 @+ MCI -- http://mail.python.org/mailman/listinfo/python-list

Re: ActivePython and Amara

2005-12-15 Thread Jay
BTW, i finished this tutorial long ago... http://www.ibiblio.org/obp/thinkCSpy/ -- http://mail.python.org/mailman/listinfo/python-list

Can Python write foreign characters to the console?

2005-12-15 Thread Bock
I was just told about Python. My searching and reading over the net I was able to learn that Python can handle "foreign" characters via Unicodes. Can or does Python write unicode to the screen? For example, in c++ cout >> "Hello World." would send this string to the screen/monitor. I want t

Re: Can Python write foreign characters to the console?

2005-12-15 Thread Martin v. Löwis
Bock wrote: > I was just told about Python. My searching and reading over the net > I was able to learn that Python can handle "foreign" characters via > Unicodes. > > Can or does Python write unicode to the screen? Yes. Just do # -*- coding: iso-8859-1 -*- print u"Martin v. Löwis" in a Pyt

Re: python24.dll and encodings ?

2005-12-15 Thread Martin v. Löwis
Bugs wrote: > New PEP: "Small is beautiful!" ;-) A PEP would have to be more elaborate than that; it best be accompanied with an implementation as well. Somebody has to do the work. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: ActivePython and Amara

2005-12-15 Thread alex23
> i know much about python and i dont excactly need help > learning the basics of python because i know it, once again, its the > module i need help with... No, you _really_ don't. If you were python-capable, you would have been able to extrapolate from the example I gave above to answer your own

Re: Why and how "there is only one way to do something"?

2005-12-15 Thread Brian van den Broek
[EMAIL PROTECTED] said unto the world upon 2005-12-15 07:50: > obvious). It is just like there are language on this planet that reads > from right to left horizontally, as well as top to bottom, then right > to left. And you are trying to tell them that English way is the "right > way" or the obvi

Re: IsString

2005-12-15 Thread Donn Cave
Quoth Chris Mellon <[EMAIL PROTECTED]>: | |> Terminology is important, because we understand the world through |> language. If your language is confused or misleading, your understanding |> will also be confused or incomplete. | | I think the issue is pretty simple, myself: | | With mutable object

Re: ActivePython and Amara

2005-12-15 Thread Jay
lol, u guys love picking on me... LOL, i didnt even realize it was creating a list, i know, dumb but true... -- http://mail.python.org/mailman/listinfo/python-list

Re: to write set of values to a file from python

2005-12-15 Thread Steve Holden
[EMAIL PROTECTED] wrote: > hi > thanks every body for the help. > > Now how can check whtr the row am reading is the last row or not?? > > for example for this below data in csv file > > CompName,IpAddr,MacAddr > XXX,192.178.23.11,78.23.34.23.12 > YYY,192.189.22.11,89.23.43.12.34 > ZZZ,192.17

Re: Which Python web framework is most like Ruby on Rails?

2005-12-15 Thread gene tani
Robert Kern wrote: > > http://pyre.third-bit.com/pyweb/index.html > http://colorstudy.com/docs/shootout.html > i started flipping thru "Snakes and rubies" google hits now at 127k, waaay up from yesterday's 37k. The 2nd hit is Adrian Holovaty's which has a good link to Zrusilla's summary. Adria

Re: Can Python write foreign characters to the console?

2005-12-15 Thread Do Re Mi chel La Si Do
Hi! On windows, you MUST also configure the console. Use CHCP for to force the good code-page. And, right-click + property + font, for to choice the good font. With that, I can visu french accents, cyrillic, etc. @-salutations Michel Claveau -- http://mail.python.org/mailman/listinfo/pyth

Re: Haskell Typeclasses

2005-12-15 Thread Kay Schluehr
Alex Martelli wrote: > > I don't see why your typeclass illustration does not apply to ABCs as > > Because in a class, A or B or not, this code WOULD mean mutual recursion > (and it can't be checked whether recursion terminates, in general). In > a typeclass, it means something very different --

getsockopt

2005-12-15 Thread Fabian Deutsch
Hello, my name is fabian and i'm a student from northern germany. right now i try to create som kind of decapsulation of esp-udp packets using python. therefor i need to use the socket.getsockopt (SOL_IP, IP_OPTIONS, 20) method. But al i get is some empty value. Nothin. Does someone know or have

Re: How to get the local mac address?

2005-12-15 Thread Dejan Rodiger
I was looking on how to get MAC address universally (Windows and Linux) and found one package that is doing that and more... http://libdnet.sourceforge.net/ -- Dejan Rodiger - PGP ID 0xAC8722DC Delete wirus from e-mail address -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get the local mac address?

2005-12-15 Thread bonono
Dejan Rodiger wrote: > I was looking on how to get MAC address universally (Windows and Linux) and > found one package that is doing that and more... > > http://libdnet.sourceforge.net/ > Thanks for the info. -- http://mail.python.org/mailman/listinfo/python-list

Re: python24.dll and encodings ?

2005-12-15 Thread Bugs
Martin v. Löwis wrote: > Bugs wrote: > >>New PEP: "Small is beautiful!" ;-) > > > A PEP would have to be more elaborate than that; > it best be accompanied with an implementation as well. > Somebody has to do the work. > > Regards, > Martin > That was my obviously ineffective attempt at hum

Re: getsockopt

2005-12-15 Thread Fabian Deutsch
Forgot: > The lines: > s = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP) > s.bind(('',4500)) > while 1:# Run until cancelled > message, client = s.recvfrom(1400) # <=256 byte datagram > hdr = s.getsockopt (SOL_IP, IP_OPTIONS, 20) > print "Client connected:", client > pri

<    1   2   3