Re: Can I embedding a (python) console on python program?

2010-02-19 Thread Lie Ryan
On 02/20/10 16:38, Kee K Y CHEN wrote: > HI All, > > Apologize for being a newbie to python area and sorry for my English. > > Actually what I need is embedding a python interactive console(or other > shell console alike module) on my python program for debugging and > controlling purpose during

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 Carl Banks
On Feb 19, 11:12 pm, Steve Holden wrote: > Ben Finney wrote: > > Lawrence D'Oliveiro writes: > > >> If Python doesn’t distinguish between procedures and functions, why > >> should it distinguish between statements and expressions? > > > I don't see the connection between those two predicates. Why

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 Carl Banks
On Feb 19, 10:30 pm, Lawrence D'Oliveiro wrote: > In message , Rhodri James wrote: > > > In classic Pascal, a procedure was distinct from a function in that it had > > no return value.  The concept doesn't really apply in Python; there are no > > procedures in that sense, since if a function termi

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/20/10 18:17, sjdevn...@yahoo.com wrote: > On Feb 20, 1:30 am, Lawrence D'Oliveiro central.gen.new_zealand> wrote: >> In message , Rhodri James wrote: >> >>> In classic Pascal, a procedure was distinct from a function in that it had >>> no return value. The concept doesn't really apply in Py

Re: Scalable python dict {'key_is_a_string': [count, some_val]}

2010-02-19 Thread Jonathan Gardner
On Fri, Feb 19, 2010 at 10:36 PM, krishna wrote: > I have to manage a couple of dicts with huge dataset (larger than > feasible with the memory on my system), it basically has a key which > is a string (actually a tuple converted to a string) and a two item > list as value, with one element in 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 Lie Ryan
On 02/20/10 17:30, Lawrence D'Oliveiro wrote: > In message , Rhodri James wrote: > >> In classic Pascal, a procedure was distinct from a function in that it had >> no return value. The concept doesn't really apply in Python; there are no >> procedures in that sense, since if a function terminates

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 sjdevn...@yahoo.com
On Feb 20, 1:30 am, Lawrence D'Oliveiro wrote: > In message , Rhodri James wrote: > > > In classic Pascal, a procedure was distinct from a function in that it had > > no return value.  The concept doesn't really apply in Python; there are no > > procedures in that sense, since if a function termin

Re: Executing Python code on another computer

2010-02-19 Thread Stefan Behnel
Dave Angel, 19.02.2010 20:04: > In that case, consider using RemoveDesktop, which is built into both Xp > and Vista. Careful, sounds like malware to me. Stefan -- http://mail.python.org/mailman/listinfo/python-list

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 sjdevn...@yahoo.com
On Feb 20, 1:28 am, Lawrence D'Oliveiro wrote: > In message <87eikjcuzk@benfinney.id.au>, Ben Finney wrote: > > > > > Lawrence D'Oliveiro writes: > > >> In message , cjw wrote: > > >> > Aren't lambda forms better described as function? > > >> Is this a function? > > >>     lambda : None > > >

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 Holden
Ben Finney wrote: > Lawrence D'Oliveiro writes: > >> If Python doesn’t distinguish between procedures and functions, why >> should it distinguish between statements and expressions? > > I don't see the connection between those two predicates. Why does the > former matter when determining the “sh

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

2010-02-19 Thread Lie Ryan
On 02/20/10 13:32, MattB wrote: > > I'm using the network in my own apartment. Not the campus's. > Moreover, my mac's MAC address is different from the MAC address shown > by my router, but as I said I'm also blocked when using my friend's > wireless router at his apartment. > > So it must be my

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 Ben Finney
Lawrence D'Oliveiro writes: > If Python doesn’t distinguish between procedures and functions, why > should it distinguish between statements and expressions? I don't see the connection between those two predicates. Why does the former matter when determining the “should” of the latter? -- \

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 Ben Finney
Lawrence D'Oliveiro writes: > So there is no distinction between functions and procedures, then? In Python, no. -- \ “When we pray to God we must be seeking nothing — nothing.” | `\ —Saint Francis of Assisi | _o__)

Re: Scalable python dict {'key_is_a_string': [count, some_val]}

2010-02-19 Thread Paul Rubin
krishna writes: > entries from two files match by key) and sorting using the 'sort' > command. Thus the bottleneck is the 'sort' command. That is a good approach. The sort command is highly optimized and will beat any Python program that does something comparable. Set LC_ALL=C if the file is a

Scalable python dict {'key_is_a_string': [count, some_val]}

