Re: First day beginner to python, add to counter after nested loop

2013-10-29 Thread Dave Angel
On 29/10/2013 16:11, jonas.thornv...@gmail.com wrote: > Den tisdagen den 29:e oktober 2013 kl. 21:08:39 UTC+1 skrev > jonas.t...@gmail.com: >> Den tisdagen den 29:e oktober 2013 kl. 20:24:57 UTC+1 skrev Dave Angel: > > They could had used print and prinln from basic? I do not want new line > ev

Re: How do I update a virtualenv?

2013-10-29 Thread alex23
On 30/10/2013 12:08 AM, Skip Montanaro wrote: Where specifically are these instructions that tell you to put the virtualenv under VCS control? https://devcenter.heroku.com/articles/getting-started-with-python I believe you may have misread the instructions slightly. You should have a project

Re: personal library

2013-10-29 Thread Dave Angel
On 29/10/2013 17:29, patrick vrijlandt wrote: > Hello list, > > Python has been a hobby for me since version 1.5.2. Over the years I > accumulated quite a lot of reusable code. It is nicely organised in > modules, directories and subdirectories. With every project, the library > grows and is devel

RE: Using "with open(filename, 'ab'):" and calling code only if the file is new?

2013-10-29 Thread Dave Angel
On 29/10/2013 21:42, Joseph L. Casale wrote: You forgot the attribution line: "Victor says" >> with open(self.full_path, 'r') as input, open(self.output_csv, 'ab') as >> output: >> fieldnames = (...) >> csv_writer = DictWriter(output, filednames) >> # Call csv_writer.w

Re: trying to strip out non ascii.. or rather convert non ascii

2013-10-29 Thread Chris Angelico
On Wed, Oct 30, 2013 at 2:56 AM, Mark Lawrence wrote: > You've stated above that logically unicode is badly handled by the fsr. You > then provide a trivial timing example. WTF??? His idea of bad handling is "oh how terrible, ASCII and BMP have optimizations". He hates the idea that it could be

RE: Using "with open(filename, 'ab'):" and calling code only if the file is new?

2013-10-29 Thread Joseph L. Casale
> Like Victor says, that opens him up to race conditions. Slim chance, it's no more possible than it happening in the time try/except takes to recover an alternative procedure. with open('in_file') as in_file, open('out_file', 'ab') as outfile_file: if os.path.getsize('out_file'): pri

Re: RELEASED: Python 2.6.9 final

2013-10-29 Thread Miki Tebeka
On Tuesday, October 29, 2013 10:48:58 AM UTC-7, Barry Warsaw wrote: > So too has my latest stint as Python Release Manager. Over the 19 years I > have been involved with Python, Thanks Barry for all the hard work. -- https://mail.python.org/mailman/listinfo/python-list

Re: problem importing

2013-10-29 Thread C. Ng
On Tuesday, October 29, 2013 6:40:37 PM UTC+8, Peter Otten wrote: > C. Ng wrote: > Hi all, > So I cloned a package xyz from github. OS is ubuntu > 12.04. > Then install successfully using "sudo python setup.py install" > Now > when I try to import xyz, I get "ImportError: No module named xyz" > u

Re: Using "with open(filename, 'ab'):" and calling code only if the file is new?

2013-10-29 Thread Victor Hooi
Hi, In theory, it *should* just be our script writing to the output CSV file. However, I wanted it to be robust - e.g. in case somebody spins up two copies of this script running concurrently. I suppose the timing would have to be pretty unlucky to hit a race condition there, right? As in, so

Fwd: Using "with open(filename, 'ab'):" and calling code only if the file is new?

2013-10-29 Thread Zachary Ware
On Tue, Oct 29, 2013 at 8:02 PM, Victor Hooi wrote: > Hi, > > I have a CSV file that I will repeatedly appending to. > > I'm using the following to open the file: > > with open(self.full_path, 'r') as input, open(self.output_csv, 'ab') as > output: > fieldnames = (...) > csv_w

Sharing common code between multiple scripts?

2013-10-29 Thread Victor Hooi
Hi, NB - I'm the original poster here - https://groups.google.com/d/topic/comp.lang.python/WUuRLEXJP4E/discussion - however, that post seems to have diverted, and I suspect my original question was poorly worded. I have several Python scripts that use similar functions. Currently, these funct

Re: personal library

2013-10-29 Thread Chris Angelico
On Wed, Oct 30, 2013 at 1:00 PM, Dave Angel wrote: > First, I haven't seen any mention of a source control system. Get one, > learn it, and use it. That should always hold your master copy. And > the actual repository should be on a system you can access from any of > the others. > > Then, once

Re: Sharing common code between multiple scripts?

2013-10-29 Thread Ben Finney
Victor Hooi writes: > NB - I'm the original poster here - https://groups.google.com/d/topic/[…] That is not the correct URL to a discussion on this forum. The official archives are at https://mail.python.org/pipermail/python-list/>, so that's the correct place to look for a canonical URL to your

Re: personal library

2013-10-29 Thread Ben Finney
Chris Angelico writes: > *Definitely* use source control. +1, but prefer to call it a “version control system” which is (a) more easily searched on the internet, and (b) somewhat more accurate. -- \“This sentence contradicts itself — no actually it doesn't.” | `\

Re: personal library

2013-10-29 Thread Chris Angelico
On Wed, Oct 30, 2013 at 3:33 PM, Ben Finney wrote: > Chris Angelico writes: > >> *Definitely* use source control. > > +1, but prefer to call it a “version control system” which is (a) more > easily searched on the internet, and (b) somewhat more accurate. Right. I've picked up some bad habits, a

RUN ALL TEST

2013-10-29 Thread Chandru Rajendran
Hi all, I am building my script. I want to run all the test scripts. Currently I am running the code "python setup.py test", it is running only the some tests in my directory. I want to run all the tests in my directory. Can you help please. Thanks & Regards, Chandru CAUTION - D

<    1   2