Re: Trying to chain processes together on a pipeline

2011-06-27 Thread Chris Rebert
On Mon, Jun 27, 2011 at 11:47 PM, Andrew Berg wrote: > On 2011.06.28 01:32 AM, Peter Otten wrote: >> >>> subprocess.call(["ls"], stdout=open(os.devnull, "w")) >> 0 > D'oh! Not sure why I was thinking os.devnull was a file object. :-[ On the bright side, I think in part due to this /exact/ misunde

Re: Trying to chain processes together on a pipeline

2011-06-27 Thread Andrew Berg
On 2011.06.28 01:32 AM, Peter Otten wrote: > >>> subprocess.call(["ls"], stdout=open(os.devnull, "w")) > 0 D'oh! Not sure why I was thinking os.devnull was a file object. :-[ > Start with factoring out common code into a good old function. For some reason I was thinking I would have problems doing

Re: Trying to chain processes together on a pipeline

2011-06-27 Thread Peter Otten
Andrew Berg wrote: > I'm working on an audio/video converter script (moving from bash to > Python for some extra functionality), and part of it is chaining the > audio decoder (FFmpeg) either into SoX to change the volume and then to > the Nero AAC encoder or directly into the Nero encoder. This i

How to read barcoded value from PDF

2011-06-27 Thread Asif Jamadar
Hi, I have a PDF document which consist of barcode characters. Now how can I retrieve that bar-coded value programmatically. When I googled I found a tool called Pypdf which provides a function called 'PdfFileReader' To read the PDF file, but how can I read the barcode form the existing PDF.

How to read barcoded value from PDF

2011-06-27 Thread Asif Jamadar
Hi, I have a PDF document which consist of barcode characters. Now how can I retrieve that bar-coded value programmatically. When I googled I found a tool called Pypdf which provides a function called 'PdfFileReader' To read the PDF file, but how can I read the barcode form the existing PDF.

Trying to chain processes together on a pipeline

2011-06-27 Thread Andrew Berg
I'm working on an audio/video converter script (moving from bash to Python for some extra functionality), and part of it is chaining the audio decoder (FFmpeg) either into SoX to change the volume and then to the Nero AAC encoder or directly into the Nero encoder. This is the chunk of code from my

Re: Significant figures calculation

2011-06-27 Thread Erik Max Francis
Steven D'Aprano wrote: On Tue, 28 Jun 2011 06:53 am Ethan Furman wrote: Harold wrote: [...] Empirical('1200.').significance 2 Well, that's completely wrong. It should be 4. Empirical('1200.0').significance 5 What about when 1200 is actually 4 significant digits? Or 3? Then you should

Re: Significant figures calculation

