To Change A Pdf Ebook To Kindle

2015-03-24 Thread jeffreyciross
PDF Converter for Mac is a fantastic and easyto-use instrument for converting PDF documents on Macos. Macintosh PDF Converter can pdf to excel converter to Word, Shine, PowerPoint, EPUB, Text format for Mac. With PDF Converter Mac, the PDF documents, select certain websites of the PDF files etc tha

Re: fibonacci series what Iam is missing ?

2015-03-24 Thread CHIN Dihedral
On Tuesday, March 24, 2015 at 6:54:20 AM UTC+8, Terry Reedy wrote: > On 3/23/2015 2:44 PM, Dave Angel wrote: > > > ## Example 2: Using recursion with caching > > cache = [0, 1] > > def fib4(n): > > if len(cache) <= n: > > value = fib4(n-2) + fib4(n-1) > > cache.append(value)

Re: fibonacci series what Iam is missing ?

2015-03-24 Thread Gregory Ewing
Chris Angelico wrote: Commenting is like dieting. You can always start tomorrow. I've been meaning to become a procrastinator, but I think I'll start tomorrow. In the meantime, since we seem to be having a fibbing competition, here's my contribution, that uses neither recursion nor (explicit)

ANN: eGenix pyOpenSSL Distribution 0.13.8

2015-03-24 Thread eGenix Team: M.-A. Lemburg
ANNOUNCING eGenix.com pyOpenSSL Distribution Version 0.13.8 An easy-to-install and easy-to-use distribution of the pyOpenSSL Python interface for OpenSS

module attributes and docstrings

2015-03-24 Thread Mario Figueiredo
Reading PEP 257 and 258 I got the impression that I could document module attributes and these would be available in the __doc__ attribute of the object. So things like the one below are something I got used to do, but that don't work after all, as I learned today: value_factory = lambda _, r

Re: module attributes and docstrings

2015-03-24 Thread Chris Angelico
On Tue, Mar 24, 2015 at 7:55 PM, Mario Figueiredo wrote: > So things like the one below are something I got used to do, but that > don't work after all, as I learned today: > > value_factory = lambda _, row: row[0] > """Row factory. To be used with single-column queries.""" > > There are o

Re: module attributes and docstrings

2015-03-24 Thread Steven D'Aprano
On Tue, 24 Mar 2015 07:55 pm, Mario Figueiredo wrote: > Reading PEP 257 and 258 I got the impression that I could document > module attributes and these would be available in the __doc__ > attribute of the object. PEP 258 is rejected, so you can't take that as definitive. PEP 257 has this defini

Monkey patch an entire file in a python package

2015-03-24 Thread enjoyaol
This question is about python 2.7 on Windows 7 I am trying to use multiprocessing with freeze. It appears there is some bug when using multiprocessing on freezed python code on windows platforms. There is this patch which made its way to python 3.2, and works in 2.7: http://bugs.python.org/file

Re: Monkey patch an entire file in a python package

2015-03-24 Thread Chris Angelico
On Tue, Mar 24, 2015 at 10:50 PM, wrote: > I am trying to use multiprocessing with freeze. It appears there is some bug > when using multiprocessing on freezed python code on windows platforms. There > is this patch which made its way to python 3.2, and works in 2.7: > > http://bugs.python.org/

Re: To Change A Pdf Ebook To Kindle

2015-03-24 Thread alister
On Tue, 24 Mar 2015 00:05:46 -0700, jeffreyciross wrote: > PDF Converter for Mac is a fantastic and easyto-use instrument for > converting PDF documents on Macos. Macintosh PDF Converter can pdf to > excel converter to Word, Shine, PowerPoint, EPUB, Text format for Mac. > With PDF Converter Mac, t

Re: Monkey patch an entire file in a python package

2015-03-24 Thread enjoyaol
Le mardi 24 mars 2015 13:11:33 UTC+1, Chris Angelico a écrit : > On Tue, Mar 24, 2015 at 10:50 PM, wrote: > > I am trying to use multiprocessing with freeze. It appears there is some > > bug when using multiprocessing on freezed python code on windows platforms. > > There is this patch which ma

