hello,
i have the following code:
if unique_id is not None:
training = self.get_site_root()
from training import Training
# link back to news item
root = context.root
formats = ['itinerary', 'news']
for document in formats:
results = root.search(format=document, uni
"Lie Ryan" wrote
documents were generated by another computer ie. they are not web page
documents.
If the source document was generated by a computer, and it produces
invalid markup, shouldn't that be considered a bug in the producing
Elementree parses xml, the source docs are html.
Va
Norman Khine wrote:
hello,
i have the following code:
if unique_id is not None:
training = self.get_site_root()
from training import Training
# link back to news item
root = context.root
formats = ['itinerary', 'news']
for document in formats:
results = root.searc
David wrote:
I am getting information from .txt files and posting them in fields on a
web site. I need to break up single strings so they are around 80
characters then a new line because when I enter the info to the form on
the website it has fields and it errors out with such a long string.
Le Tue, 28 Apr 2009 22:51:09 + (GMT),
Emilio Casbas s'exprima ainsi:
>
> Hi,
>
> following the example from
> http://docs.python.org/3.0/howto/regex.html
>
> If I execute the following code on the python shell (3.1a1):
>
> >>> import re
> >>> p = re.compile('ab*')
> >>> p
>
> I get the m
Le Wed, 29 Apr 2009 09:42:44 +0200,
"A.T.Hofkamp" s'exprima ainsi:
> Norman Khine wrote:
> > hello,
> > i have the following code:
> >
> > if unique_id is not None:
> > training = self.get_site_root()
> > from training import Training
> > # link back to news item
> > root = conte
Lie / Alan
re: If the source document was generated by a computer, and it produces invalid
markup, shouldn't that be considered a bug in the producing program?
Yes, absolutely but we don't have access to the producing program only the
produced xhtml files.
Dinesh
---
On Wed, Apr 29, 2009 at 2:19 AM, Jianchun Zhou wrote:
> Hi, there:
>
> I am new to python, and now I got a trouble:
>
> I have an application named canola, it is written under python 2.5, and can
> run normally under python 2.5
>
> But when it comes under python 2.6, problem up, it says:
>
> Trace
On Tue, Apr 28, 2009 at 7:24 PM, Emile van Sebille wrote:
> Emile van Sebille wrote:
> Possibly a case of the documentation not keeping up with the release...
It's pretty easy to file a bug report against the docs. Minor fixes
like this are often incorporated fairly quickly. See
http://docs.pyth
On Wed, Apr 29, 2009 at 3:05 AM, Norman Khine wrote:
> hello,
> i have the following code:
>
> if unique_id is not None:
> training = self.get_site_root()
> from training import Training
> # link back to news item
> root = context.root
> formats = ['itinerary', 'news']
> for docu
Martin Walsh wrote:
... but, you don't need to use subprocess at all. How about (untested),
# grep USE /tmp/comprookie2000/emerge_info.txt |head -n1|cut -d\" -f2
infof = open('/tmp/comprookie2000/emerge_info.txt')
for line in infof:
if 'USE' in line:
USE = line.split('"')[1]
Jianchun Zhou wrote:
Hi, there:
I am new to python, and now I got a trouble:
I have an application named canola, it is written under python 2.5, and
can run normally under python 2.5
But when it comes under python 2.6, problem up, it says:
Traceback (most recent call last):
File "/usr/lib
Norman Khine wrote:
hello,
i have the following code:
Uhh... 5 levels deep of nesting, and from the hint that you used
self.blah earlier this is inside a class which adds a minimum of two
extra levels, in total of 7 levels nesting... We're in deep trouble.
is there a way to optimise the lo
David wrote:
Martin Walsh wrote:
Just one more comment, string.join is deprecated, yet join is a method
of str objects. So ...
Lines = '\n'.join(L)
... or use textwrap.fill which returns a string with the newlines
already in place ...
Lines = textwrap.fill(USE, 80)
HTH,
Marty
2009/4/29 David :
> Here is the whole program so far, what it does is it logs into a druple web
> site and posts. I would like to make it better, as you can see I do the same
> thing over and over.
>
> http://linuxcrazy.pastebin.com/m7689c088
What you can do is define all the variables upfront. Th
David wrote:
> Martin Walsh wrote:
>>> ... but, you don't need to use subprocess at all. How about (untested),
>>>
>>> # grep USE /tmp/comprookie2000/emerge_info.txt |head -n1|cut -d\" -f2
>>> infof = open('/tmp/comprookie2000/emerge_info.txt')
>>> for line in infof:
>>> if 'USE' in line:
>>>
Sander Sweers wrote:
> 2009/4/29 David :
>> Here is the whole program so far, what it does is it logs into a druple web
>> site and posts. I would like to make it better, as you can see I do the same
>> thing over and over.
>>
>> http://linuxcrazy.pastebin.com/m7689c088
>
> What you can do is defi
Thanks to all for the responses.
I've filled a bug report as you pointed out.
http://bugs.python.org/msg86803
Thanks
Emilio
- Mensaje original
> De: Kent Johnson
> Para: Emile van Sebille
> CC: tutor@python.org
> Enviado: miércoles, 29 de abril, 2009 13:06:49
> Asunto: Re: [Tutor]
Hello,
I have an issue with scopes (namespaces).
Say I have a source file 'test.py' with the single line:
print vars() # same with locals()
Now, from the command-line:
s...@o:~/prog/pijnu$ python test.py
{'__builtins__': , '__name__': '__main__',
'__file__': 'test.py', '__doc__': Non
On Wed, Apr 29, 2009 at 9:56 AM, spir wrote:
> Hello,
>
> I have an issue with scopes (namespaces).
> Say I have a source file 'test.py' with the single line:
> print vars() # same with locals()
>
> Now, from the command-line:
>
> s...@o:~/prog/pijnu$ python test.py
> {'__builtins__': ,
Hello Spir!
On Thursday 23 April 2009, spir wrote:
> I would like to refactor tests of an application in a consistent
> form. I have a ton of tests for each module, but they are all ad
> hoc things. doctest looks great. The issue is it seems based on
> command line-like testing:
I have researched
This could be a question for the comp.lang.python list but I'll try here first:
Say, you have a dictionary of integers, are the integers stored in a compressed
integer format or as integers ie. are integers encoded before being stored in
the dictionary and then decoded when read?
Dinesh
___
On Wed, Apr 29, 2009 at 10:54 AM, spir wrote:
> Le Wed, 29 Apr 2009 10:05:04 -0400,
> Kent Johnson s'exprima ainsi:
>> There is some discussion here:
>> http://mail.python.org/pipermail/python-3000/2007-March/006161.html
>>
>> Short answer: __builtins__ is an implementation detail that you should
"Dinesh B Vadhia" wrote
Say, you have a dictionary of integers, are the integers stored
in a compressed integer format or as integers ie. are integers
encoded before being stored in the dictionary and then
decoded when read?
I can't think of any reason to compress them, I imagine they
are
Dinesh B Vadhia wrote:
> Say, you have a dictionary of integers, are the integers stored in a
> compressed integer format or as integers ie. are integers encoded before
> being stored in the dictionary and then decoded when read?
Integer objects are not special cased in dictionaries. They are stor
"Sander Sweers" wrote
What you can do is define all the variables upfront. This way you can
get rid of the else. Below is an example how you can do this with only
looping once over the fle.
And you can put the variables as keys of a dictionary and avoid
all the if tests:
data = {'CBUILD':
Alan Gauld wrote:
"Sander Sweers" wrote
What you can do is define all the variables upfront. This way you can
get rid of the else. Below is an example how you can do this with only
looping once over the fle.
And you can put the variables as keys of a dictionary and avoid all the
if tests:
Le Wed, 29 Apr 2009 12:32:57 -0400,
Kent Johnson s'exprima ainsi:
> On Wed, Apr 29, 2009 at 10:54 AM, spir wrote:
> > Le Wed, 29 Apr 2009 10:05:04 -0400,
> > Kent Johnson s'exprima ainsi:
> >> There is some discussion here:
> >> http://mail.python.org/pipermail/python-3000/2007-March/006161.h
Alan
I want to perform test runs on my local machine with very large numbers of
integers stored in a dictionary. As the Python dictionary is an built-in
function I thought that for very large dictionaries there could be compression.
Done correctly, integer compression wouldn't affect performa
Trying to print something with a { in it.
Probably extremely simple, but it's frustrating me. :(
print ('The \"This is a test \" {')
i get this error
ValueError: Single '{' encountered in format string
___
Tutor maillist - Tutor@python.org
http://ma
I made a program named as a title.py inside it used Inheritance , now I
want to Extend the Parent Class in another program(file also) but having an
Error lets check ,my code
1.first file title .py
class global Studentdatabase:
def __init__(self,name,age,standard,place,dateofbirth,sex):
On Wed, Apr 29, 2009 at 2:42 PM, Dave Crouse wrote:
> Trying to print something with a { in it.
> Probably extremely simple, but it's frustrating me. :(
>
> print ('The \"This is a test \" {')
>
> i get this error
>
> ValueError: Single '{' encountered in format string
It works for me:
Python 3.
The double {{ }} worked perfectly, THANK YOU ! :)
This was driving me crazy.
On Wed, Apr 29, 2009 at 2:03 PM, Kent Johnson wrote:
> print ('The \"This is a test \" {')
>
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/
I'd like to label the plot axes as x and y. All I see is xlabel and
ylabel. ylabel puts y on its side, rotated 90 degrees from the
horizontal. Is there way to put it in a normal reading position?
--
Wayne Watson (Watson Adventures, Prop., Nevada City, CA)
(121.015 Deg. W,
On 30-Apr-09, at 12:12 AM, Dave Crouse wrote:
Trying to print something with a { in it.
Probably extremely simple, but it's frustrating me. :(
print ('The \"This is a test \" {')
i get this error
ValueError: Single '{' encountered in format string
Worked perfectly for me.
===
$ python3.0
I got the same thing with idle, but when running as a script, it's not
the same, it errors. I tried it on Windows and Linux.
---
[da...@arch64 Python]$ less test.py
#/usr/bin/python3
print ('The \"This is a test \" {')
[da...@arch64 Python]$ sh test.py
tes
sudhanshu gautam wrote:
2.Now another file in which I want to extend that same parent class is here
.First code running successfully but in another one having problem
'This another source code will represent the new Entry of database'
import title
class Newstudent(Studentdatabase):
def
"David" wrote
I don't know how else to describe it, that is so cool :)
:-)
Couple of comments below.
import textwrap
data = {'CBUILD':None, 'CFLAGS':None, 'MAKEOPTS':None}
def get_use():
fname = open('/tmp/comprookie2000/emerge_info.txt')
for line in fname:
for keyphrase
Dave Crouse wrote:
I got the same thing with idle, but when running as a script, it's not
the same, it errors. I tried it on Windows and Linux.
---
[da...@arch64 Python]$ less test.py
#/usr/bin/python3
print ('The \"This is a test \" {')
[da...@arch64 Py
39 matches
Mail list logo