2011-06-27 Thread Erik Max Francis
Chris Angelico wrote: On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano wrote: Zero sig figure: 0 That's not really zero significant figures; without further qualification, it's one. Is 0.0 one sig fig or two? Two. (Just vaguely curious. Also curious as to whether a zero sig figures v

Re: Significant figures calculation

2011-06-27 Thread Chris Angelico
On Tue, Jun 28, 2011 at 12:56 PM, Steven D'Aprano wrote: > Zero sig figure: 0 > Is 0.0 one sig fig or two? (Just vaguely curious. Also curious as to whether a zero sig figures value is ever useful.) ChrisA -- http://mail.python.org/mailman/listinfo/python-list

Re: Significant figures calculation

2011-06-27 Thread Steven D'Aprano
On Tue, 28 Jun 2011 06:53 am Ethan Furman wrote: > Harold wrote: [...] > Empirical('1200.').significance >> 2 Well, that's completely wrong. It should be 4. > Empirical('1200.0').significance >> 5 > > What about when 1200 is actually 4 significant digits? Or 3? Then you shouldn't write

Re: Significant figures calculation

2011-06-27 Thread Ethan Furman
Harold Fellermann wrote: Hi Ethan, Empirical('1200.').significance 2 Empirical('1200.0').significance 5 What about when 1200 is actually 4 significant digits? Or 3? Then you'd simply write 1.200e3 and 1.20e3, respectively. That's just how the rules are defined. But your code is not foll

Re: Python basic program problem

2011-06-27 Thread Noah Hall
On Mon, Jun 27, 2011 at 11:18 PM, Amaninder Singh wrote: > Yes, I think I am using 3.0 version. So how much difference is in between > these two? > On Jun 26, 2011, at 11:18 PM, Noah Hall wrote: >> On Mon, Jun 27, 2011 at 8:05 AM, Amaninder Singh >> wrote: >>> Hi, >>> I am fairly new to python,

tkinter problem with treeview

2011-06-27 Thread Wolfgang Meiners
Hi all, I have written some helper functions for the tkinter.ttk.treeview widget (using python3, version 3.2). This functions dont work as i expect: #! /usr/bin/env pyhon3 # -*- encoding: utf-8 -*- from tkinter import * from tkinter.ttk import * # now tkinter widgets get replaced by

Re: Significant figures calculation

2011-06-27 Thread Ethan Furman
Harold wrote: On Jun 25, 9:04 pm, Chris Torek wrote: I'm curious. Is there a way to get the number of significant digits for a particular Decimal instance? Yes: def sigdig(x): "return the number of significant digits in x" return len(x.as_tuple()[1]) Great, Chris, this is (almost)

Re: can I distribute Microsoft.VC90.CRT files?

2011-06-27 Thread Peter Irbizon
> Read the EULA that comes with Microsoft Visual C++ Redistributable Package. thanks. hm, but it looks like every user should download redistributable package and then istall it, right? I would like to prevent this because every action which requires user's interaction is not good (high chance he

Re: module problem on windows 64bit

2011-06-27 Thread Peter Irbizon
>> Are you running 32bit or 64bit Python on your 64bit Windows box? You >> have to install the same flavour of Python, kinterbasdb and Firebird SQL >> (all 32bit or all 64bit). You also have to check the "copy client dlls >> to system directory" check box during the installation of Firebird SQL. >>

Re: module problem on windows 64bit

2011-06-27 Thread Christian Heimes
Am 27.06.2011 19:02, schrieb Peter Irbizon: > Hello, > > on 32-bit windows everything works ok but on 64-bit win I am getting > this error: > Traceback (most recent call last): > File "app.py", line 1040, in do_this_now > File "kinterbasdb\__init__.pyc", line 119, in > File "kinterbasdb\_kinte

Re: those darn exceptions

2011-06-27 Thread John Nagle
On 6/21/2011 2:51 PM, Chris Torek wrote: On Tue, 21 Jun 2011 01:43:39 +, Chris Torek wrote: But how can I know a priori that os.kill() could raise OverflowError in the first place? If you passed an integer that was at some time a valid PID to "os.kill()", and OverflowError was raised, I

Re: Struggling with sorted dict of word lengths and count

2011-06-27 Thread Chris Angelico
On Tue, Jun 28, 2011 at 3:00 AM, Cathy James wrote: > for word in line.lower().split( ):#split lines into words and make lower > case By the way, side point: There's not much point lower-casing the line when all you care about is the lengths of words :) ChrisA -- http://mail.python.org/mailman/

Re: Struggling with sorted dict of word lengths and count

2011-06-27 Thread Chris Angelico
On Tue, Jun 28, 2011 at 3:00 AM, Cathy James wrote: > def fileProcess(filename = open('input_text.txt', 'r')): >     for line in filename: >     for word in line.lower().split( ):#split lines into words and make > lower case >     wordlen = word_length(word)#run function to return leng

Re: can I distribute Microsoft.VC90.CRT files?

2011-06-27 Thread J.O. Aho
miamia wrote: > hello, > > I find out that my program needs > Microsoft.VC90.CRT.manifest,msvcm90.dll,msvcp90.dll,msvcr90.dll files > when I want to run it on win 64bit systems. I find these files in > some other software. > Can I simply take it from another software then include it to my > progr

can I distribute Microsoft.VC90.CRT files?

2011-06-27 Thread miamia
hello, I find out that my program needs Microsoft.VC90.CRT.manifest,msvcm90.dll,msvcp90.dll,msvcr90.dll files when I want to run it on win 64bit systems. I find these files in some other software. Can I simply take it from another software then include it to my program folder and distribute it th

can I distribute Microsoft.VC90.CRT files?

2011-06-27 Thread Peter Irbizon
hello, I find out that my program needs Microsoft.VC90.CRT.manifest,msvcm90.dll,msvcp90.dll,msvcr90.dll files when I want to run it on win 64bit systems. I find these files in some other software. Can I simply take it from another software then include it to my program folder and distribute it th

module problem on windows 64bit

2011-06-27 Thread miamia
Hello, on 32-bit windows everything works ok but on 64-bit win I am getting this error: Traceback (most recent call last): File "app.py", line 1040, in do_this_now File "kinterbasdb\__init__.pyc", line 119, in File "kinterbasdb\_kinterbasdb.pyc", line 12, in File "kinterbasdb\_kinterbasd

module problem on windows 64bit

2011-06-27 Thread Peter Irbizon
Hello, on 32-bit windows everything works ok but on 64-bit win I am getting this error: Traceback (most recent call last): File "app.py", line 1040, in do_this_now File "kinterbasdb\__init__.pyc", line 119, in File "kinterbasdb\_kinterbasdb.pyc", line 12, in File "kinterbasdb\_kinterbasdb.py

Struggling with sorted dict of word lengths and count

2011-06-27 Thread Cathy James
Dear Python Programmers, I am a Python newby and I need help with my code: I have done parts of it but I can't get what I need: I need to manipulate text to come up with word lengths and their frequency:ie how many 1-letter words in a text how many 2-letter words in a text, etc I believe I am on

Read barcode from the PDF document

2011-06-27 Thread Asif Jamadar
I have PDF document which consist of barcode characters. Now how can I read these barcode characters using python code? Or how can I recognize this barcode? -- http://mail.python.org/mailman/listinfo/python-list

Re: Significant figures calculation

2011-06-27 Thread Harold
On Jun 25, 9:04 pm, Chris Torek wrote: > >I'm curious.  Is there a way to get the number of significant digits > >for a particular Decimal instance? > > Yes: > > def sigdig(x): >     "return the number of significant digits in x" >     return len(x.as_tuple()[1]) Great, Chris, this is (almost) ex

Re: windows 7 create directory with read write execute permission for everybody

2011-06-27 Thread Thorsten Kampe
* Gelonida (Mon, 27 Jun 2011 11:32:45 +0200) > One thing, which I would still like to know (though I don't need it > for my current task) is what to do to to setup an ACE on a directory, > such, that all entries below will inherit the directory's access > settings. Such a thing does not exist. Th

Pydev 2.2.0 Released

2011-06-27 Thread Fabio Zadrozny
Hi All, Pydev 2.2.0 has been released Details on Pydev: http://pydev.org Details on its development: http://pydev.blogspot.com Release Highlights: --- **Eclipse 3.7** * Eclipse 3.7 (Indigo) is now supported. **Break on Exceptions** * It's now possible to **br

Re: Significant figures calculation

2011-06-27 Thread Dave Angel
(You top-posted your reply, instead of writing your response following the part you were quoting) On 01/-10/-28163 02:59 PM, Lalitha Prasad K wrote: In numerical analysis there is this concept of machine zero, which is computed like this: e=1.0 while 1.0+e> 1.0: e=e/2.0 print e The numb

Re: windows 7 create directory with read write execute permission for everybody

2011-06-27 Thread Andrew Berg
On 2011.06.26 03:57 PM, Gelonida wrote: > The reason I am asking is, that I'd like to create a directory structure > where multiple users should be allowed to read / write / create files > and directories. This may not require pywin32 - by default there's a public directory at os.environ['public'

Re: windows 7 create directory with read write execute permission for everybody

2011-06-27 Thread Gelonida
On 6/27/2011 7:21 AM, Thorsten Kampe wrote: * Gelonida (Sun, 26 Jun 2011 22:57:57 +0200) What do I have to do under python windows to create a directory with all permissions, such, that new files / directories created below will inherit the permissions. Exactly nothing (except creating the dir

Re: windows 7 create directory with read write execute permission for everybody

2011-06-27 Thread Gelonida
Hi Tim, On 6/27/2011 9:39 AM, Tim Golden wrote: On 26/06/2011 21:57, Gelonida wrote: Hi, What do I have to do under python windows to create a directory with all permissions, such, that new files / directories created below will inherit the permissions. . . . I never used / modified Windows

Re: what's the big deal for print()

2011-06-27 Thread Duncan Booth
steve+comp.lang.pyt...@pearwood.info wrote: > Unfortunately, while that gets rid of the newline, it also leaves spaces > between items: > def example(): > ... print 1, > ... print 2, > ... print 3 > ... example() > 1 2 3 > > Here's the Python 3 version: > def example

Re: windows 7 create directory with read write execute permission for everybody

2011-06-27 Thread Tim Golden
On 26/06/2011 21:57, Gelonida wrote: Hi, What do I have to do under python windows to create a directory with all permissions, such, that new files / directories created below will inherit the permissions. The reason I am asking is, that I'd like to create a directory structure where multiple

Re: Python basic program problem

2011-06-27 Thread Andrew Berg
On 2011.06.27 02:05 AM, Amaninder Singh wrote: > Hi, > I am fairly new to python, I am trying to write simple code and It is > giving me syntax error. I am reading a book and following the > directions as it says in the book but I am not sure why it is not > working. Looks like the book you're read

Re: Python basic program problem

2011-06-27 Thread Daniel Kluev
On Mon, Jun 27, 2011 at 6:05 PM, Amaninder Singh wrote: print "this is a test" > SyntaxError: invalid syntax Most likely, you are running python 3.x, while reading python 2.x book. In python 3.x print is now ordinary function, >>> print('hello world') hello world In future, please include

Re: Python basic program problem

2011-06-27 Thread Noah Hall
On Mon, Jun 27, 2011 at 8:05 AM, Amaninder Singh wrote: > Hi, > I am fairly new to python, I am trying to write simple code and It is > giving me syntax error. I am reading a book and following the > directions as it says in the book but I am not sure why it is not > working. Please guide me throu

Python basic program problem

2011-06-27 Thread Amaninder Singh
Hi, I am fairly new to python, I am trying to write simple code and It is giving me syntax error. I am reading a book and following the directions as it says in the book but I am not sure why it is not working. Please guide me through. Any help appreciated. >>> x = 2 >>> if x == 2: print "This i