Re: fibonacci series what Iam is missing ?

2015-03-24 Thread Ganesh Pal
On Tue, Mar 24, 2015 at 5:41 AM, Steven D'Aprano wrote: > Python does not automatically print all return statements. If you want it to > print the intermediate values produced, you will need to add print before > each return: > > > py> def fib(n): > ... if n == 0: > ... result = 0 > .

Re: To Change A Pdf Ebook To Kindle

2015-03-24 Thread Michael Torrie
On 03/24/2015 01:05 AM, jeffreyciross wrote: > probable spam I'm wondering whether this is appropriate use of sourceforge. Hosting a proprietary program on SF's web site for free, doesn't seem honest to me. Should I report this to SF as inappropriate content? -- https://mail.python.org/mailman

Re: fibonacci series what Iam is missing ?

2015-03-24 Thread Ian Kelly
On Tue, Mar 24, 2015 at 12:20 AM, Rustom Mody wrote: > On Tuesday, March 24, 2015 at 10:51:11 AM UTC+5:30, Ian wrote: >> Iteration in log space. On my desktop, this calculates fib(1000) in >> about 9 us, fib(10) in about 5 ms, and fib(1000) in about 7 >> seconds. >> >> def fib(n): >> a

Re: To Change A Pdf Ebook To Kindle

2015-03-24 Thread Mark Lawrence
On 24/03/2015 14:23, Michael Torrie wrote: On 03/24/2015 01:05 AM, jeffreyciross wrote: probable spam I'm wondering whether this is appropriate use of sourceforge. Hosting a proprietary program on SF's web site for free, doesn't seem honest to me. Should I report this to SF as inappropriate

Re: To Change A Pdf Ebook To Kindle

2015-03-24 Thread Michael Torrie
On 03/24/2015 08:27 AM, Mark Lawrence wrote: > On 24/03/2015 14:23, Michael Torrie wrote: >> Should I report this to SF as inappropriate content? > > Yes. Done. And yes I agree with alister, Calibre is an amazing program and it's all 100% python! And a large-scale app at that. GPLv3. Putting a

Re: fibonacci series what Iam is missing ?

2015-03-24 Thread CHIN Dihedral
On Tuesday, March 24, 2015 at 10:24:59 PM UTC+8, Ian wrote: > On Tue, Mar 24, 2015 at 12:20 AM, Rustom Mody wrote: > > On Tuesday, March 24, 2015 at 10:51:11 AM UTC+5:30, Ian wrote: > >> Iteration in log space. On my desktop, this calculates fib(1000) in > >> about 9 us, fib(10) in about 5 ms,

Regex Python Help

2015-03-24 Thread gdotoli
I am creating a tool to search a filesystem for one simple string. I cannot get the syntax correct. Thank you in advance for your help. import sys import re import os path='/' viewfiles=os.listdir(path) for allfiles in viewfiles: file= os.path.join(path, allfiles) text=open(file, "r") for line

Re: Regex Python Help

2015-03-24 Thread Skip Montanaro
On Tue, Mar 24, 2015 at 1:13 PM, wrote: > SyntaxError: Missing parentheses in call to 'print' It appears you are attempting to use a Python 2.x print statement with Python 3.x Try changing the last line to print(line.rstrip()) Skip -- https://mail.python.org/mailman/listinfo/python-list

Re: Regex Python Help

2015-03-24 Thread Gary Herron
On 03/24/2015 11:13 AM, gdot...@gmail.com wrote: I am creating a tool to search a filesystem for one simple string. I cannot get the syntax correct. Thank you in advance for your help. import sys import re import os path='/' viewfiles=os.listdir(path) for allfiles in viewfiles: file= os.pat

subprocess and stdin.write(), stdout.read()

2015-03-24 Thread Tobiah
The docs for the subprocess.Popen() say: Use communicate() rather than .stdin.write, .stdout.read or .stderr.read to avoid deadlocks due to any of the other OS pipe buffers filling up and blocking the child process But if I want to send a string to stdin, how can I do tha

Re: Regex Python Help

