Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Steven D'Aprano
On Tue, 20 Jan 2009 15:04:34 +1000, James Mills wrote: > Having come from all kinda of programming backgrounds and paradigms you > learn to see the value in Python and the kind of simplicity it has to > offer. Oh yes, it is liberating to say "I don't care if my method crashes (raises an exceptio

Re: function to find the modification date of the project

2009-01-20 Thread Steven D'Aprano
On Mon, 19 Jan 2009 20:22:55 -0700, Joe Strout wrote: >> What if a curious user simple looks at a file with an editor and saves >> it without change? > > You can't do that, on the Mac at least... Are you sure? That's a rather incredible claim. Surely you mean *some Mac editors* disable the Save

Re: reading file to list

2009-01-20 Thread Xah Lee
On Jan 19, 11:17 pm, alex23 wrote: ... Hi Daniel Weinreb, Xah wrote: > • A Ruby Illustration of Lisp Problems > http://xahlee.org/UnixResource_dir/writ/lisp_problems_by_ruby.html Daniel Weinreb wrote: > Xah Lee: Elisp is an interesting choice. But without converting the > strings to integers,

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Duncan Booth
Luis Zarrabeitia wrote: > It boggles me when I see python code with properties that only set and > get the attribute, or even worse, getters and setters for that > purpose. In my university they teach the students to write properties > for the attributes in C# ("never make a public attribute, alw

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Paul Rubin
Luis Zarrabeitia writes: > No wonder you can't get Bruno's point. For the second, static checks > to prevent accidents, you have pylint. For the first, not only you > are using the wrong tool, but you are barking at python for not > having it. Assuming that pylint is perfect (big assumption, but i

Re: Logging help

2009-01-20 Thread koranthala
On Jan 20, 5:45 am, Chris Rebert wrote: > On Mon, Jan 19, 2009 at 11:36 AM, koranthala wrote: > > Hi, > >   Is it possible somehow to have the logging module rotate the files > > every time I start it. > >   Basically, I can automatically rotate using RotatingFileHandler; > > Now I want it rotate

Re: Python 3: exec arg 1

2009-01-20 Thread Alan G Isaac
On 1/18/2009 9:36 AM Alan G Isaac apparently wrote: I do not much care about the disappearance of ``execfile``. I was asking, why is it a **good thing** that ``exec`` does not accept a TextIOWrapper? Or is it just not implemented yet? What is the gain from this particular backwards incompatibilit

Doubts related to subprocess.Popen()

2009-01-20 Thread srinivasan srinivas
Hi, Does subprocess.Popen() count a new open file for each suprocess? I mean does it occupy an entry in file descriptor table of parent process? If so, wat is each file descriptor connected to? Thanks, Srini Add more friends to your messenger and enjoy! Go to http://messenger.yahoo.com/i

Re: what's the point of rpython?

2009-01-20 Thread skip
Carl> I just looked at the boost documentation, which claims that Carl> multiple asynchronous writes to the same shared_ptr results in Carl> undefined behavior. That will not suffice for Python reference Carl> counting. Carl, I'm quite unfamiliar with Boost and am not a C++ perso

How to start a transaction?

2009-01-20 Thread Hussein B
Hey, I know the basics of interacting with databases in Python. How to start a transaction in case I want to group a couple of insert and update statements into a single operation? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to start a transaction?

2009-01-20 Thread Diez B. Roggisch
Hussein B wrote: > Hey, > I know the basics of interacting with databases in Python. > How to start a transaction in case I want to group a couple of insert > and update statements into a single operation? Please read the python database API documentation: http://www.python.org/dev/peps/pep-0249

Re: what's the point of rpython?

2009-01-20 Thread Paul Rubin
s...@pobox.com writes: > Carl, I'm quite unfamiliar with Boost and am not a C++ person, so may have > read what you saw but not recognized it in the C++ punctuation soup. I > couldn't find what you referred to. Can you provide a URL? http://www.boost.org/doc/libs/1_37_0/libs/smart_ptr/shared_ptr

How to print lambda result ?

2009-01-20 Thread Barak, Ron
Hi, Wanting to print the correct plural after numbers, I did the following: for num in range(1,4): string_ = "%d event%s" % (num,lambda num: num > 1 and "s" or "") print string_ However, instead of getting the expected output: 1 event 2 events 3 events I get: 1 event at 0x00AFE670> 2

python resource management

2009-01-20 Thread S.Selvam Siva
Hi all, I have found the actual solution for this problem. I tried using BeautifulSoup.SoupStrainer() and it improved memory usage to the greatest extent.Now it uses max of 20 MB(earlier it was >800 MB on 1GB RAM system). thanks all. -- Yours, S.Selvam -- http://mail.python.org/m

Re: How to print lambda result ?

2009-01-20 Thread Tino Wildenhain
Hi, Barak, Ron wrote: Hi, Wanting to print the correct plural after numbers, I did the following: for num in range(1,4): string_ = "%d event%s" % (num,lambda num: num > 1 and "s" or "") print string_ However, instead of getting the expected output: 1 event 2 events 3 events I get:

RE: How to print lambda result ?

2009-01-20 Thread Barak, Ron
Thanks Tino: your solutions without the lambda work nicely. What I still don't understand is why the print does not execute the lambda and prints the result, instead of printing the lambda's object description. Bye, Ron. -Original Message- From: Tino Wildenhain [mailto:t...@wildenhain.de

Re: Doubts related to subprocess.Popen()

2009-01-20 Thread Diez B. Roggisch
srinivasan srinivas wrote: > Hi, > Does subprocess.Popen() count a new open file for each suprocess? I mean > does it occupy an entry in file descriptor table of parent process? If so, > wat is each file descriptor connected to? Usually, each new process has three file-descriptors associated with

Re: How to print lambda result ?

2009-01-20 Thread Tino Wildenhain
Barak, Ron wrote: Thanks Tino: your solutions without the lambda work nicely. What I still don't understand is why the print does not execute the lambda and prints the result, instead of printing the lambda's object description. Bye, Ron. Well its up to the implemention what a class is suppose

RE: How to print lambda result ?

2009-01-20 Thread Barak, Ron
Ah, okay. Now it's clear. Thanks Tino. Ron. -Original Message- From: Tino Wildenhain [mailto:t...@wildenhain.de] Sent: Tuesday, January 20, 2009 14:45 To: Barak, Ron Cc: python-list@python.org Subject: Re: How to print lambda result ? Barak, Ron wrote: > Thanks Tino: your solutions withou

Re: ifconfig in python

2009-01-20 Thread Mark Wooding
Дамјан Георгиевски writes: > Something *like* this could work: > > myip = urllib2.urlopen('http://whatismyip.org/').read() This is going to cause all manner of problems. Firstly, many users are stuck behind NAT routers. In this case, the external service will report the address of the r

Re: ifconfig in python

2009-01-20 Thread rasikasriniva...@gmail.com
On Jan 20, 7:33 am, Mark Wooding wrote: > Дамјан Георгиевски writes: > > Something *like*  this could work: > > >    myip = urllib2.urlopen('http://whatismyip.org/').read() > > This is going to cause all manner of problems. > > Firstly, many users are stuck behind NAT routers.  In this case, the

Re: How to print lambda result ?

2009-01-20 Thread alex23
On Jan 20, 10:34 pm, "Barak, Ron" wrote: > What I still don't understand is why the print does not > execute the lambda and prints the result, instead of > printing the lambda's object description. The following two statements are identical: >>> def f(x): return x ... >>> f = lambda x: x lambda

Re: How to print lambda result ?

2009-01-20 Thread Tim Northover
alex23 writes: > On Jan 20, 10:34 pm, "Barak, Ron" wrote: for num in range(1, 4): > ... string_ = "%d event%s" % (num, (lambda num: num > 1 and "s" or > "")(num)) > ... print string_ The notation here suggests Ron is sligtly confused about what he created. It was equivalent to st

Re: Doubts related to subprocess.Popen()

2009-01-20 Thread Mark Wooding
srinivasan srinivas writes: > Does subprocess.Popen() count a new open file for each suprocess? I > mean does it occupy an entry in file descriptor table of parent > process? If so, wat is each file descriptor connected to? On Unix, subprocess.Popen will use up a file descriptor in the parent f

Why I'm getting the date of yesterday

2009-01-20 Thread Hussein B
Hey, I'm trying to get the get the date before today, I tried this: d = datetime.now() - timedelta(days = -1) But I got the date of tomorrow. when I tried: d = datetime.now() + timedelta(days = -1) I got the date of yesterday. Would you please explain to me why I got the date of yesterday when I ad

Re: Why I'm getting the date of yesterday

2009-01-20 Thread Simon Brunning
2009/1/20 Hussein B : > Hey, > I'm trying to get the get the date before today, I tried this: > d = datetime.now() - timedelta(days = -1) > But I got the date of tomorrow. That's because you are taking away a negative value. This is like doing: >>> 0 - (-1) 1 -- Cheers, Simon B. -- http://mail.

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Luis Zarrabeitia
On Tuesday 20 January 2009 02:00:43 am Russ P. wrote: > On Jan 19, 10:33 pm, Luis Zarrabeitia wrote: > > (Why do you keep calling it 'encapsulation'?). > > I keep calling it encapsulation because that is a widely accepted, > albeit not universal, definition of encapsulation. [...] > Encapsulat

Re: How to start a transaction?

2009-01-20 Thread M.-A. Lemburg
On 2009-01-20 12:23, Hussein B wrote: > Hey, > I know the basics of interacting with databases in Python. > How to start a transaction in case I want to group a couple of insert > and update statements into a single operation? If you use a Python DB-API compatible database module, then transaction

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Luis Zarrabeitia
On Tuesday 20 January 2009 05:00:34 am Paul Rubin wrote: > Luis Zarrabeitia writes: > > No wonder you can't get Bruno's point. For the second, static checks > > to prevent accidents, you have pylint. For the first, not only you > > are using the wrong tool, but you are barking at python for not >

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Bruno Desthuilliers
Paul Rubin a écrit : Bruno Desthuilliers writes: Take some not-that-trivial projects like Zope/Plone. There are quite a few lines of code involved, and quite a lot of programmers worked on it. Zope is about 375 KLOC[1], I was thinking about Zope2 + Plone, but anyway... which I agree is no

Re: Embedding Python. But not so easy.

2009-01-20 Thread Diez B. Roggisch
> 1) Threads: the simulation is going to be run in a very parallel > environment with several CPUs and > http://docs.python.org/c-api/init.html#thread-state-and- > the-global-interpreter-lock there is a global lock mentioned. Does that > mean that the python code can not benefit from this ? Not if

A SSH error during put operation

2009-01-20 Thread Oltmans
Hey all, I've been using Paramiko for sometime now and I never had any problems. I've already submitted this question to Paramiko mailling list but I thought I should post it in CLP as someone might have used it in past. I'm using Paramiko for SSH. Are there any other good SSH libraries that you'v

Re: Doubts related to subprocess.Popen()

2009-01-20 Thread srinivasan srinivas
Do parent process will have different file descriptor in it for each subprocesses or paprent uses a single file descriptor for all? I really want to know creation of each subprocess will occupy an entry in parents'file descriptor table. B'cos if i create more than 200 subprocesses, i am getting

How to get first/last day of the previous month?

2009-01-20 Thread Hussein B
Hey, I'm creating a report that is supposed to harvest the data for the previous month. So I need a way to get the first day and the last day of the previous month. Would you please tell me how to do this? Thanks in advance. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to print lambda result ?

2009-01-20 Thread D'Arcy J.M. Cain
On Tue, 20 Jan 2009 12:34:04 + "Barak, Ron" wrote: > Thanks Tino: your solutions without the lambda work nicely. > What I still don't understand is why the print does not execute the lambda > and prints the result, instead of printing the lambda's object description. Because that's what you

Re: Doubts related to subprocess.Popen()

2009-01-20 Thread Philip Semanchuk
On Jan 20, 2009, at 9:19 AM, srinivasan srinivas wrote: Do parent process will have different file descriptor in it for each subprocesses or paprent uses a single file descriptor for all? I really want to know creation of each subprocess will occupy an entry in parents'file descriptor table.

SetUp functions for multiple test cases

2009-01-20 Thread Georg Schmid
I've just started working with unittests and already hit a snag. I couldn't find out how to implement a setup function, that is executed only _once_ before all of the tests. Specifically, I need this for testing my database interface, and naturally I don't want to create a new database in-memory an

Re: How to print lambda result ?

2009-01-20 Thread D'Arcy J.M. Cain
On Tue, 20 Jan 2009 09:26:14 -0500 "D'Arcy J.M. Cain" wrote: > "%s" % lambda num: int(num) Of course I meant... "%s" % (lambda num: int(num)) -- D'Arcy J.M. Cain | Democracy is three wolves http://www.druid.net/darcy/| and a sheep voting on +1 416 425 1212 (DoD

Re: How to get first/last day of the previous month?

2009-01-20 Thread Mike Driscoll
On Jan 20, 8:19 am, Hussein B wrote: > Hey, > I'm creating a report that is supposed to harvest the data for the > previous month. > So I need a way to get the first day and the last day of the previous > month. > Would you please tell me how to do this? > Thanks in advance. I recommend the dateu

Re: How to get first/last day of the previous month?

2009-01-20 Thread Diez B. Roggisch
Hussein B wrote: > Hey, > I'm creating a report that is supposed to harvest the data for the > previous month. > So I need a way to get the first day and the last day of the previous > month. > Would you please tell me how to do this? First day: create a new date-object with the day==1. Last day

Re: SetUp functions for multiple test cases

2009-01-20 Thread Diez B. Roggisch
Georg Schmid wrote: > I've just started working with unittests and already hit a snag. I > couldn't find out how to implement a setup function, that is executed > only _once_ before all of the tests. Specifically, I need this for > testing my database interface, and naturally I don't want to creat

Re: SetUp functions for multiple test cases

2009-01-20 Thread Roy Smith
In article <45b0bf56-673c-40cd-a27a-62f9943d9...@r41g2000prr.googlegroups.com>, Georg Schmid wrote: > I've just started working with unittests and already hit a snag. I > couldn't find out how to implement a setup function, that is executed > only _once_ before all of the tests. Specifically, I

Re: Logging help

2009-01-20 Thread Gabriel Genellina
En Tue, 20 Jan 2009 08:11:52 -0200, koranthala escribió: On Jan 20, 5:45 am, Chris Rebert wrote: On Mon, Jan 19, 2009 at 11:36 AM, koranthala wrote: >   Is it possible somehow to have the logging module rotate the files > every time I start it. >   Basically, I can automatically rotate u

Re: Logging help

2009-01-20 Thread Gabriel Genellina
En Tue, 20 Jan 2009 08:11:52 -0200, koranthala escribió: On Jan 20, 5:45 am, Chris Rebert wrote: On Mon, Jan 19, 2009 at 11:36 AM, koranthala wrote: >   Is it possible somehow to have the logging module rotate the files > every time I start it. >   Basically, I can automatically rotate u

Re: How to get first/last day of the previous month?

2009-01-20 Thread Carsten Haese
Hussein B wrote: > Hey, > I'm creating a report that is supposed to harvest the data for the > previous month. > So I need a way to get the first day and the last day of the previous > month. In order to not deprive you of the sense of accomplishment from figuring things out for yourself, I'll giv

Re: How to get first/last day of the previous month?

2009-01-20 Thread Marco Mariani
Hussein B wrote: I'm creating a report that is supposed to harvest the data for the previous month. So I need a way to get the first day and the last day of the previous month. Would you please tell me how to do this? Thanks in advance. dateutil can do this and much, much more. >>> from date

Re: How to print lambda result ?

2009-01-20 Thread alex23
On Jan 20, 10:57 pm, Tim Northover wrote: > Notice that there's no actual mention of num there, it's a function that > takes one parameter. If that parameter happens to be num it does what > you want, but there's no way for the interpreter to know what was > intended. Which is why my working exam

Re: How to get first/last day of the previous month?

2009-01-20 Thread Marco Mariani
Carsten Haese wrote: In order to not deprive you of the sense of accomplishment Sorry for spoiling that. If you still want the sense of accomplishment, try to reimplement dateutil (and rrule). It's not as easy as it seems :-o -- http://mail.python.org/mailman/listinfo/python-list

smtplib.SMTP throw : 'Socket error: 10053 software caused connection abort'

2009-01-20 Thread aberry
I am using 'smtplib' module to send an email but getting exception... smtplib.SMTP( throw error : here is trace back snippet :- " smtp = smtplib.SMTP(self.server) File "D:\Python24\lib\smtplib.py", line 244, in __init__ (code, msg) = self.connect(host, port) File "D:\Python24\lib\smtplib

Re: How to get first/last day of the previous month?

2009-01-20 Thread Carsten Haese
Marco Mariani wrote: > dateutil can do this and much, much more. Using dateutil for this is like using a sledgehammer to kill a fly. The task at hand can (and IMHO should) be solved with the standard datetime module. -- Carsten Haese http://informixdb.sourceforge.net -- http://mail.python.org/mai

Re: How to get first/last day of the previous month?

2009-01-20 Thread Tim Chase
I'm creating a report that is supposed to harvest the data for the previous month. So I need a way to get the first day and the last day of the previous month. Would you please tell me how to do this? >>> from datetime import date, datetime, timedelta >>> def prev_bounds(when=None): ... if n

Re: How to get first/last day of the previous month?

2009-01-20 Thread Marco Mariani
Carsten Haese wrote: dateutil can do this and much, much more. Using dateutil for this is like using a sledgehammer to kill a fly. The task at hand can (and IMHO should) be solved with the standard datetime module. Sure, but many python programmers are not even aware of the existence of tha

Re: Two questions about style and some simple math

2009-01-20 Thread J Kenneth King
Spoofy writes: > .. .. > > 2. > > For maintaining the character attributes I creates a seperate class. I > wonder weather this is an "overuse" of OO (instead of just making the > attributes plain variables of the Char class) and if the way I wrote > this is OK (somehow this looks cool to me but

Re: SetUp functions for multiple test cases

2009-01-20 Thread Georg Schmid
On Jan 20, 3:57 pm, Roy Smith wrote: > In article > <45b0bf56-673c-40cd-a27a-62f9943d9...@r41g2000prr.googlegroups.com>, >  Georg Schmid wrote: > > > I've just started working with unittests and already hit a snag. I > > couldn't find out how to implement a setup function, that is executed > > on

RE: ifconfig in python

2009-01-20 Thread bruce
hi... in general, i've found that using "route" to find the iface for the default gets me the interface in use... i then parse either ifconfig/iwconfig, to get the address of the nic for that interface.. it's worked ok so far on most machines i've dealt with... thoughts/comments are of course wel

Re: Problem with IDLE on windows XP

2009-01-20 Thread Gabriel Genellina
En Mon, 19 Jan 2009 20:50:43 -0200, Grimes, George escribió: I am trying to learn Python and I installed version 2.6 both at home and at work. At home, on Vista, everything works fine. At work, on XP, IDLE would not run. I uninstalled/reinstalled and got the same thing. My cursor chang

Re: How to get first/last day of the previous month?

2009-01-20 Thread Hussein B
On Jan 20, 5:04 pm, Carsten Haese wrote: > Hussein B wrote: > > Hey, > > I'm creating a report that is supposed to harvest the data for the > > previous month. > > So I need a way to get the first day and the last day of the previous > > month. > > In order to not deprive you of the sense of accom

Re: How to get first/last day of the previous month?

2009-01-20 Thread Tim Chase
You told me to think how to get the first day of the previous month, well how to know if the previous month is 28, 29, 30 or 31 days? Find the first day of the *current* month, and then subtract one day (use the timedelta object). You'll end up with the last day of the previous month as a dat

Re: SetUp functions for multiple test cases

2009-01-20 Thread Duncan Booth
Roy Smith wrote: > You might have your setUp() method re-assign the global to an instance > variable and then your test cases can access it via self.whatever. > The reason for that is if at some point in the future you change your > mind and decide to re-build the database in setUp() for each te

file write collision consideration

2009-01-20 Thread RGK
I have a thread that is off reading things some of which will get written into a file while another UI thread manages input from a user. The reader-thread and the UI-thread will both want to write stuff to the same output file. What first comes to mind is that there may be write collisions, ie

Re: Doubts related to subprocess.Popen()

2009-01-20 Thread Jeff McNeil
On Jan 20, 9:19 am, srinivasan srinivas wrote: > Do parent process will have different file descriptor in it for each > subprocesses or paprent uses a single file descriptor for all? > I really want to know creation of each subprocess will occupy an entry in > parents'file descriptor table. B'co

Re: file write collision consideration

2009-01-20 Thread D'Arcy J.M. Cain
On Tue, 20 Jan 2009 10:57:52 -0500 RGK wrote: > I have a thread that is off reading things some of which will get > written into a file while another UI thread manages input from a user. > > The reader-thread and the UI-thread will both want to write stuff to the > same output file. What first

Re: file write collision consideration

2009-01-20 Thread MRAB
RGK wrote: I have a thread that is off reading things some of which will get written into a file while another UI thread manages input from a user. The reader-thread and the UI-thread will both want to write stuff to the same output file. What first comes to mind is that there may be write co

Re: Possible bug in Tkinter - Python 2.6

2009-01-20 Thread José Matos
On Monday 19 January 2009 09:24:09 Eric Brunel wrote: > This is not the procedure I describe in the original post. The first time, >   it works for me too. It's only after I used the file dialog that it stops > working. You are right, my mistake. -- José Abílio -- http://mail.python.org/mailman/

Re: Pyro deadlock

2009-01-20 Thread J Kenneth King
MatthewS writes: > I'd like to know if the following behavior is expected and can be > avoided: I have a Pyro server object that maintains a queue of work, > and multiple Pyro worker objects that take work off the queue by > calling a method on the server (get_work) and then return the work to >

Re: Doubts related to subprocess.Popen()

2009-01-20 Thread Mark Wooding
"Diez B. Roggisch" writes: > Usually, each new process has three file-descriptors associated with > it - stdin,stdout and stderr. > > So when you span a process, the overall count of FDs should increase > by three. Yes, but that's irrelevant. There are two file limits which are relevant: * t

Re: ifconfig in python

2009-01-20 Thread Nehemiah Dacres
I'll let this thought fester but I thought I'd put together a PEP to make this a function. Possibly in some util library but preferibly in the sys library sense this is where to get information about the system you are running on. On Tue, Jan 20, 2009 at 6:33 AM, Mark Wooding wrote: > Дамјан Гео

Re: ifconfig in python

2009-01-20 Thread Mark Wooding
"rasikasriniva...@gmail.com" writes: > one way to get your head around this is - IP Addresses are associated > with the interface and not the computer. distinction may be subtle but > critical. Actually this is wrong for most Unix systems, which use the `weak end-system model' described in RFC11

Re: ifconfig in python

2009-01-20 Thread Nehemiah Dacres
> > That doesn't mean that you can get away with a single address for the > entire host, though: you need addresses which correspond to the networks > you're attached to. > > -- [mdw] especially sense we are also getting into virtual NICs where you can have a webserver listening to one and broadca

Free-test russian xxx site

2009-01-20 Thread metro5
Free-test russian xxx site http://xxx.gamapa.ru http://xxx.gamapa.ru -- View this message in context: http://www.nabble.com/Free-test-russian-xxx-site-tp21568375p21568375.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/pyt

Overloading Methods

2009-01-20 Thread K-Dawg
Can you overload methods in Python? Can I have multiple __inits__ with different parameters passed in? Thanks. Kevin -- http://mail.python.org/mailman/listinfo/python-list

Free-test russian xxx site

2009-01-20 Thread metro5
Free-test russian xxx site http://xxx.gamapa.ru http://xxx.gamapa.ru -- View this message in context: http://www.nabble.com/Free-test-russian-xxx-site-tp21568438p21568438.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/pyt

Free-test russian xxx site

2009-01-20 Thread metro5
Free-test russian xxx site http://xxx.gamapa.ru http://xxx.gamapa.ru -- View this message in context: http://www.nabble.com/Free-test-russian-xxx-site-tp21568445p21568445.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/pyt

RE: ifconfig in python

2009-01-20 Thread bruce
so the question really starts to look like: -what's the default listening address for my app (insert nic)? -what's the default sending address for my app (insert nic)? -what's the default listening address for my server? -what's the default sending address for my server? -what's the default l

Re: English-like Python

2009-01-20 Thread Aaron Brady
On Jan 17, 6:10 pm, The Music Guy wrote: > Wow, impressive responses. > > It sounds like the general consensus is that English would not be a good > choice for programming even if there were an interpreter capable of > turning human language into machine language. But that makes sense; even > Engl

RE: Problem with IDLE on windows XP

2009-01-20 Thread Grimes, George
¡Muchas gracias! That was the hint that I needed, Gabriel. I had a problem with my path definition and running idle the way you indicated gave me an error message saying that it could not find a valid init.tcl on the path. I have fixed the problem and can now run idle at work. Thanks again! Geo

Free-test russian xxx site

2009-01-20 Thread metro5
Free-test russian xxx site http://xxx.gamapa.ru http://xxx.gamapa.ru -- View this message in context: http://www.nabble.com/Free-test-russian-xxx-site-tp21568578p21568578.html Sent from the Python - python-list mailing list archive at Nabble.com. -- http://mail.python.org/mailman/listinfo/pyt

Re: Overloading Methods

2009-01-20 Thread MRAB
K-Dawg wrote: Can you overload methods in Python? Can I have multiple __inits__ with different parameters passed in? Simple answer: no. -- http://mail.python.org/mailman/listinfo/python-list

Re: s=str(binary)

2009-01-20 Thread gert
On Jan 20, 5:23 am, John Machin wrote: > On Jan 20, 12:54 pm, gert wrote: > > > How do you convert s back to binary data in python 3 so I can put in a > > sqlite blob ? > > Is there a build in function or do I need to use binascii ? > > byte(s) or bin(s) would make more sense but can not figure i

Re: Overloading Methods

2009-01-20 Thread Chris Rebert
On Tue, Jan 20, 2009 at 10:18 AM, MRAB wrote: > K-Dawg wrote: >> >> Can you overload methods in Python? >> >> Can I have multiple __inits__ with different parameters passed in? >> > Simple answer: no. More complicated answer: Yes, with some caveats. You usually don't need to overload methods in

Re: file write collision consideration

2009-01-20 Thread RGK
Thanks for the suggestions - sounds like a couple good options, I apprecieate it. Ross. MRAB wrote: RGK wrote: I have a thread that is off reading things some of which will get written into a file while another UI thread manages input from a user. The reader-thread and the UI-thread will bo

Re: file write collision consideration

2009-01-20 Thread Francesco Bochicchio
On Tue, 20 Jan 2009 11:08:46 -0500, D'Arcy J.M. Cain wrote: > On Tue, 20 Jan 2009 10:57:52 -0500 > RGK wrote: >> I have a thread that is off reading things some of which will get >> written into a file while another UI thread manages input from a user. >> >> The reader-thread and the UI-thread

Re: English-like Python

2009-01-20 Thread Joe Strout
Aaron Brady wrote: I think it would be a good step if you could make some sensible interpretation of a typical statement without its parentheses. f "abc" 123 --> f( "abc", 123 ) It would be just the thing in a couple of situations... Such a language is possible -- take a look at REALbasic so

Re: SetUp functions for multiple test cases

2009-01-20 Thread brooklineTom
On Jan 20, 9:57 am, Roy Smith wrote: > In article > <45b0bf56-673c-40cd-a27a-62f9943d9...@r41g2000prr.googlegroups.com>, > Georg Schmid wrote: > > > I've just started working with unittests and already hit a snag. I > > couldn't find out how to implement a setup function, that is executed > > on

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Russ P.
On Jan 20, 5:33 am, Luis Zarrabeitia wrote: > On Tuesday 20 January 2009 05:00:34 am Paul Rubin wrote: > > > Luis Zarrabeitia writes: > > > No wonder you can't get Bruno's point. For the second, static checks > > > to prevent accidents, you have pylint. For the first, not only you > > > are using

Re: English-like Python

2009-01-20 Thread Abah Joseph
Python is English-like enough that everybody including non-programmers can understand it.e.g # Import the operating system module import os # define new function def open_dir_tree(path): for File in os.listdir(path): file_or_dir = os.path.join(path, File) # Read the line below

Re: How to get first/last day of the previous month?

2009-01-20 Thread John Machin
On Jan 21, 2:07 am, Marco Mariani wrote: > Carsten Haese wrote: > > In order to not deprive you of the sense of accomplishment > > Sorry for spoiling that. If you still want the sense of accomplishment, > try to reimplement dateutil (and rrule). It's not as easy as it seems :-o True, but getting

Re: python resource management

2009-01-20 Thread S.Selvam Siva
On Tue, Jan 20, 2009 at 7:27 PM, Tim Arnold wrote: > I had the same problem you did, but then I changed the code to create a new > soup object for each file.That drastically increased the speed. I don't > know why, but it looks like the soup object just keeps getting bigger with > each feed. > >

Re: English-like Python

2009-01-20 Thread Aaron Brady
On Jan 20, 12:58 pm, Joe Strout wrote: > Aaron Brady wrote: > > I think it would be a good step if you could make some sensible > > interpretation of a typical statement without its parentheses. > > > f "abc" 123 > > --> > > f( "abc", 123 ) > > > It would be just the thing in a couple of situation

Re: ifconfig in python

2009-01-20 Thread Mark Wooding
"bruce" writes: [a top-posted monstrosity] > so the question really starts to look like: > > -what's the default listening address for my app (insert nic)? > -what's the default sending address for my app (insert nic)? > -what's the default listening address for my server? > -what's the defa

Re: English-like Python

2009-01-20 Thread Joe Strout
Aaron Brady wrote: Unambiguity and readability are two different things. (This should be a quasi-tangent, neither agreed, nor opposed, nor unrelated to what you said.) If you have f "abc" 123 it's unambiguous, but, if you have g f "abc" 123 "def" there's no sure way to determine where the

Re: what's the point of rpython?

2009-01-20 Thread Brendan Miller
On Tue, Jan 20, 2009 at 3:46 AM, Paul Rubin <"http://phr.cx"@nospam.invalid> wrote: > s...@pobox.com writes: >> Carl, I'm quite unfamiliar with Boost and am not a C++ person, so may have >> read what you saw but not recognized it in the C++ punctuation soup. I >> couldn't find what you referred to

Re: Does Python really follow its philosophy of "Readability counts"?

2009-01-20 Thread Rhamphoryncus
On Jan 20, 12:04 pm, "Russ P." wrote: Hey, if pylint can reliably detect private data access violations, > that's good news to me. I haven't used it, so I don't know. (I used > pychecker a while back, but I haven't used that for a while either.) > > If pylint can check access violations, then it

Re: Overloading Methods

2009-01-20 Thread K-Dawg
Thank you for the explanation. With my background in Java, I have to get myself to think a little differently. Kevin On Tue, Jan 20, 2009 at 1:41 PM, Chris Rebert wrote: > On Tue, Jan 20, 2009 at 10:18 AM, MRAB wrote: > > K-Dawg wrote: > >> > >> Can you overload methods in Python? > >> > >> C

Re: what's the point of rpython?

2009-01-20 Thread Ross Ridge
Carl Banks wrote: >I just looked at the boost documentation, which claims that multiple >asynchronous writes to the same shared_ptr results in undefined >behavior. That will not suffice for Python reference counting. If you read the Boost documentation you'll see that while multiple simulaneous

Re: Overloading Methods

2009-01-20 Thread Chris Rebert
(top-posting just for consistency) In that case, you might also be interested in: http://dirtsimple.org/2004/12/python-is-not-java.html Cheers, Chris On Tue, Jan 20, 2009 at 12:19 PM, K-Dawg wrote: > Thank you for the explanation. With my background in Java, I have to get > myself to think a l

Re: what's the point of rpython?

2009-01-20 Thread Rhamphoryncus
On Jan 16, 5:37 pm, "Brendan Miller" wrote: > So I kind of wanted to ask this question on the pypy mailing list.. > but there's only a pypy-dev list, and I don't want to put noise on the > dev list. > > What's the point of RPython? By this, I don't mean "What is RPython"? > I get that. I mean, why

Re: s=str(binary)

2009-01-20 Thread John Machin
On Jan 21, 5:31 am, gert wrote: > On Jan 20, 5:23 am, John Machin wrote: > > > On Jan 20, 12:54 pm, gert wrote: > > > > How do you convert s back to binary data in python 3 so I can put in a > > > sqlite blob ? > > > Is there a build in function or do I need to use binascii ? > > > byte(s) or bi

Re: python processes and Visual Studio

2009-01-20 Thread bill
On Jan 19, 9:24 am, bill wrote: > All, > > This may sound somewhat convoluted, but here goes: > > 1. I have a Python script that invokes builds in Visual Studio via the > command line interface - 'devenv' > 2. It works GREAT > 3. I have added a post_build event to a VS Solution that has but one >

Re: what's the point of rpython?

2009-01-20 Thread Rhamphoryncus
On Jan 19, 9:00 pm, "Brendan Miller" wrote: > Maybe I'm missing something here but a lock free algorithm for > reference counting seems pretty trivial. As long as you can atomically > increment and decrement an integer without locking you are pretty much > done. "lock free" is largely meaningless

  1   2   >