On Sat, Aug 14, 2010 at 7:58 PM, Terry Reedy wrote:
> On 8/14/2010 7:44 PM, jyoun...@kc.rr.com wrote:
>>
>> Just curious if anyone knows if it's possible to work with pdf documents
>> with Python? I'd like to do the following:
>
> search python pdf library
> reportlab
I second the reportlab reco
On Sun, Aug 15, 2010 at 12:22, arihant nahata wrote:
> Hi,
> I m new to python and openCV.
I think you meant to send this to the list ;-)
> i installed openCV and python and copied
> the necessary folder. and even appended the sys.path. but then too the same
> error.
>
> from opencv import
On Sat, Aug 14, 2010 at 5:13 PM, kj wrote:
> In
> Raymond Hettinger writes:
>>On Aug 12, 1:37=A0pm, Thomas Jollans wrote:
>>> On Tuesday 10 August 2010, it occurred to kj to exclaim:
>>>
>>> > I'm looking for a module that implements "persistent lists": objects
>>> > that behave like lists exc
This should help:
http://docs.python.org/library/pickle.html
--
Zachary Burns
(407)590-4814
Aim - Zac256FL
Production Engineer
Zindagi Games
On Sat, Aug 14, 2010 at 5:13 PM, kj wrote:
> In
> Raymond Hettinger writes:
>
> >On Aug 12, 1:37=A0pm, Thomas Jollans wrote:
> >> On Tuesday 10 Augus
On 2010-08-14, Aahz wrote:
> Paul Rubin wrote:
>>
>>I'm not sure what the hiring issue is. I think anyone skilled in C++ or
>>Java can pick up Ada pretty easily. It's mostly a subset of C++ with
>>different surface syntax.
>
> Heck, I learned Ada as a sixteen-year-old knowing only BASIC and Pa
On Aug 14, 5:23 pm, Steven D'Aprano wrote:
> This general technique is called "monkey patching".
>
New term for me :)
> > Now, if an error is encountered myerror() is called. Fine. But execution
> > resumes in func(). Not exactly what I wanted.
>
> Of course it does. Your new error handler fail
> An exception will walk up the stack, calling any cleaning-up code that needs
> to be done (removing object references, executing finally: blocks, exiting
> context managers properly. It won't break anything. Don't be afraid of
> Python's high-level features!
Okay, I believe you (and the rest of
In message
<44d30ac7-931e-4eb0-9aed-f664c872d...@l20g2000yqm.googlegroups.com>,
sturlamolden wrote:
> A C++ compiler can use Python's header files and link with Python's C API
> correctly. But it cannot compile Python's C source code. A C compiler
> is required to compile and build Python.
Since
On Sat, Aug 14, 2010 at 8:18 PM, Stephen Hansen
wrote:
> On 8/14/10 8:11 PM, geremy condra wrote:
>> cpulimit or a cgroups container can both be easy solutions here,
>> depending on your exact needs.
>
> Hmm! I wasn't aware of those, I'll check that out. Thanks.
Np. I wrote a set of cgroups bindi
On 8/14/10 8:11 PM, geremy condra wrote:
> cpulimit or a cgroups container can both be easy solutions here,
> depending on your exact needs.
Hmm! I wasn't aware of those, I'll check that out. Thanks.
--
Stephen Hansen
... Also: Ixokai
... Mail: me+list/python (AT) ixokai (DOT)
On Sat, Aug 14, 2010 at 8:07 PM, Stephen Hansen
wrote:
> On 8/14/10 5:09 PM, Steven D'Aprano wrote:
>>> My worst case
>>> fall-back plan is to embed /another/ language (be it Lua or JavaScript
>>> through V8) and offer it a very limited environment. But I don't want to
>>> do that (and considering
On Sat, Aug 14, 2010 at 5:23 PM, Steven D'Aprano
wrote:
> Oh my ... I've seen people writing Java in Python, C++ in Python, Perl in
> Python, even VB in Python, but this is the first time I've meet some one
> who wants to write assembler in Python :)
+1 QOTW
Cheers,
Chris
--
http://mail.python
On 8/14/10 5:09 PM, Steven D'Aprano wrote:
>> My worst case
>> fall-back plan is to embed /another/ language (be it Lua or JavaScript
>> through V8) and offer it a very limited environment. But I don't want to
>> do that (and considering I solved the while True: pass problem last
>> night, I'm pret
On 8/14/10 5:36 PM, Christian Heimes wrote:
>> For example, when you go to save your bit of code, it will go in and if
>> it finds __ anywhere in the text it just replaces it with xx. And, since
>> getattr is not available, '_' + '_' won't get you anywhere.
>
> That's not as secure as you might th
On 8/14/2010 7:44 PM, jyoun...@kc.rr.com wrote:
Just curious if anyone knows if it's possible to work with pdf documents
with Python? I'd like to do the following:
search python pdf library
reportlab
--
Terry Jan Reedy
--
http://mail.python.org/mailman/listinfo/python-list
On 8/14/10 4:24 PM, Roland Koebler wrote:
> You can find some documentation at
> http://simple-is-better.org/template/pyratemp.html#evaluation,
> and the pseudo-sandbox itself in my template-engine, class
> "EvalPseudoSandbox" on the website above.
> (Please write me if you have any comments.)
How
On 8/14/10 2:25 PM, Cameron Simpson wrote:
> Ok, what about this: run the untrusted code in a separate process,
> if necessary running as a user with different privileges.
Way too much overhead by a really significant margin: I need to do many,
many, many, many, many very short (often very *very*
On 8/14/10 5:06 PM, Steven D'Aprano wrote:
> On Sun, 15 Aug 2010 01:24:00 +0200, Roland Koebler wrote:
>
>> I had the same problem, and so I created a "pseudo-sandbox" for
>> embedding Python in templates. This "pseudo-sandbox" creates a
>> restricted Python environment, where only whitelisted fun
On Aug 14, 4:05 pm, bvdp wrote:
> Assuming I have a module 'foo.py' with something like this:
>
> def error(s):
> print "Error", s
> sys.exit(1)
>
> def func(s):
> ... do some processing
> ... call error() if bad .. go to system exit.
> ... more processing
>
> and then I write
Here's the problem: I have about 25,000 mp3 files, each lasting,
*on average*, only a few seconds, though the variance is wide (the
longest one lasts around 20 seconds). (These files correspond to
sample sentences for foreign language training.)
The problem is that there is basically no padding
On Sun, Aug 15, 2010 at 12:06:35AM +, Steven D'Aprano wrote:
> Hmmm... is that meant just as an illustration of a general technique, or
> do you actually have something against the class of 0?
It's a short illustration; 0 .__class__ itself is harmless, but e.g.
0 .__class__.__base__.__subclass
On Aug 14, 2010, at 6:46 PM, Peter Otten wrote:
> Chris Hare wrote:
>
>>
>> On Aug 14, 2010, at 5:49 PM, Peter Otten wrote:
>>
>>> Chris Hare wrote:
>>>
Thanks Peter. I threw away what I started with and merged your code
into my class:
class externalLoopDisplay:
>>
> For example, when you go to save your bit of code, it will go in and if
> it finds __ anywhere in the text it just replaces it with xx. And, since
> getattr is not available, '_' + '_' won't get you anywhere.
That's not as secure as you might think. First of all you can write "_"
in more way tha
Here's the problem: I have about 25,000 mp3 files, each lasting,
*on average*, only a few seconds, though the variance is wide (the
longest one lasts around 20 seconds). (These files correspond to
sample sentences for foreign language training.)
The problem is that there is basically no padding
On Sat, 14 Aug 2010 16:05:05 -0700, bvdp wrote:
> Assuming I have a module 'foo.py' with something like this:
>
> def error(s):
> print "Error", s
> sys.exit(1)
>
> def func(s):
> ... do some processing
> ... call error() if bad .. go to system exit. ... more processing
>
> and
In Raymond
Hettinger writes:
>On Aug 12, 1:37=A0pm, Thomas Jollans wrote:
>> On Tuesday 10 August 2010, it occurred to kj to exclaim:
>>
>> > I'm looking for a module that implements "persistent lists": objects
>> > that behave like lists except that all their elements are stored
>> > on disk.
On Sat, 14 Aug 2010 11:44:22 -0400, Mel wrote:
> The downside to a print() function is that assigning to `print` can mask
> the function, and leave a neophyte without any way to get output out of
> the program.
On the other hand, the upside to a print() function is that assigning to
`print` can
On Sat, 14 Aug 2010 12:56:45 -0700, Stephen Hansen wrote:
>> I suggest that if the untrusted code is only supposed to be simple and
>> limited, you would be best off to write your own "mini-language" using
>> Python syntax.
>
> I considered it and rejected it. The return from the effort required
On Sun, 15 Aug 2010 01:24:00 +0200, Roland Koebler wrote:
> I had the same problem, and so I created a "pseudo-sandbox" for
> embedding Python in templates. This "pseudo-sandbox" creates a
> restricted Python environment, where only whitelisted functions/classes
> are allowed. Additionally, it pre
Chris Hare wrote:
>
> On Aug 14, 2010, at 5:49 PM, Peter Otten wrote:
>
>> Chris Hare wrote:
>>
>>> Thanks Peter. I threw away what I started with and merged your code
>>> into my class:
>>>
>>> class externalLoopDisplay:
>>>
>>>def show(self):
>>>main.logging.debug("externalLoop
Just curious if anyone knows if it's possible to work with pdf documents
with Python? I'd like to do the following:
- Pull out text from each PDF page (to search for specific words)
- Combine separate pdf documents into one document
- Add bookmarks (with destination settings)
A few programs I'v
Hi,
> I know all this -- but its not relevant really, I think. I'm not trying
> to create a safe yet relatively complete or functional Python. All those
> efforts to sandbox Python fail because of the incredible dynamic nature
> of the language has lots of enticing little holes in it. But I'm not
On Sunday 15 August 2010, it occurred to bvdp to exclaim:
> Assuming I have a module 'foo.py' with something like this:
>
> def error(s):
> print "Error", s
> sys.exit(1)
>
> def func(s):
> ... do some processing
> ... call error() if bad .. go to system exit.
> ... more proc
On Aug 14, 2010, at 5:49 PM, Peter Otten wrote:
> Chris Hare wrote:
>
>> Thanks Peter. I threw away what I started with and merged your code into
>> my class:
>>
>> class externalLoopDisplay:
>>
>>def show(self):
>>main.logging.debug("externalLoopDisplay.show:","start")
>>
>>
Assuming I have a module 'foo.py' with something like this:
def error(s):
print "Error", s
sys.exit(1)
def func(s):
... do some processing
... call error() if bad .. go to system exit.
... more processing
and then I write a new program, test.py, which:
import foo
def myerr
Chris Hare wrote:
> Thanks Peter. I threw away what I started with and merged your code into
> my class:
>
> class externalLoopDisplay:
>
> def show(self):
> main.logging.debug("externalLoopDisplay.show:","start")
>
> self.window = Tk()
>
> self.btnClose = Butt
On Aug 14, 2010, at 3:14 PM, Peter Otten wrote:
> Chris Hare wrote:
>
>> The scenario is this:
>>
>> I want to loop around all of the images in a given directory (which I know
>> will be images, but I guess I should check), show an image in a window,
>> wait 2 seconds and show the next one and
On Sat, Aug 14, 2010 at 12:56 PM, Stephen Hansen
wrote:
> On 8/13/10 8:04 PM, Steven D'Aprano wrote:
>> On Fri, 13 Aug 2010 16:37:40 -0700, Stephen Hansen wrote:
>>
>>> Howdy-ho.
>>>
>>> So, I'm working on a project which embeds Python into a bigger system to
>>> provide extensibility. In this pro
In article <7xeieevrze@ruckus.brouhaha.com>,
Paul Rubin wrote:
>
>I'm not sure what the hiring issue is. I think anyone skilled in C++ or
>Java can pick up Ada pretty easily. It's mostly a subset of C++ with
>different surface syntax.
Heck, I learned Ada as a sixteen-year-old knowing only
On 14Aug2010 12:56, Stephen Hansen wrote:
| On 8/13/10 8:04 PM, Steven D'Aprano wrote:
| > On Fri, 13 Aug 2010 16:37:40 -0700, Stephen Hansen wrote:
| >> So, I'm working on a project which embeds Python into a bigger system to
| >> provide extensibility. In this project, there's basically two type
Chris Hare wrote:
> The scenario is this:
>
> I want to loop around all of the images in a given directory (which I know
> will be images, but I guess I should check), show an image in a window,
> wait 2 seconds and show the next one and repeat that indefinitley, which
> will be until the user cl
On 8/13/10 8:04 PM, Steven D'Aprano wrote:
> On Fri, 13 Aug 2010 16:37:40 -0700, Stephen Hansen wrote:
>
>> Howdy-ho.
>>
>> So, I'm working on a project which embeds Python into a bigger system to
>> provide extensibility. In this project, there's basically two types of
>> people who will be enter
Pramod wrote:
Hi Friends
When run the below program in python i got error like this ,
Matrix
[[ 8 -6 2]
[-4 11 -7]
[ 4 -7 6]]
row vecotr X
[[ 28 -40 33]]
Traceback (most recent call last):
File "solve.py", line 16, in
print A*B
File "/usr/lib/python2.6/dist-packages/numpy/core/
Pramod wrote:
> When run the below program in python i got error like this ,
>
>
> Matrix
> [[ 8 -6 2]
> [-4 11 -7]
> [ 4 -7 6]]
> row vecotr X
> [[ 28 -40 33]]
> Traceback (most recent call last):
> File "solve.py", line 16, in
> print A*B
> File "/usr/lib/python2.6/dist-packages
The scenario is this:
I want to loop around all of the images in a given directory (which I know will
be images, but I guess I should check), show an image in a window, wait 2
seconds and show the next one and repeat that indefinitley, which will be until
the user closes the window.
This is th
Chrome ore Sell Pakistani 30% - 52%,
http://buy-sell-pakistani-minerals.blogspot.com
--
http://mail.python.org/mailman/listinfo/python-list
Hi Friends
When run the below program in python i got error like this ,
Matrix
[[ 8 -6 2]
[-4 11 -7]
[ 4 -7 6]]
row vecotr X
[[ 28 -40 33]]
Traceback (most recent call last):
File "solve.py", line 16, in
print A*B
File "/usr/lib/python2.6/dist-packages/numpy/core/defmatrix.py",
l
On Sat, Aug 14, 2010 at 11:56 AM, Thomas Jollans wrote:
> The DOM is disjunct from the original file, stream, string, etc. That's in the
> nature of the DOM, and it's probably true for most, if not all, DOM
> implementations, in other programming languages as well as Python.
> If you want to stay
On Saturday 14 August 2010, it occurred to GZ to exclaim:
> On Aug 14, 12:07 pm, Thomas Jollans wrote:
> > On Saturday 14 August 2010, it occurred to GZ to exclaim:
> > > Hi All,
> > >
> > > I am writing a little program that reads the minidom tree built from
> > > an xml file. I would like to pr
On Aug 14, 12:07 pm, Thomas Jollans wrote:
> On Saturday 14 August 2010, it occurred to GZ to exclaim:
>
> > Hi All,
>
> > I am writing a little program that reads the minidom tree built from
> > an xml file. I would like to print out the line number of the xml file
> > on the parts of the tree th
On 8/14/2010 10:52 AM, Baba wrote:
for n_nuggets in range(50):
result1 = can_buy(n_nuggets)
result2 = can_buy(n_nuggets+1)
result3 = can_buy(n_nuggets+2)
result4 = can_buy(n_nuggets+3)
result5 = can_buy(n_nuggets+4)
result6 = can_buy(n_nuggets+5)
if result1!=[]
On Aug 12, 1:20 pm, Paddy wrote:
> I find myself needing to calculate the difference between two Counters
> or multisets or bags.
>
> I want those items that are unique to each bag.
Tell us about your use cases. I'm curious how a program would ascribe
semantic meaning to the result. The phrase
On Saturday 14 August 2010, it occurred to GZ to exclaim:
> Hi All,
>
> I am writing a little program that reads the minidom tree built from
> an xml file. I would like to print out the line number of the xml file
> on the parts of the tree that are not valid. But I do not seem to find
> a way to
Thanks!!
On Sat, Aug 14, 2010 at 9:49 PM, Juan Andres Knebel wrote:
> Hi Bhanu,
> if you want to use QT try eric4 for python2 or eric5 for python3. Is very
> nice IDE, but if you want to develop only pure python use kate or similar or
> eclipse if you need a nice way to see the debug processes
Baba wrote:
On Aug 13, 8:25 pm, Ian Kelly wrote:
It's not. You're not just trying to find the sixth value that can be
bought in exact quantity, but a sequence of six values that can all be
bought in exact quantity. The integers [6, 9, 12, 15, 18, 20] are not
sequential.
Hi Ian,
Thanks for
On Sat, Aug 14, 2010 at 8:52 AM, Baba wrote:
> my code is probably not elegant but a huge step forward from where i
> started:
>
> def can_buy(n_nuggets):
> for a in range (0,n_nuggets):
> for b in range (0,n_nuggets):
> for c in range (0,n_nuggets):
> #print "tryin
On 8/14/10, Baba wrote:
> On Aug 13, 8:25 pm, Ian Kelly wrote:
>
>> It's not. You're not just trying to find the sixth value that can be
>> bought in exact quantity, but a sequence of six values that can all be
>> bought in exact quantity. The integers [6, 9, 12, 15, 18, 20] are not
>> sequenti
Hi Bhanu,
if you want to use QT try eric4 for python2 or eric5 for python3. Is very
nice IDE, but if you want to develop only pure python use kate or similar or
eclipse if you need a nice way to see the debug processes
On Thu, Aug 12, 2010 at 7:44 AM, Roald de Vries wrote:
> Hi Bhanu,
>
>
> On
Baba wrote:
> def can_buy(n_nuggets):
>for a in range (0,n_nuggets):
>for b in range (0,n_nuggets):
>for c in range (0,n_nuggets):
>#print "trying for %d: %d %d %d" % (n_nuggets,a,b,c)
>if 6*a+9*b+20*c==n_nuggets:
>return
Thomas Jollans wrote:
> On Saturday 14 August 2010, it occurred to Frederick
Williams to exclaim:
>> So why the change from print to print()?
> There's no reason for print to be a statement -- it can
just as well be a
> function, which makes the language more regular, and
therefore quite
> pos
On Saturday 14 August 2010, it occurred to Frederick Williams to exclaim:
> I am learning Python from Hammond & Robinson's _Python Programming on
> Win32_, January 2000 edition. This
>
>print "Sleeping for 10 seconds"
>
> which appears in some example code, fails to... um... Compile?
> Inter
In article ,
Grant Edwards wrote:
>
>I also looked at Modula-3 once, and thought it had some real promise,
>but I think it's probably deader than Ada now.
That's because you should be using Oberon instead.
--
Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/
"...if
I am learning Python from Hammond & Robinson's _Python Programming on
Win32_, January 2000 edition. This
print "Sleeping for 10 seconds"
which appears in some example code, fails to... um... Compile?
Interpret? Well, whatever the word is, it fails. Trial and error
revealed that
print("
On Aug 13, 8:25 pm, Ian Kelly wrote:
> It's not. You're not just trying to find the sixth value that can be
> bought in exact quantity, but a sequence of six values that can all be
> bought in exact quantity. The integers [6, 9, 12, 15, 18, 20] are not
> sequential.
Hi Ian,
Thanks for stating
On Aug 12, 4:33 am, Paul Rubin wrote:
> Baba writes:
> > exercise: given that packs of McNuggets can only be bought in 6, 9 or
> > 20 packs, write an exhaustive search to find the largest number of
> > McNuggets that cannot be bought in exact quantity.
>
> Is that a homework problem? Hint: first
> Is there a standard way to autodetect the encoding of a text file?
Use the chardet module:
http://chardet.feedparser.org/
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
On Saturday 14 August 2010, it occurred to Steven D'Aprano to exclaim:
> On Fri, 13 Aug 2010 18:25:46 -0400, Terry Reedy wrote:
> > A short background to MRAB's answer which I will try to get right.
> >
> > The byte-order-mark was invented for UTF-16 encodings so the reader
> > could determine whe
Hi there,
numpy, matplotlib are already parts of Portable Python, PyQt is coming
in one of the next versions. Creating it is not so difficult, it is
basically repackaging of the python core and the required modules.
Tricky part is keeping it portable as big part of libs is storing
their configurat
68 matches
Mail list logo