2015-03-24 Thread Gregg Dotoli
Thank you Gary, that got rid of the error, but now there is no tree walk, it runs and immediatley finishes. I just need to grep each file. I have this working with the windows "for /r %a and redirecting that to Python, but want to use Python only. I do have dummy files with the regex string. Th

Re: Regex Python Help

2015-03-24 Thread Gregg Dotoli
Thank you! But The print error is gone, but now the script quickly finishes and doesnt walk the OS tree or search. Gregg On Tuesday, March 24, 2015 at 2:14:32 PM UTC-4, Gregg Dotoli wrote: > I am creating a tool to search a filesystem for one simple string. > I cannot get the syntax correct.

Re: module attributes and docstrings

2015-03-24 Thread Terry Reedy
On 3/24/2015 4:55 AM, Mario Figueiredo wrote: Reading PEP 257 and 258 I got the impression that I could document module attributes and these would be available in the __doc__ attribute of the object. So things like the one below are something I got used to do, but that don't work after all, as I

Re: Regex Python Help

2015-03-24 Thread Vincent Vande Vyvre
Le 24/03/2015 20:38, Vincent Vande Vyvre a écrit : Le 24/03/2015 20:22, Gregg Dotoli a écrit : Thank you! But The print error is gone, but now the script quickly finishes and doesnt walk the OS tree or search. Gregg On Tuesday, March 24, 2015 at 2:14:32 PM UTC-4, Gregg Dotoli wrote: I am

Re: Regex Python Help

2015-03-24 Thread Skip Montanaro
On Tue, Mar 24, 2015 at 2:22 PM, Gregg Dotoli wrote: > The print error is gone, but now the script quickly finishes and doesnt > walk > the OS tree or search. > You need to walk the directory tree recursively. Take a look at os.walk(). Skip -- https://mail.python.org/mailman/listinfo/python-li

Re: Regex Python Help

2015-03-24 Thread Rob Gaddi
On Tue, 24 Mar 2015 12:10:24 -0700, Gregg Dotoli wrote: > > Thank you Gary, that got rid of the error, but now there is no tree > walk, it runs and immediatley finishes. I just need to grep each file. I > have this working with the windows "for /r %a and redirecting that to > Python, but want to u

Re: Regex Python Help

2015-03-24 Thread Gregg Dotoli
This works fine , but I have to pipe the filename to the script python stool I am creating a tool to search a filesystem for one simple string. > I cannot get the syntax correct. > Thank you in advance for your help. > > import sys > import re > import os > path='/' > viewfiles=os.listdir(path)

Re: Regex Python Help

2015-03-24 Thread Vincent Vande Vyvre
Le 24/03/2015 20:22, Gregg Dotoli a écrit : Thank you! But The print error is gone, but now the script quickly finishes and doesnt walk the OS tree or search. Gregg On Tuesday, March 24, 2015 at 2:14:32 PM UTC-4, Gregg Dotoli wrote: I am creating a tool to search a filesystem for one simple

Re: subprocess and stdin.write(), stdout.read()

2015-03-24 Thread Chris Kaynor
On Tue, Mar 24, 2015 at 12:08 PM, Tobiah wrote: > The docs for the subprocess.Popen() say: > > Use communicate() rather than .stdin.write, .stdout.read > or .stderr.read to avoid deadlocks due to any of the other > OS pipe buffers filling up and blocking the child process >

Re: Regex Python Help

2015-03-24 Thread Terry Reedy
On 3/24/2015 2:13 PM, gdot...@gmail.com wrote: I am creating a tool to search a filesystem for one simple string. I cannot get the syntax correct. Thank you in advance for your help. import sys import re import os path='/' viewfiles=os.listdir(path) listdir is not recursive, so this code will

Re: Regex Python Help

2015-03-24 Thread Rob Gaddi
On Tue, 24 Mar 2015 12:43:38 -0700, Gregg Dotoli wrote: > [context snipped due to top posting] > > All I need is a loop, should I bag Python and use a simple shell for loop? Honestly, yes. You're not even using a regular expression, just a fixed string you're trying to search for. You can do

Pillow bug?

