Good evening,
I have converted ODT to HTML using LibreOffice Writer, because I want
to convert from HTML to Creole using python-creole. Unfortunately I
get this error: "File "Convert to Creole.py", line 17
SyntaxError: Non-ASCII character '\xe2' in file Convert to Creole.py
on line 18, but no enco
On 09/12/2011 12:49 AM, Alec Taylor wrote:
Good evening,
I have converted ODT to HTML using LibreOffice Writer, because I want
to convert from HTML to Creole using python-creole. Unfortunately I
get this error: "File "Convert to Creole.py", line 17
SyntaxError: Non-ASCII character '\xe2' in file
from creole import html2creole
from BeautifulSoup import BeautifulSoup
VALID_TAGS = ['strong', 'em', 'p', 'ul', 'li', 'br', 'b', 'i', 'a', 'h1', 'h2']
def sanitize_html(value):
soup = BeautifulSoup(value)
for tag in soup.findAll(True):
if tag.name not in VALID_TAGS:
tag
On Mon, Sep 12, 2011 at 8:17 AM, Gary Herron wrote:
> On 09/12/2011 12:49 AM, Alec Taylor wrote:
>
>> Good evening,
>>
>> I have converted ODT to HTML using LibreOffice Writer, because I want
>> to convert from HTML to Creole using python-creole. Unfortunately I
>> get this error: "File "Convert t
Alec Taylor, 12.09.2011 10:33:
from creole import html2creole
from BeautifulSoup import BeautifulSoup
VALID_TAGS = ['strong', 'em', 'p', 'ul', 'li', 'br', 'b', 'i', 'a', 'h1', 'h2']
def sanitize_html(value):
soup = BeautifulSoup(value)
for tag in soup.findAll(True):
if tag.na
On Wed, 31 Aug 2011 10:33 pm Steven D'Aprano wrote:
> Twice in a couple of weeks, I have locked up my PC by running a Python 2.5
> script that tries to create a list that is insanely too big.
>
> In the first case, I (stupidly) did something like:
>
> mylist = [0]*12345678901234
[...]
> Apart fr
On Mon, 12 Sep 2011 06:43 pm Stefan Behnel wrote:
> I'm not sure what you are trying to say with the above code, but if it's
> the code that fails for you with the exception you posted, I would guess
> that the problem is in the "[more stuff here]" part, which likely contains
> a non-ASCII charact
Hi!
I'm trying to provide some scripting capabilities to a program. For that,
I'm embedding a Python interpreter, running a script in a separate thread to
decouple it from the UI.
Now, how should I handle rogue scripts? For example, when a script hangs in
an endless loop, how do I signal the P
I have a large file, 18gb uncompressed, and I would like to know what is the
preferred method to read this file for random access. I have several
processes reading the file which different calculate arguments. My server
has 64gb of memory. Not sure what is the preferred way to do this?
--
---
On Mon, Sep 12, 2011 at 8:00 PM, Ulrich Eckhardt
wrote:
> Now, how should I handle rogue scripts? For example, when a script hangs in
> an endless loop, how do I signal the Python interpreter to shut down? In
> other words, I want to trigger something like what Control-C does in a
> "normal" envir
On Montag 12 September 2011, Rita wrote:
> I have a large file, 18gb uncompressed, and I would like to
> know what is the preferred method to read this file for
> random access. I have several processes reading the file
> which different calculate arguments. My server has 64gb of
> memory. Not sure
Ulrich Eckhardt wrote:
> Hi!
>
> I'm trying to provide some scripting capabilities to a program. For that,
> I'm embedding a Python interpreter, running a script in a separate thread
> to decouple it from the UI.
>
> Now, how should I handle rogue scripts? For example, when a script hangs
> in a
In article <4e6dc66e$0$29986$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> > mylist = [0]*12345678901234
> [...]
> > Apart from "Then don't do that!", is there anything I can do to prevent
> > this sort of thing in the future? Like instruct Python not to request more
> > memory t
On 01/-10/-28163 02:59 PM, Steven D'Aprano wrote:
On Mon, 12 Sep 2011 06:43 pm Stefan Behnel wrote:
I'm not sure what you are trying to say with the above code, but if it's
the code that fails for you with the exception you posted, I would guess
that the problem is in the "[more stuff here]" pa
Steven D'Aprano wrote:
> Ulrich Eckhardt wrote:
>> I'm trying to provide some scripting capabilities to a program. For that,
>> I'm embedding a Python interpreter, running a script in a separate thread
>> to decouple it from the UI.
>>
>> Now, how should I handle rogue scripts? For example, when a
Chris Angelico wrote:
> You can use PyErr_SetInterrupt to raise KeyboardInterrupt
This sounds useful. Just to make sure, this would be called from a different
thread than the one running the Python script, is that still OK?
> , but it can be caught by the script. There's no guaranteed way,
> sho
On Wed, 31 Aug 2011 22:47:59 +1000, Steven D'Aprano wrote:
>> Linux seems to fair badly when programs use more memory than physically
>> available. Perhaps there's some per-process thing that can be used to
>> limit things on Linux?
>
> As far as I know, ulimit ("user limit") won't help. It can l
> From: "Laszlo Nagy"
> To: "Siniša Šegvić" , python-list@python.org
> Sent: Friday, September 9, 2011 11:39:52 AM
> Subject: Re: Portable locale usage
>
> Looks like you have found a bug! :-) Why don't you post a bug report?
I just did:
http://bugs.python.org/issue12964
Thanks everyone for he
On Mon, Sep 12, 2011 at 10:05 PM, Ulrich Eckhardt
wrote:
> Chris Angelico wrote:
>> You can use PyErr_SetInterrupt to raise KeyboardInterrupt
>
> This sounds useful. Just to make sure, this would be called from a different
> thread than the one running the Python script, is that still OK?
>
>> , b
Terry Reedy wrote:
> The statement containing the explicit next(items) call can optionally be
> wrapped to explicitly handle the case of an empty iterable in whatever
> manner is desired.
>
> try:
>
> except StopIteration:
> raise ValueError("iterable cannot be empty")
>
>
Alterna
You can add "# coding=UTF8" to the top of your file (see
http://www.python.org/dev/peps/pep-0263/).
Of you want to remove unicode, there are several options, one of them is
passing the file through "iconv --to ascii".
--
http://mail.python.org/mailman/listinfo/python-list
Hi,
I need to write a web interface for some computational biology software
I've written:
http://sysbio.mrc-bsu.cam.ac.uk/johns/STEME/rst/_build/html/index.html
I don't have much experience writing web sites or applications. Can
anyone recommend a python framework that will allow me to easily
Rita, 12.09.2011 12:34:
I have a large file, 18gb uncompressed, and I would like to know what is the
preferred method to read this file for random access. I have several
processes reading the file which different calculate arguments. My server
has 64gb of memory. Not sure what is the preferred wa
On 12 sep, 10:17, Gary Herron wrote:
> On 09/12/2011 12:49 AM, Alec Taylor wrote:
>
>
>
> > Good evening,
>
> > I have converted ODT to HTML using LibreOffice Writer, because I want
> > to convert from HTML to Creole using python-creole. Unfortunately I
> > get this error: "File "Convert to Creole
On Mon, Sep 12, 2011 at 1:49 AM, Alec Taylor wrote:
> Good evening,
>
> I have converted ODT to HTML using LibreOffice Writer, because I want
> to convert from HTML to Creole using python-creole. Unfortunately I
> get this error: "File "Convert to Creole.py", line 17
> SyntaxError: Non-ASCII chara
On 12 sep, 10:49, Steven D'Aprano wrote:
>
> Even with a source code encoding, you will probably have problems with
> source files including \xe2 and other "bad" chars. Unless they happen to
> fall inside a quoted string literal, I would expect to get a SyntaxError.
>
This is absurd and a complet
Dear all,
I am a python newbie, but I intend to program a python script that
communicates with Labview via a UDP socket.
I managed to send LabView strings, but the other way around is not
working.
The code seems to stop working while in the first while loop. I can
see the word "test" being print ou
Hi,
I have a problem with the ipython shell: frequently, within one session
I would like to do 2D plotting, using matplotlib, as well as 3D
visualization using mayavi
The man page for ipython, matplotlib, and mayavi tell me, that I must
invoke ipython with
ipython -wthread for mayavi and
i
Am 12.09.2011 16:03, schrieb John Reid:
I don't have much experience writing web sites or applications. Can
anyone recommend a python framework that will allow me to easily write a
few pages?
You want a simple framework? Try Bottle:
http://bottlepy.org/
Matthias
--
http://mail.python.org/mail
Mark Dickinson-2 wrote:
>
>
> This is a well-known trick: to divide 5 (unlabeled) balls amongst 3
> (labeled) boxes, you write down sequences of 5 o's and 2 x's, where
> the o's represent the 5 balls and the 'x's represent dividers:
>
> ooxooxo -> [2, 2, 1]
> xoooxoo -> [0, 3, 2]
>
I personally like CherryPy. But it all depends on your needs and style. I
suggest you play with some of the packages and select one that you feel best
with.
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, Sep 11, 2011 at 6:45 PM, Terry Reedy wrote:
> whereas, you are right, it breaks it noisily in the body. So Ian's claim
> that StopIteration must be caught to avoid silent termination is not true.
> Thanks for pointing out what I saw but did not cognize the full implication
> of before. A b
On Mon, Sep 12, 2011 at 10:55 AM, Ian Kelly wrote:
> But you can't write the function under the assumption that it will
> only be called from the function body. The following is a slight
> reorganization of your example that does exhibit the problem:
s/function body/for-loop body/
--
http://mai
On Mon, Sep 12, 2011 at 8:51 AM, G. wrote:
> When I start LabView UDP_sender.vi it is supposed to send a string
> back to python, but sometimes it ends with an error saying the port
> and the ip is already in usage. Do I have to start first LabView or
> the python scrip when listening to LabView,
On Sep 11, 1:00 am, Steven D'Aprano wrote:
> 守株待兔 wrote:
> > how can i convert "Dec 11" into 2011-12?
>
> if my_str == "Dec 11":
> return 1999 # 2011 - 12
>
> Does that help?
>
> But seriously... 2011-12 is not a proper date, so the simplest way is
> probably something like this:
>
> def con
The simplest one to learn is web2py http://www.web2py.com
No configuration needed, just unpack and get started.
It also has very good documentation and tons of little examples to get
things done.
The other options you mentioned are good too :)
--
http://mail.python.org/mailman/listinfo/python-
On 9/12/2011 9:06 AM, Duncan Booth wrote:
Terry Reedy wrote:
The statement containing the explicit next(items) call can optionally be
wrapped to explicitly handle the case of an empty iterable in whatever
manner is desired.
try:
except StopIteration:
raise ValueError("iterable ca
On Sep 9, 2:04 am, Terry Reedy wrote:
> On 9/8/2011 9:09 PM, papu wrote:
>
>
>
> > Hello, I have a data file (un-structed messy file) from which I have
> > to scrub specific list of words (delete words).
>
> > Here is what I am doing but with no result:
>
> > infile = "messy_data_file.txt"
> > out
On 12/09/2011 20:49, gry wrote:
On Sep 9, 2:04 am, Terry Reedy wrote:
On 9/8/2011 9:09 PM, papu wrote:
Hello, I have a data file (un-structed messy file) from which I have
to scrub specific list of words (delete words).
Here is what I am doing but with no result:
infile = "messy_data_
On 9/12/2011 12:55 PM, Ian Kelly wrote:
On Sun, Sep 11, 2011 at 6:45 PM, Terry Reedy wrote:
whereas, you are right, it breaks it noisily in the body. So Ian's claim
that StopIteration must be caught to avoid silent termination is not true.
Thanks for pointing out what I saw but did not cognize
On 9/12/2011 7:40 AM, Roy Smith wrote:
In article<4e6dc66e$0$29986$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
mylist = [0]*12345678901234
[...]
Apart from "Then don't do that!", is there anything I can do to prevent
this sort of thing in the future? Like instruct Python no
On 9/12/2011 12:34 AM, Juan Pablo Romero Méndez wrote:
Hello,
What do you guys think about adding a method "to_json" to dictionaries
and sequence types? Perhaps through a module import?
Negative. If this were added, why not to_yaml, to_marshal, to_pickle,
to_zip, and so on. Better to have eac
On Mon, 12 Sep 2011 15:47:00 +0100, jmfauth wrote:
On 12 sep, 10:49, Steven D'Aprano wrote:
Even with a source code encoding, you will probably have problems with
source files including \xe2 and other "bad" chars. Unless they happen to
fall inside a quoted string literal, I would expect to g
# Quote #
# The itertools module is great HOWEVER i believe most #
# people are recreating the functionalities due to the
On Mon, Sep 12, 2011 at 10:04 PM, rantingrick wrote:
>
>
> # Quote #
>
> # The itertools module is great HOWEVER i believe m
2011/9/12 Alec Taylor :
> Good evening,
>
> I have converted ODT to HTML using LibreOffice Writer, because I want
> to convert from HTML to Creole using python-creole. Unfortunately I
> get this error: "File "Convert to Creole.py", line 17
> SyntaxError: Non-ASCII character '\xe2' in file Convert t
Nick Stinemates wrote:
I'm honestly missing the point of this mail.
rantingrick is a well-known troll, and doesn't need to have a point.
Please do not feed the troll.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
i change open into open1,it's ok now
import os
import csv
for name in os.listdir('/tmp/quote/'):
filename='/tmp/quote/'+name
file = open(filename,'r')
file.readline()
for row in csv.reader(file):
(date,open1,high,low,close,vol,adjclose) = (row[0], row[1], row
i change open into open1,it's ok now
import os
import csv
for name in os.listdir('/tmp/quote/'):
filename='/tmp/quote/'+name
file = open(filename,'r')
file.readline()
for row in csv.reader(file):
(date,open1,high,low,close,vol,adjclose) = (row[0], row[1], row
(I sent this reply a week ago, but it seems to have disappeared. So trying
again.)
On Tue, 6 Sep 2011 06:18 pm 守株待兔 wrote:
> when i add (date,open,high,low,close,vol,adjclose) = (row[0], row[1],
> row[2], row[3],row[4], row[5], row[6]) change the code into
Here you define a new variable cal
On Tue, Sep 13, 2011 at 1:28 PM, Steven D'Aprano
wrote:
> The best solution is to avoid using the name "open", instead call it "open_"
> (underscore at the end is the usual convention to avoid shadowing
> built-ins). Or "open_value" or any other appropriate name.
>
This is why every good programm
I'm reading "Learning Python"( Chinese version). Before I go through
the whole book, I want to do some excises matching each charter.
Any tips? Any better advice?
--
http://mail.python.org/mailman/listinfo/python-list
Hello All,
we observed that user exactly deleted when 'create' cmd is executed:
filestore = create("wlstProperties.getProperty(fileStoreName)",
"FileStore")
jmsServer = create("AUAJMSServer", "JMSServer")
...
..
etc.
http://groups.google.com/group/comp.lang.java.programmer/browse_thread/thread/19
Hi,
I use Ubuntu and the Python packages on my system were either
installed with (1) apt-get, or with (2) pip. Since the number of
python packages in the Ubuntu repositories is limited, I had to
install several packages with pip.
Now I want to upgrade the packages that were installed with pip (an
On 09/12/2011 09:20 PM, sillyou su wrote:
I'm reading "Learning Python"( Chinese version). Before I go through
the whole book, I want to do some excises matching each charter.
Any tips? Any better advice?
For the code examples, have you tried looking up the home page for the
book? Google fo
Wide ranges of careers opportunity. Management careers.
http://rojgars1.webs.com/hrm.htm http://topcareer.webs.com/qualitymanagement.htm
HRM, PM, marketing manager jobs and accounts jobs move to your next
career start earning with manager level.
http://todayvacancy.blogspot.com/2011/07/account-ass
56 matches
Mail list logo