Re: Few questions on SOAP

2010-02-19 Thread joy99
On Feb 19, 8:49 am, Steve Holden wrote: > Brendon Wickham wrote: > > On 19 February 2010 08:07, Mark Lawrence wrote: > >> Muhammad Alkarouri wrote: > >>> Your question is borderline if not out of topic in this group. I will > >>> make a few comments though. > >> This might be a Python group, but

Re: How to make an empty generator?

2010-02-19 Thread Arnaud Delobelle
Ben Finney writes: > Arnaud Delobelle writes: > >> What about >> foo = iter('') > > That doesn't return a generator. > > >>> foo = iter('') > >>> foo > > > Whether the OP needs to create a generator, or just any iterable type, > isn't clear. If it walks and quacks like a duck..

Submit HTTP GET data from XP PC to PHP on web server.

2010-02-19 Thread Schedule
Hello everyone I haeve tried to understand the capabilities of python in web development. Have gone throuhg forums and online tutorials. Nevertheless I am not able to find any topic which can give me some insite along with basic examples of how to send http get data from an xp mashine using python

Re: How to make an empty generator?

2010-02-19 Thread Ben Finney
Arnaud Delobelle writes: > Ben Finney writes: > > Whether the OP needs to create a generator, or just any iterable > > type, isn't clear. > > If it walks and quacks like a duck... Anyway it's not just an iterable > object, it's an iterator. I can't really imagine that there would be > some code

Re: Why this doesn't work?

2010-02-19 Thread Bruno Desthuilliers
mk a écrit : (snip) Sorry, no time to get into details now - but I can at least provide a couple hints. The first point is that, to override a method on an _instance_, you have to provide a method object, not a plain function - remember that the descriptor protocol is only invoked on _cla

Re: How to use AWS/PAA nowadays? PyAWS / pyamazon outdated?