2015-03-24 Thread kai . peters
Judging from the message archive, the image-sig list is (just about) dead? Disclaimer: Am a newbie - so anything is possible using 'RGB' works fine img = Image.new('RGB', (inktile[0], inktile[1]), bgcolor) using '1' or 'L' does not (see trace below) img = Image.new('L', (inktile[0]

Re: Pillow bug?

2015-03-24 Thread Ian Kelly
On Tue, Mar 24, 2015 at 1:52 PM, wrote: > Judging from the message archive, the image-sig list is (just about) dead? > > Disclaimer: Am a newbie - so anything is possible > > > using 'RGB' works fine > > img = Image.new('RGB', (inktile[0], inktile[1]), bgcolor) > > using '1' or 'L' does not (

Re: Pillow bug?

2015-03-24 Thread Terry Reedy
On 3/24/2015 3:52 PM, kai.pet...@gmail.com wrote: Judging from the message archive, the image-sig list is (just about) dead? PIL and/or pillow should have their own lists. -- Terry Jan Reedy -- https://mail.python.org/mailman/listinfo/python-list

Re: Pillow bug?

2015-03-24 Thread kai . peters
On Tuesday, 24 March 2015 13:15:42 UTC-7, Ian wrote: > On Tue, Mar 24, 2015 at 1:52 PM, Kai wrote: > > Judging from the message archive, the image-sig list is (just about) dead? > > > > Disclaimer: Am a newbie - so anything is possible > > > > > > using 'RGB' works fine > > > > img = Image.ne

Re: Regex Python Help

2015-03-24 Thread Gregg Dotoli
Here you go. Windows shell was easier!!! for /f %a in (c:\gonow) do echo %a | c:\Python34\python c:\python34\unopy.py %a Now I can use any regex pattern, I need. On Tuesday, March 24, 2015 at 3:54:25 PM UTC-4, Rob Gaddi wrote: > On Tue, 24 Mar 2015 12:43:38 -0700, Gregg Dotoli wrote: > > > [c

Daylight savings time question

2015-03-24 Thread Dan Stromberg
Is there a way of "adding" 4 hours and getting a jump of 5 hours on March 8th, 2015 (due to Daylight Savings Time), without hardcoding when to spring forward and when to fall back? I'd love it if there's some library that'll do this for me. #!/usr/bin/python import pytz import datetime def main

Re: Daylight savings time question

2015-03-24 Thread Gary Herron
On 03/24/2015 03:24 PM, Dan Stromberg wrote: Is there a way of "adding" 4 hours and getting a jump of 5 hours on March 8th, 2015 (due to Daylight Savings Time), without hardcoding when to spring forward and when to fall back? I'd love it if there's some library that'll do this for me. #!/usr/bi

Re: Daylight savings time question

2015-03-24 Thread Chris Angelico
On Wed, Mar 25, 2015 at 9:24 AM, Dan Stromberg wrote: > Is there a way of "adding" 4 hours and getting a jump of 5 hours on > March 8th, 2015 (due to Daylight Savings Time), without hardcoding > when to spring forward and when to fall back? I'd love it if there's > some library that'll do this fo

Re: subprocess and stdin.write(), stdout.read()

2015-03-24 Thread Nobody
On Tue, 24 Mar 2015 12:08:24 -0700, Tobiah wrote: > But if I want to send a string to stdin, how can I do that without > stdin.write()? p.communicate(string) > This seems to work: Only because the amounts of data involved are small enough to avoid deadlock. If both sides write more dat

OpenID + Python 3.4

2015-03-24 Thread Juan C.
I was looking on the Internet regarding the use of OpenID in Python apps but I only found Flask/web related stuff. Is there any module that provides OpenID implementation for desktop level? I currently have a Python desktop script that needs to authenticate in a OpenID server, but I don't know ho

Re: Daylight savings time question

2015-03-24 Thread Dan Stromberg
This appears to do what I wanted: #!/usr/bin/python from __future__ import print_function import pytz import datetime # Is there a good way of jumping ahead 5 hours instead of 4 on 2015-03-08? def main(): # On 2015-03-08, 2:00 AM to 2:59AM Pacific time does not exist - the clock jumps forw

Re: To Change A Pdf Ebook To Kindle

2015-03-24 Thread Steven D'Aprano
On Tue, 24 Mar 2015 11:32 pm, alister wrote: > On Tue, 24 Mar 2015 00:05:46 -0700, jeffreyciross wrote: [off-topic spam] > > Calibre does a very god job as well. Please don't reply to spam. Unless the product is a Python library, or is given in direct reply to an explicit request for an applicat

Re: Best way to calculate fraction part of x?

2015-03-24 Thread Jason Swails
On Mon, Mar 23, 2015 at 8:38 PM, Emile van Sebille wrote: > On 3/23/2015 5:52 AM, Steven D'Aprano wrote: > > Are there any other, possibly better, ways to calculate the fractional >> part >> of a number? >> > > float (("%6.3f" % x)[-4:]) ​In general you lose a lot of precision this way...​ --

Re: Regex Python Help

2015-03-24 Thread Steven D'Aprano
On Wed, 25 Mar 2015 05:13 am, gdot...@gmail.com wrote: > The error is: > > SyntaxError: Missing parentheses in call to 'print' I cannot imagine how the message could be more explicit: the call to print is missing parentheses. If you're not going to read the error messages you are given, you are

test1

2015-03-24 Thread Tiglath Suriol
body {color:black;} h1 {text-align:center;color:maroon;font-size:30px;font-style:normal;} td {font-size:12;font-style:monospace;} } {% block title %}{% endblock %} IPDB Data Input Window Address:{{ form.address }}

Re: test1

2015-03-24 Thread Chris Angelico
On Wed, Mar 25, 2015 at 1:47 PM, Tiglath Suriol wrote: > {% block title %}{% endblock %} Looks to me like you're playing around with a templating system like Jinja, but may I suggest that you send tests to yourself rather than to an entire mailing list/newsgroup? :) ChrisA -- https://mail.pytho

test2

2015-03-24 Thread Tiglath Suriol
# Django settings for ipdb project. DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_em...@example.com'), ('jol', 'tegijjjlath.net'), ('totis', 't...@oint.com'), ) MANAGERS = ADMINS DATABASES = { 'default': { 'ENGINE':'django.db.backends.postgresq

Newbie looking for elegant solution

2015-03-24 Thread otaksoftspamtrap
I have a list containing 9600 integer elements - each integer is either 0 or 1. Starting at the front of the list, I need to combine 8 list elements into 1 by treating them as if they were bits of one byte with 1 and 0 denoting bit on/off (the 8th element would be the rightmost bit of the first

Re: test2

2015-03-24 Thread Chris Angelico
On Wed, Mar 25, 2015 at 2:11 PM, Tiglath Suriol wrote: > # Make this unique, and don't share it with anybody. > SECRET_KEY = '42=kv!a-il*!4j&7v+0(@a@vq_3j-+ysatta@l6-h63odj2)75' This right here is a reason to send your test messages someplace other than a huge, high-traffic mailing list! ChrisA

Re: Newbie looking for elegant solution

2015-03-24 Thread Chris Angelico
On Wed, Mar 25, 2015 at 2:13 PM, wrote: > I have a list containing 9600 integer elements - each integer is either 0 or > 1. > > Starting at the front of the list, I need to combine 8 list elements into 1 > by treating them as if they were bits of one byte with 1 and 0 denoting bit > on/off (th

Re: Newbie looking for elegant solution

2015-03-24 Thread otaksoftspamtrap
On Tuesday, March 24, 2015 at 8:29:24 PM UTC-7, Chris Angelico wrote: > On Wed, Mar 25, 2015 at 2:13 PM, wrote: > > I have a list containing 9600 integer elements - each integer is either 0 > > or 1. > > > > Starting at the front of the list, I need to combine 8 list elements into 1 > > by trea

Re: Newbie looking for elegant solution

2015-03-24 Thread Paul Rubin
otaksoftspamt...@gmail.com writes: > I have a list containing 9600 integer elements - each integer is > either 0 or 1. Is that a homework problem? This works for me in Python 2.7 but I think Python 3 gratuitously broke tuple unpacking so it won't work there: =

Re: Newbie looking for elegant solution

2015-03-24 Thread Chris Angelico
On Wed, Mar 25, 2015 at 3:04 PM, Paul Rubin wrote: > This works for me in Python 2.7 but I think > Python 3 gratuitously broke tuple unpacking so it won't work there: > > > > from itertools import count, groupby > old = [0, 0, 0, 1,

Re: Newbie looking for elegant solution

2015-03-24 Thread kai . peters
On Tuesday, 24 March 2015 21:04:37 UTC-7, Paul Rubin wrote: > nobody writes: > > I have a list containing 9600 integer elements - each integer is > > either 0 or 1. > > Is that a homework problem? This works for me in Python 2.7 but I think > Python 3 gratuitously broke tuple unpacking so it won

Re: Newbie looking for elegant solution

2015-03-24 Thread kai . peters
On Tuesday, 24 March 2015 21:20:11 UTC-7, Chris Angelico wrote: > On Wed, Mar 25, 2015 at 3:04 PM, Paul Rubin wrote: > > This works for me in Python 2.7 but I think > > Python 3 gratuitously broke tuple unpacking so it won't work there: > > > >

Re: test2

2015-03-24 Thread Ryan Stuart
On Wed, Mar 25, 2015 at 1:11 PM, Tiglath Suriol wrote: > # Make this unique, and don't share it with anybody. > ... > SECRET_KEY = '42=kv!a-il*!4j&7v+0(@a@vq_3j-+ysatta@l6-h63odj2)75' > > # List of callables that know how to import templates from various sources. > TEMPLATE_LOADERS = ( >

Re: test2

2015-03-24 Thread Steven D'Aprano
On Wednesday 25 March 2015 14:11, Tiglath Suriol wrote: > # Make this unique, and don't share it with anybody. > SECRET_KEY = '42=kv!a-il*!4j&7v+0(@a@vq_3j-+ysatta@l6-h63odj2)75' You'll need to change the comment to say "don't share it with anybody unless they have an internet connection." --

Re: Newbie looking for elegant solution

2015-03-24 Thread Chris Angelico
On Wed, Mar 25, 2015 at 3:46 PM, wrote: > Now I have just read the latest spec and speed/memory may become issues: > > 1 bit images of a size of 1024 x 1280 need to be processed this way, so > 1310720 list elements. Also needs to be 2.7 only. > > Any recommendations? 2.7 only? Then my solution w

Re: Newbie looking for elegant solution

2015-03-24 Thread Ben Finney
Chris Angelico writes: > Of course, this does mean installing numpy. It is crushing the nut > with the triphammer - an absurd extravagance of energy, but the nut is > effectively crushed all the same. It also has the advantage that it hopefully won't be acceptable for a homework assignment. Whe

Re: Newbie looking for elegant solution

2015-03-24 Thread Steven D'Aprano
On Wednesday 25 March 2015 14:13, otaksoftspamt...@gmail.com wrote: > I have a list containing 9600 integer elements - each integer is either 0 > or 1. > > Starting at the front of the list, I need to combine 8 list elements into > 1 by treating them as if they were bits of one byte with 1 and 0

Re: Newbie looking for elegant solution

2015-03-24 Thread Paul Rubin
kai.pet...@gmail.com writes: > 1 bit images of a size of 1024 x 1280 need to be processed this way, > so 1310720 list elements. Also needs to be 2.7 only. Where are these lists going to come from? Files? Process the file differently, probably. Use generators instead of lists, maybe. Or process

Re: Newbie looking for elegant solution

2015-03-24 Thread Dave Farrance
otaksoftspamt...@gmail.com wrote: >I have a list containing 9600 integer elements - each integer is either 0 or 1. >Starting at the front of the list, I need to combine 8 list elements into 1 by >treating them as if they were bits of one byte with 1 and 0 denoting bit >on/off (the 8th element wo

Re: Newbie looking for elegant solution

2015-03-24 Thread Rustom Mody
On Wednesday, March 25, 2015 at 11:23:08 AM UTC+5:30, Paul Rubin wrote: > kai.peters writes > > 1 bit images of a size of 1024 x 1280 need to be processed this way, > > so 1310720 list elements. Also needs to be 2.7 only. > > Where are these lists going to come from? Files? Process the file > d