2010-02-19 Thread krishna
I have to manage a couple of dicts with huge dataset (larger than feasible with the memory on my system), it basically has a key which is a string (actually a tuple converted to a string) and a two item list as value, with one element in the list being a count related to the key. I have to at the 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 Lawrence D'Oliveiro
In message , Rhodri James wrote: > In classic Pascal, a procedure was distinct from a function in that it had > no return value. The concept doesn't really apply in Python; there are no > procedures in that sense, since if a function terminates without supplying > an explicit return value it retu

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 Lawrence D'Oliveiro
In message <84166541-c10a-47b5-ae5b- b23202624...@q2g2000pre.googlegroups.com>, Steve Howell wrote: > Some people make the definition of function more restrictive--"if it > has side effects, it is not a function." Does changing the contents of CPU cache count as a side-effect? -- http://mail.pyt

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 Lawrence D'Oliveiro
In message <87eikjcuzk@benfinney.id.au>, Ben Finney wrote: > Lawrence D'Oliveiro writes: > >> In message , cjw wrote: >> >> > Aren't lambda forms better described as function? >> >> Is this a function? >> >> lambda : None >> >> What about this? >> >> lambda : sys.stdout.write("hi the

Re: Can I embedding a (python) console on python program?

2010-02-19 Thread Shashwat Anand
I am not sure what you are looking for, but you can try looking at 'cmd module' ~l0nwlf On Sat, Feb 20, 2010 at 11:08 AM, Kee K Y CHEN wrote: > HI All, > > Apologize for being a newbie to python area and sorry for my English. > > Actually what I need is embedding a python interactive console(or

Can I embedding a (python) console on python program?

2010-02-19 Thread Kee K Y CHEN
HI All, Apologize for being a newbie to python area and sorry for my English. Actually what I need is embedding a python interactive console(or other shell console alike module) on my python program for debugging and controlling purpose during the program runtime. For example, print/set some i

Re: The Disappearing Program?

2010-02-19 Thread alex23
On Feb 20, 3:26 pm, alex23 wrote: > or running 'dist/snowball' That should, of course, be: 'dist\snowball' :) -- http://mail.python.org/mailman/listinfo/python-list

Re: The Disappearing Program?

2010-02-19 Thread alex23
"W. eWatson" wrote: > So maybe the only way to execute the compiled code is to [g]o to dist? Or the compiled code needs to be in a folder that's higher in your path settings than the python file. But yes, moving into the dist directory, or running 'dist/snowball' from the project root will do th

Re: The Disappearing Program?

2010-02-19 Thread CM
On Feb 19, 4:42 pm, "W. eWatson" wrote: > 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: > >

Re: Avoid converting functions to methods in a class

2010-02-19 Thread Ben Finney
Steven D'Aprano writes: > I have a convention when writing unit tests Incidentally, you may be interested in the specific forum for testing in Python http://lists.idyll.org/listinfo/testing-in-python> that is a good resource for asking questions like this. > to put the target of the test into a

Re: Upgrading Py2exe App

2010-02-19 Thread CM
On Feb 19, 4:28 pm, Ryan Kelly wrote: > 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) vi

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

2010-02-19 Thread Mark Hammond
On 20/02/2010 5:35 AM, Steven Cohen wrote: 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 applica

Re: Avoid converting functions to methods in a class

2010-02-19 Thread Chris Colbert
this is somewhat hackish: In [1]: def test(): ...: print 'spam' ...: ...: In [20]: class Ham(): : target = {'target': test} : def test_eggs(self): : self.target['target']() : : In [21]: h = Ham() In [22]: h.test_eggs() spam On Fr

Re: Capturing errors raised by other scripts ?

2010-02-19 Thread northof40
On Feb 20, 4:13 pm, MRAB wrote: > 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 ? >

Avoid converting functions to methods in a class

2010-02-19 Thread Steven D'Aprano
I have a convention when writing unit tests to put the target of the test into a class attribute, as follows: class MyTest(unittest.TestCase): target = mymodule.someclass def test_spam(self): """Test that someclass has a spam attribute.""" self.failUnless(hasattr(self.tar

Re: the mystery of dirname()

2010-02-19 Thread Shashwat Anand
basically I infer that : dirname = path - basename, like for path = '//x', basename = x, hence dirname = '//' On Sat, Feb 20, 2010 at 8:47 AM, MRAB wrote: > Shashwat Anand wrote: > >> But this is posixpath, right ? So '//x' like path will not occur as far as >> I guess ? >> >> Can you guarante

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

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 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: 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: 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

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 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

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 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

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 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. > >

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: 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: 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: 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: 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

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: 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

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: 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 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: 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: 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

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: 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

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: 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: 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: 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: 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: 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 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: 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

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: 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

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: 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: 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: 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: 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

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: 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).

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: 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: 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: 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: 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

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: 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

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: 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: 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: 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: 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: 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: 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: 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: 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 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: 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 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: 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: 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

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: 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 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: 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

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 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

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

  1   2   >