2010-02-19 Thread Snaky Love
wow, for some strange reason I did not find this with my first search yesterday: http://pypi.python.org/pypi/python-amazon-product-api/0.2.2 I will try this. sometime I wish all the old stuff would disappear from the internet. if somebody is looking for a cool startup idea: what about some websi

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-19 Thread Anh Hai Trinh
On Feb 19, 1:44 pm, Steve Howell wrote: > > > def coroutine(co): > >    def _inner(*args, **kwargs): > >        gen = co(*args, **kwargs) > >        gen.next() > >        return gen > >    return _inner > > > def squares_and_cubes(lst, target): > >    for n in lst: > >        target.send((n * n, n

Re: Constraints on __sub__, __eq__, etc.

2010-02-19 Thread Roald de Vries
On Feb 18, 2010, at 5:28 PM, Stephen Hansen wrote: On Thu, Feb 18, 2010 at 8:19 AM, Andrey Fedorov wrote: It seems intuitive to me that the magic methods for overriding the +, -, <, ==, >, etc. operators should have no sideffects on their operands. Also, that == should be commutative and tra

Re: Constraints on __sub__, __eq__, etc.

2010-02-19 Thread Chris Rebert
On Fri, Feb 19, 2010 at 2:30 AM, Roald de Vries wrote: > On Feb 18, 2010, at 5:28 PM, Stephen Hansen wrote: >> On Thu, Feb 18, 2010 at 8:19 AM, Andrey Fedorov >> wrote: >>> >>> It seems intuitive to me that the magic methods for overriding the +, -, >>> <, ==, >, etc. operators should have no side

The Disappearing Program?

2010-02-19 Thread W. eWatson
I've successfully compiled several small python programs on Win XP into executables using py2exe. A program goes from a name like snowball.py to snowball. A dir in the command prompt window finds snowball.py but not snowball. If I type in snowball, it executes. What's up with that? -- http://ma

Re: Constraints on __sub__, __eq__, etc.

2010-02-19 Thread Peter Otten
Roald de Vries wrote: > On Feb 18, 2010, at 5:28 PM, Stephen Hansen wrote: >> On Thu, Feb 18, 2010 at 8:19 AM, Andrey Fedorov >> wrote: >>> It seems intuitive to me that the magic methods for overriding the >>> +, -, <, ==, >, etc. operators should have no sideffects on their >>> operands. Also, t

how to do filetransfer using usrp.

2010-02-19 Thread sarosh
how to do filetransfer using usrp. can i make lan interface between two computers connected to usrp each and then transfer files (images/video) between them? how to transfer files? is there any example of such kind in gnuradio? sarosh -- View this message in context: http://old.nabble.com/how-t

Re: with statement and standard library

2010-02-19 Thread alex23
nobrowser wrote: > Yet there are many, many classes in the > library whose use would be more elegant and readable if the with > statement could be employed.  Start with the connection objects in > httplib and you can probably come up with 10 others easily.  Maybe it > is the case that some of thes

Re: The Disappearing Program?

2010-02-19 Thread Andre Engels
On Fri, Feb 19, 2010 at 12:20 PM, W. eWatson wrote: > I've successfully compiled several small python programs on Win XP into > executables using py2exe. A program goes from a name like snowball.py to > snowball. A dir in the command prompt window finds snowball.py but not > snowball. If I type in

Re: The Disappearing Program?

2010-02-19 Thread Mark Lawrence
Andre Engels wrote: On Fri, Feb 19, 2010 at 12:20 PM, W. eWatson wrote: I've successfully compiled several small python programs on Win XP into executables using py2exe. A program goes from a name like snowball.py to snowball. A dir in the command prompt window finds snowball.py but not snowbal

Re: The Disappearing Program?

2010-02-19 Thread Andre Engels
On Fri, Feb 19, 2010 at 3:19 PM, Mark Lawrence wrote: > Andre Engels wrote: >> >> On Fri, Feb 19, 2010 at 12:20 PM, W. eWatson >> wrote: >>> >>> I've successfully compiled several small python programs on Win XP into >>> executables using py2exe. A program goes from a name like snowball.py to >>>

Re: Why this doesn't work?

2010-02-19 Thread mk
Steven D'Aprano wrote: On Thu, 18 Feb 2010 18:28:44 +0100, mk wrote: nostat.__orig_get__ = nostat.__get__ I should point out that leading-and-trailing-double-underscore names are reserved for use by the language. Right... I completely missed that. I will try to change the habit. I am

Re: Submit HTTP GET data from XP PC to PHP on web server.

2010-02-19 Thread Joe Riopel
On Fri, Feb 19, 2010 at 3:54 AM, Schedule wrote: > Hello everyone > > I haeve tried to understand the capabilities of python in web development. > Have gone throuhg forums and online tutorials. Nevertheless I am not able to > find any topic which can give me some insite along with basic examples o

Re: Why this doesn't work?

2010-02-19 Thread mk
John Posner wrote: a False I expected to see 'nostatget' output: nostat.__get__ = nostatget obviously failed to replace this function's __get__ method. I don't quite understand the above sentence, so I'm assuming that you wanted the final "is" test to be "True" instead of "False". No. I sho

Re: how to do filetransfer using usrp.

2010-02-19 Thread Justin Ezequiel
On Feb 19, 7:38 pm, sarosh wrote: > how to do filetransfer using usrp. > can i make lan interface between two computers connected to usrp each and > then transfer files (images/video) between them? > how to transfer files? > is there any example of such kind in gnuradio? > > sarosh am not sure wh

What happened to pyjamas?

2010-02-19 Thread John Pinner
It appears that, in trying to cut down spm, somone chahnged a DNS entry and screwed it up : it shouldbe back before long. John -- -- http://mail.python.org/mailman/listinfo/python-list

Re: Why this doesn't work?

2010-02-19 Thread Bruno Desthuilliers
mk a écrit : Steven D'Aprano wrote: On Thu, 18 Feb 2010 18:28:44 +0100, mk wrote: nostat.__orig_get__ = nostat.__get__ I should point out that leading-and-trailing-double-underscore names are reserved for use by the language. Right... I completely missed that. I will try to change th

Attributes in privates methods

2010-02-19 Thread Yasser Almeida Hernández
Hi all. I have a class with the attribute 'log_file', opened out of the class: class ProteinCluster: def __init__(self,cluster_name,log_file): ... self.log_file = log_file ... Then i have a private method which write in the log_file: def _read_structure(self, pdb_code):

Re: The Disappearing Program?

2010-02-19 Thread Mark Lawrence
Andre Engels wrote: On Fri, Feb 19, 2010 at 3:19 PM, Mark Lawrence wrote: Andre Engels wrote: On Fri, Feb 19, 2010 at 12:20 PM, W. eWatson wrote: I've successfully compiled several small python programs on Win XP into executables using py2exe. A program goes from a name like snowball.py to s

Re: Why this doesn't work?

2010-02-19 Thread Bruno Desthuilliers
mk a écrit : John Posner wrote: a False I expected to see 'nostatget' output: nostat.__get__ = nostatget obviously failed to replace this function's __get__ method. I don't quite understand the above sentence, so I'm assuming that you wanted the final "is" test to be "True" instead of "False

Re: Attributes in privates methods

2010-02-19 Thread Diez B. Roggisch
Am 19.02.10 16:08, schrieb Yasser Almeida Hernández: Hi all. I have a class with the attribute 'log_file', opened out of the class: class ProteinCluster: def __init__(self,cluster_name,log_file): ... self.log_file = log_file ... Then i have a private method which write in the log_file: def _read

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-19 Thread Roald de Vries
This pipeline idea has actually been implemented further, see . from stream import map, filter, cut range(10) >> map(lambda x: [x**2, x**3]) >> filter(lambda t: t[0]! =25 and t[1]!=64) >> cut[1] >> list [0, 1, 8, 27, 216, 343, 512, 729] Wow, cool! Just to show that you can easily add the itera

Re: How to make an empty generator?

2010-02-19 Thread Robert Kern
On 2010-02-19 00:21 AM, Steven D'Aprano wrote: On Fri, 19 Feb 2010 00:15:20 -0600, Robert Kern wrote: What's the point of the wheel spinning? Did I miss something? I wonder whether it's for some kind of framework with a main loop like for it in list_of_iterables: for x in it:

Executing Python code on another computer

2010-02-19 Thread SiWi
Hello community, I googled for an answer of the following problem, but I couldn't find anything. I've got a netbook and my fast workstation compter, which I usually use for developing. But I'd also like to take my netbook around the house and to develop Python programms on it. The problem is that n

Re: How to make an empty generator?

2010-02-19 Thread Robert Kern
On 2010-02-19 01:01 AM, Ben Finney wrote: Robert Kern writes: On 2010-02-18 18:33 PM, Ben Finney wrote: Robert Kern writes: He doesn't want *any* empty generator. He wants an iterator that executes some given side-effect-producing code then immediately raises the StopIteration. Ah, hm.

Re: with statement and standard library

2010-02-19 Thread Robert Kern
On 2010-02-19 01:18 AM, nobrowser wrote: Hi. The with statement is certainly nifty. The trouble is, the *only* two documented examples how it can be used with the library classes are file objects (which I use all the time) and thread locks which I almost never use. Yet there are many, many cla

Re: Executing Python code on another computer

2010-02-19 Thread D'Arcy J.M. Cain
On Fri, 19 Feb 2010 07:52:59 -0800 (PST) SiWi wrote: > So I wondered if it was possible to send the Python code I'm > developing on the netbook to the workstation pc via wlan, let the > script execute on the workstation pc and write the output back on the > netbook. > > Is there any possibilty to

Question about getmtime

2010-02-19 Thread Brandon
Hi everyone, Does copying or moving a file affect the return value of os.path.getmtime(path)? Thank you, Brandon -- http://mail.python.org/mailman/listinfo/python-list

Re: Executing Python code on another computer

2010-02-19 Thread Krister Svanlund
On Fri, Feb 19, 2010 at 4:52 PM, SiWi wrote: > Hello community, > I googled for an answer of the following problem, but I couldn't find > anything. > I've got a netbook and my fast workstation compter, which I usually > use for developing. > But I'd also like to take my netbook around the house an

A tool for find dependencies relationships behind Python projects

2010-02-19 Thread Victor Lin
Hi, I just wrote a tool for drawing dependencies relationships diagram of Python project on Pypi. Here is the home page of the tool: http://code.google.com/p/python-gluttony/ Some examples: Sprox: http://static.ez2learn.com/gluttony/sprox_dot.png TurboGears2: http://static.ez2learn.com/glutton

Re: Question about getmtime

2010-02-19 Thread Krister Svanlund
On Fri, Feb 19, 2010 at 5:05 PM, Brandon wrote: > Hi everyone, > > Does copying or moving a file affect the return value of > os.path.getmtime(path)? > > Thank you, > Brandon Wouldn't it be easier to make a script and see for yourself then to write a mail about it? -- http://mail.python.org/mail

a question on building MySQL-python

2010-02-19 Thread George Trojan
During installation of MySQL-python-1.2.3c1 I encountered the following error: $ python2.6 setup.py build running build running build_py copying MySQLdb/release.py -> build/lib.linux-x86_64-2.6/MySQLdb running build_ext building '_mysql' extension creating build/temp.linux-x86_64-2.6 gcc -pthrea

Re: Attributes in privates methods

2010-02-19 Thread Bruno Desthuilliers
Yasser Almeida Hernández a écrit : Hi all. I have a class with the attribute 'log_file', opened out of the class: class ProteinCluster: def __init__(self,cluster_name,log_file): ... self.log_file = log_file ... Then i have a private method which write in the log_file: def

Re: Executing Python code on another computer

2010-02-19 Thread Arnaud Delobelle
On 19 Feb, 15:52, SiWi wrote: > Hello community, > I googled for an answer of the following problem, but I couldn't find > anything. > I've got a netbook and my fast workstation compter, which I usually > use for developing. > But I'd also like to take my netbook around the house and to develop >

Re: Executing Python code on another computer

2010-02-19 Thread James Harris
On 19 Feb, 15:52, SiWi wrote: > Hello community, > I googled for an answer of the following problem, but I couldn't find > anything. > I've got a netbook and my fast workstation compter, which I usually > use for developing. > But I'd also like to take my netbook around the house and to develop >

Re: Question about getmtime

2010-02-19 Thread Brandon
On Feb 19, 10:26 am, Krister Svanlund wrote: > On Fri, Feb 19, 2010 at 5:05 PM, Brandon wrote: > > Hi everyone, > > > Does copying or moving a file affect the return value of > > os.path.getmtime(path)? > > > Thank you, > > Brandon > > Wouldn't it be easier to make a script and see for yourself t

Re: Executing Python code on another computer

2010-02-19 Thread SiWi
On Feb 19, 5:10 pm, "D'Arcy J.M. Cain" wrote: > On Fri, 19 Feb 2010 07:52:59 -0800 (PST) > > SiWi wrote: > > So I wondered if it was possible to send the Python code I'm > > developing on the netbook to the workstation pc via wlan, let the > > script execute on the workstation pc and write the ou

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-19 Thread Steve Howell
On Feb 19, 7:50 am, Roald de Vries wrote: > > This pipeline idea has actually been implemented further, see > blog.onideas.ws/stream.py>. > > > from stream import map, filter, cut > > range(10) >> map(lambda x: [x**2, x**3]) >> filter(lambda t: t[0]! > > =25 and t[1]!=64) >> cut[1] >> list > > [0

Re: Executing Python code on another computer

2010-02-19 Thread D'Arcy J.M. Cain
On Fri, 19 Feb 2010 08:32:48 -0800 (PST) SiWi wrote: > I'm normally using IDLE and sometimes PyScripter on Windows Vista. The > netbook is Windows XP. Should I switch to Vim or Emacs? Umm... Yes? It's still not a Python question and is in fact a religious one. Other people have different religi

Re: How to make an empty generator?

2010-02-19 Thread Steven D'Aprano
On Fri, 19 Feb 2010 09:51:54 -0600, Robert Kern wrote: > On 2010-02-19 00:21 AM, Steven D'Aprano wrote: >> On Fri, 19 Feb 2010 00:15:20 -0600, Robert Kern wrote: >> > What's the point of the wheel spinning? Did I miss something? I wonder whether it's for some kind of framework with a

Re: The Disappearing Program?

2010-02-19 Thread W. eWatson
On 2/19/2010 7:16 AM, Mark Lawrence wrote: Andre Engels wrote: On Fri, Feb 19, 2010 at 3:19 PM, Mark Lawrence wrote: Andre Engels wrote: On Fri, Feb 19, 2010 at 12:20 PM, W. eWatson ... tories, or even the whole hard drive, for snowball.*. Then the OP would know exactly what he has or hasn

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-19 Thread Steven D'Aprano
On Fri, 19 Feb 2010 08:32:53 -0800, Steve Howell wrote: > The extra expressiveness of Ruby comes from the fact that you can add > statements within the block, which I find useful sometimes just for > debugging purposes: > > debug = true > data = strange_dataset_from_third_party_code() >

Re: with statement and standard library

2010-02-19 Thread Terry Reedy
On 2/19/2010 2:18 AM, nobrowser wrote: Hi. The with statement is certainly nifty. The trouble is, the *only* two documented examples how it can be used with the library classes are file objects (which I use all the time) and thread locks which I almost never use. Yet there are many, many class

Re: How to make an empty generator?

2010-02-19 Thread Stephen Hansen
On Fri, Feb 19, 2010 at 9:21 AM, Steven D'Aprano < st...@remove-this-cybersource.com.au> wrote: > On Fri, 19 Feb 2010 09:51:54 -0600, Robert Kern wrote: > >> But he doesn't say anything about side-effects. > > > > "I have some generators *that do stuff*, then start yielding results." > > [emphasis

Re: best way to create a dict from string

2010-02-19 Thread MRAB
Tim Arnold wrote: Hi, I've got some text to parse that looks like this text = ''' blah blah blah \Template[Name=RAD,LMRB=False,LMRG=True]{tables} ho dee ho ''' If you're going to include backslashes in the string literal then use a raw string for safety. I want to extract the bit between the

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-19 Thread Steve Howell
On Feb 19, 9:30 am, Steven D'Aprano wrote: > On Fri, 19 Feb 2010 08:32:53 -0800, Steve Howell wrote: > > The extra expressiveness of Ruby comes from the fact that you can add > > statements within the block, which I find useful sometimes just for > > debugging purposes: > > >     debug = true > >

Re: Question about getmtime

2010-02-19 Thread MRAB
Brandon wrote: Hi everyone, Does copying or moving a file affect the return value of os.path.getmtime(path)? The modification time of a copied file should be the same as the original. The creation time of a copied file will be the time at which it was copied, so that can result in the paradox

speed question, reading csv using takewhile() and dropwhile()

2010-02-19 Thread Vincent Davis
I have some some (~50) text files that have about 250,000 rows each. I am reading them in using the following which gets me what I want. But it is not fast. Is there something I am missing that should help. This is mostly an question to help me learn more about python. It takes about 4 min right no

Re: What happened to pyjamas?

2010-02-19 Thread Daniele Gondoni
On 18 Feb, 19:58, "sstein...@gmail.com" wrote: > Down from here (NH, US). > > S > > On Feb 18, 2010, at 1:44 PM, Chris Colbert wrote: > > > > Unreacheable from Italy as well... -- http://mail.python.org/mailman/listinfo/python-list

Re: What happened to pyjamas?

2010-02-19 Thread Luis M . González
On Feb 18, 5:21 pm, Daniele Gondoni wrote: > On 18 Feb, 19:58, "sstein...@gmail.com" wrote: > > > Down from here (NH, US). > > > S > > > On Feb 18, 2010, at 1:44 PM, Chris Colbert wrote: > > Unreacheable from Italy as well... Same here (Buenos Aires, Argentina). -- http://mail.python.org/mailma

Re: unit testing a routine that sends mail

2010-02-19 Thread Bruno Desthuilliers
commander_coder a écrit : Hello, I have a routine that sends an email (this is how a Django view notifies me that an event has happened). I want to unit test that routine. http://docs.djangoproject.com/en/dev/topics/email/#e-mail-backends Or if you're stuck with 1.x < 1.2a, you could just

Re: Replacement for e.message() in python 2.6

2010-02-19 Thread Chris Prinos
On Feb 17, 4:58 am, Nandakumar Chandrasekhar wrote: > Dear Folks, > > In previous versions of Python I used to use e.message() to print out > the error message of an exception like so: > > try: >         result = x / y > except ZeroDivisionError, e: >         print e.message() > > Unfortunately in

Re: What happened to pyjamas?

2010-02-19 Thread Daniele Gondoni
On Feb 18, 9:53 pm, Irmen de Jong wrote: > On 2/18/10 9:45 PM, Luis M. González wrote: > > > On Feb 18, 5:21 pm, Daniele Gondoni  wrote: > >> On 18 Feb, 19:58, "sstein...@gmail.com"  wrote: > > >>> Down from here (NH, US). > > >>> S > > >>> On Feb 18, 2010, at 1:44 PM, Chris Colbert wrote: > > >>

Re: What happened to pyjamas?

2010-02-19 Thread Irmen de Jong
On 2/18/10 9:45 PM, Luis M. González wrote: On Feb 18, 5:21 pm, Daniele Gondoni wrote: On 18 Feb, 19:58, "sstein...@gmail.com" wrote: Down from here (NH, US). S On Feb 18, 2010, at 1:44 PM, Chris Colbert wrote: Unreacheable from Italy as well... Same here (Buenos Aires, Argentina).

Trouble running pywin32-214.win-amd64-py3.1 on 64-bit Windows 7

2010-02-19 Thread Steven Cohen
Hello, I downloaded pywin32-214.win-amd64-py3.1, and it installs just fine (except that it prints a traceback when it tells me the postinstall script completed), but then when I try to execute Pythonwin.exe, I get the following error popup: The application can not locate win32ui.pyd (or Python) (

Re: Executing Python code on another computer

2010-02-19 Thread Jean-Michel Pichavant
SiWi wrote: On Feb 19, 5:10 pm, "D'Arcy J.M. Cain" wrote: On Fri, 19 Feb 2010 07:52:59 -0800 (PST) SiWi wrote: So I wondered if it was possible to send the Python code I'm developing on the netbook to the workstation pc via wlan, let the script execute on the workstation pc and write

Re: The Disappearing Program?

2010-02-19 Thread CM
On Feb 19, 12:21 pm, "W. eWatson" wrote: > On 2/19/2010 7:16 AM, Mark Lawrence wrote:> Andre Engels wrote: > >> On Fri, Feb 19, 2010 at 3:19 PM, Mark Lawrence > >> wrote: > >>> Andre Engels wrote: > On Fri, Feb 19, 2010 at 12:20 PM, W. eWatson > > ... > tories, or even the whole hard drive,

Re: Question about getmtime

2010-02-19 Thread Dave Angel
Brandon wrote: On Feb 19, 10:26 am, Krister Svanlund wrote: On Fri, Feb 19, 2010 at 5:05 PM, Brandon wrote: Hi everyone, Does copying or moving a file affect the return value of os.path.getmtime(path)? Thank you, Brandon Wouldn't it be easier to make a script a

Re: Executing Python code on another computer

2010-02-19 Thread Dave Angel
SiWi wrote: On Feb 19, 5:10 pm, "D'Arcy J.M. Cain" wrote: On Fri, 19 Feb 2010 07:52:59 -0800 (PST) SiWi wrote: So I wondered if it was possible to send the Python code I'm developing on the netbook to the workstation pc via wlan, let the script execute on the workstation pc and write

Re: Upgrading Py2exe App

2010-02-19 Thread T
On Feb 18, 7:19 pm, Ryan Kelly wrote: > On Thu, 2010-02-18 at 07:46 -0800, T wrote: > > I have a Python app which I converted to an EXE (all files separate; > > single EXE didn't work properly) via py2exe - I plan on distributing > > this and would like the ability to remotely upgrade the program

Re: How to make an empty generator?

2010-02-19 Thread Terry Reedy
On 2/19/2010 12:44 PM, Stephen Hansen wrote: Much to my embarrassment, sometime last night I realized I was being a complete idiot, and the 'correct' way to handle this in my scenario is really just: def initialize(): # do one time processing here return [] A generator is just a cal

Chaining 501 generators breaks everything?

2010-02-19 Thread Andrey Fedorov
I implemented a Sieve of Eratosthenesprimes algorithm using generators: http://gist.github.com/309109 This code which chains together 500 generators works fine (~1/20th of a second) on my laptop. The code which chaines 501 generators (s/498/499

Re: Chaining 501 generators breaks everything?

2010-02-19 Thread Andrey Fedorov
Ack, just ran it from shell, realized my editor was just choking on a "maximum recursion depth exceeded" RuntimeError. Didn't realize generators used the call stack... - Andrey On Fri, Feb 19, 2010 at 2:47 PM, Andrey Fedorov wrote: > I implemented a Sieve of > Eratosthenes

Re: speed question, reading csv using takewhile() and dropwhile()

2010-02-19 Thread MRAB
Vincent Davis wrote: I have some some (~50) text files that have about 250,000 rows each. I am reading them in using the following which gets me what I want. But it is not fast. Is there something I am missing that should help. This is mostly an question to help me learn more about python. It t

Re: How to make an empty generator?

2010-02-19 Thread John Posner
On 2/19/2010 2:25 PM, Terry Reedy wrote: On 2/19/2010 12:44 PM, Stephen Hansen wrote: Much to my embarrassment, sometime last night I realized I was being a complete idiot, and the 'correct' way to handle this in my scenario is really just: def initialize(): # do one time processing here retu

Re: speed question, reading csv using takewhile() and dropwhile()

2010-02-19 Thread John Posner
On 2/19/2010 3:02 PM, MRAB wrote: Is this any better? def read_data_file(filename): reader = csv.reader(open(filename, "U"),delimiter='\t') data = [] for row in reader: if '[MASKS]' in row: break data.append(row) As noted in another thread recently, you

Re: speed question, reading csv using takewhile() and dropwhile()

2010-02-19 Thread Jonathan Gardner
On Fri, Feb 19, 2010 at 10:22 AM, Vincent Davis wrote: > I have some some (~50) text files that have about 250,000 rows each. I am > reading them in using the following which gets me what I want. But it is not > fast. Is there something I am missing that should help. This is mostly an > question t

Re: Upgrading Py2exe App

2010-02-19 Thread Ryan Kelly
On Thu, 2010-02-18 at 20:32 -0800, CM wrote: > On Feb 18, 7:19 pm, Ryan Kelly wrote: > > On Thu, 2010-02-18 at 07:46 -0800, T wrote: > > > I have a Python app which I converted to an EXE (all files separate; > > > single EXE didn't work properly) via py2exe - I plan on distributing > > > this and

Re: Upgrading Py2exe App

2010-02-19 Thread Ryan Kelly
On Fri, 2010-02-19 at 11:08 -0800, T wrote: > On Feb 18, 7:19 pm, Ryan Kelly wrote: > > On Thu, 2010-02-18 at 07:46 -0800, T wrote: > > > I have a Python app which I converted to an EXE (all files separate; > > > single EXE didn't work properly) via py2exe - I plan on distributing > > > this and w

Re: The Disappearing Program?

2010-02-19 Thread W. eWatson
On 2/19/2010 10:56 AM, CM wrote: On Feb 19, 12:21 pm, "W. eWatson" wrote: On 2/19/2010 7:16 AM, Mark Lawrence wrote:> Andre Engels wrote: On Fri, Feb 19, 2010 at 3:19 PM, Mark Lawrence wrote: Andre Engels wrote: On Fri, Feb 19, 2010 at 12:20 PM, W. eWatson ... tories, or even the whole

Re: Chaining 501 generators breaks everything?

2010-02-19 Thread Jonathan Gardner
On Fri, Feb 19, 2010 at 11:47 AM, Andrey Fedorov wrote: > I implemented a Sieve of Eratosthenes primes algorithm using generators: > > http://gist.github.com/309109 > > This code which chains together 500 generators works fine (~1/20th of a > second) on my laptop. > You may want a more traditiona

Can't Access ANY url from python (errno 61)

2010-02-19 Thread MattB
Hey all, I've been working on a program that accesses my school's password protected website and downloads directory names. I'm using mechanize. Recently, the program has been unable to open the website, returning the 'errno 61 connection refused' error. I presume the school's server was blocking

Re: The Disappearing Program?

2010-02-19 Thread Stephen Hansen
On Fri, Feb 19, 2010 at 1:42 PM, W. eWatson wrote: > >> Well, you are right. What proof do I have? In fact, I just tried to run a > program that was not converted, and left off py. It worked. > > So maybe the only way to execute the compiled code is to to to dist? Yes. You're meant to move eve

Re: speed question, reading csv using takewhile() and dropwhile()

2010-02-19 Thread Vincent Davis
In reference to the several comments about "[x for x in read] is basically a copy of the entire list. This isn't necessary." or list(read). I had thought I had a problem with having iterators in the takewhile() statement. I thought I testes and it didn't work. It seems I was wrong. It clearly works

Re: Can't Access ANY url from python (errno 61)

2010-02-19 Thread Jonathan Gardner
On Fri, Feb 19, 2010 at 1:48 PM, MattB wrote: > > I've been working on a program that accesses my school's password > protected website and downloads directory names. I'm using mechanize. > > Recently, the program has been unable to open the website, returning > the 'errno 61 connection refused' e

Re: Interesting talk on Python vs. Ruby and how he would like Python to have just a bit more syntactic flexibility.

2010-02-19 Thread Lie Ryan
On 02/19/10 14:57, Steve Howell wrote: > In a more real world example, the intermediate results would be > something like this: > >departments >departments_in_new_york >departments_in_new_york_not_on_bonus_cycle >employees_in_departments_in_new_york_not_on_bonus_cycle >names_of

Re: Can't Access ANY url from python (errno 61)

2010-02-19 Thread Chris Rebert
On Fri, Feb 19, 2010 at 1:48 PM, MattB wrote: > Hey all, > > I've been working on a program that accesses my school's password > protected website and downloads directory names. I'm using mechanize. > > Recently, the program has been unable to open the website, returning > the 'errno 61 connection

Re: Question about getmtime

2010-02-19 Thread Sean DiZazzo
On Feb 19, 10:06 am, MRAB wrote: > Brandon wrote: > > Hi everyone, > > > Does copying or moving a file affect the return value of > > os.path.getmtime(path)? > > The modification time of a copied file should be the same as the > original. > > The creation time of a copied file will be the time at

ActiveState/O'Reilly Launch New and Improved Code Share Site (Python)

2010-02-19 Thread Bret
ActiveState launched today the new code.activestate.com with code recipes for dynamic languages such as Python, Perl and Tcl and web development. This site is great recipe sharing site for all Python, Perl and Tcl developers. O'Reilly will be use recipes from the site for its next Python cook book

Re: Can't Access ANY url from python (errno 61)

2010-02-19 Thread Martin P. Hellwig
On 02/19/10 21:48, MattB wrote: Hey all, I've been working on a program that accesses my school's password protected website and downloads directory names. I'm using mechanize. Recently, the program has been unable to open the website, returning the 'errno 61 connection refused' error. I presum

Re: Question about getmtime

2010-02-19 Thread MRAB
Sean DiZazzo wrote: On Feb 19, 10:06 am, MRAB wrote: Brandon wrote: Hi everyone, Does copying or moving a file affect the return value of os.path.getmtime(path)? The modification time of a copied file should be the same as the original. The creation time of a copied file will be the time at

Re: speed question, reading csv using takewhile() and dropwhile()

2010-02-19 Thread Jonathan Gardner
On Fri, Feb 19, 2010 at 1:58 PM, Vincent Davis wrote: > In reference to the several comments about "[x for x in read] is basically > a copy of the entire list. This isn't necessary." or list(read). I had > thought I had a problem with having iterators in the takewhile() statement. > I thought I te

Re: How to use python to register a service (an existing .exe file)

2010-02-19 Thread Aahz
In article <4b79e28c$0$4610$426a7...@news.free.fr>, News123 wrote: >Is there a python way to register new windows services. > >I am aware of the >instsrv.exe program, which can be used to install services. >I could use subprocess.Popen to call > >instsrv.exe "service_name" program.exe > >but won

Re: Can't Access ANY url from python (errno 61)

2010-02-19 Thread MattB
On Feb 19, 6:02 pm, "Martin P. Hellwig" wrote: > On 02/19/10 21:48, MattB wrote: > > > Hey all, > > > I've been working on a program that accesses my school's password > > protected website and downloads directory names. I'm using mechanize. > > > Recently, the program has been unable to open the

Re: Can't Access ANY url from python (errno 61)

2010-02-19 Thread MattB
On Feb 19, 7:20 pm, MattB wrote: > On Feb 19, 6:02 pm, "Martin P. Hellwig" > wrote: > > > > > On 02/19/10 21:48, MattB wrote: > > > > Hey all, > > > > I've been working on a program that accesses my school's password > > > protected website and downloads directory names. I'm using mechanize. > >

Looking for crossfold validation code

2010-02-19 Thread Mark Livingstone
Hello, I am doing research as part of a Uni research Scholarship into using data compression for classification. What I am looking for is python code to handle the crossfold validation side of things for me - that will take my testing / training corpus and create the testing / training files after

Re: Can't Access ANY url from python (errno 61)

2010-02-19 Thread Chris Rebert
On Fri, Feb 19, 2010 at 5:06 PM, MattB wrote: > On Feb 19, 7:20 pm, MattB wrote: >> On Feb 19, 6:02 pm, "Martin P. Hellwig" >> wrote: >> > On 02/19/10 21:48, MattB wrote: >> > > Hey all, >> >> > > I've been working on a program that accesses my school's password >> > > protected website and down

the mystery of dirname()

2010-02-19 Thread Shashwat Anand
In the following code sample : def dirname(p): """Returns the directory component of a pathname""" i = p.rfind('/') + 1 head = p[:i] if head and head != '/'*len(head): head = head.rstrip('/') return head def dirname1(p): i = p.rfind('/') + 1 head = p[:i]

Re: Can't Access ANY url from python (errno 61)

2010-02-19 Thread MattB
On Feb 19, 8:28 pm, Chris Rebert wrote: > On Fri, Feb 19, 2010 at 5:06 PM, MattB wrote: > > On Feb 19, 7:20 pm, MattB wrote: > >> On Feb 19, 6:02 pm, "Martin P. Hellwig" > >> wrote: > >> > On 02/19/10 21:48, MattB wrote: > >> > > Hey all, > > >> > > I've been working on a program that accesses

Capturing errors raised by other scripts ?

2010-02-19 Thread northof40
I'm using the subroutine module to run run python script A.py from B.py (this is on windows fwiw). A.py is not my script and it may raise arbitary errors before exiting. How can I determine what's happened before A.py exited ? To simulate this I've got this script (which is meant to simulate A.py

Re: Can't Access ANY url from python (errno 61)

2010-02-19 Thread Shashwat Anand
try this : >>> url = 'http://www.google.com' >>> proxy = {'http': 'http://username:passw...@proxy:port'} >>> content = urllib.urlopen(url, proxies = proxy).read() Hopefully it should run without error. Second approach can be to check whether your environment variables are setup. $set will show y

Re: the mystery of dirname()

2010-02-19 Thread MRAB
Shashwat Anand wrote: In the following code sample : def dirname(p): """Returns the directory component of a pathname""" i = p.rfind('/') + 1 head = p[:i] if head and head != '/'*len(head): head = head.rstrip('/') return head def dirname1(p): i = p.rfind('/')

Re: the mystery of dirname()

2010-02-19 Thread Shashwat Anand
But this is posixpath, right ? So '//x' like path will not occur as far as I guess ? On Sat, Feb 20, 2010 at 8:35 AM, MRAB wrote: > Shashwat Anand wrote: > >> In the following code sample : >> >> def dirname(p): >> >>"""Returns the directory component of a pathname""" >>i = p.rfind('/')

Re: Capturing errors raised by other scripts ?

2010-02-19 Thread MRAB
northof40 wrote: I'm using the subroutine module to run run python script A.py from B.py (this is on windows fwiw). A.py is not my script and it may raise arbitary errors before exiting. How can I determine what's happened before A.py exited ? To simulate this I've got this script (which is mea

Re: the mystery of dirname()

2010-02-19 Thread MRAB
Shashwat Anand wrote: But this is posixpath, right ? So '//x' like path will not occur as far as I guess ? Can you guarantee that? It's safer to just leave it as it is, just in case! :-) On Sat, Feb 20, 2010 at 8:35 AM, MRAB > wrote: Shashwat Anand wro

  1   2   >