Oh! yes you can use re for that.
You just need to change the pattern a bit
I did not understand where the "title" will be so I have ignored it,
but I got something below which will be helpful for you
>>> value = """name:asasasasas\nrequest: play\ntitle"""
>>> reg = re.compile('Name:.*\\nrequest:.
Martin v. Löwis wrote:
> Christoph Zwerschke wrote:
>> I understand what you mean. But the Postgres dll provides no means to
>> fdopen a new stream.
>
> Right. So you must do so in the pygresql module. That means you have
> to get hold of msvcrt.dll's (sic) fdopen implementation.
>
> One way to d
H!,
Is it possible to get a value value ?
When I do this:
-
theXML = """
The Fascist Menace
"""
import xml.dom.minidom as dom
doc = dom.parseString(theXML)
print doc.getElementsByTagName('title')[0].toxml()
I get : The Fascist Menace thats
I had a somewhat similar problem that got solved with a line-based
state machine parser.
Cheers,
Elezar
=
Wiki Dictionary - Bosnian/Croatian/Serbian
http://izraz.com/%C4%8Cengi%C4%87_vila
--
http://mail.python.org/mailman/listinfo/python-list
Alex Martelli wrote:
> Fuzzyman <[EMAIL PROTECTED]> wrote:
>...
> > I can't open with a codec unless an encoding is explicitly supplied. I
> > still want to detect UTF16 even if the encoding isn't specified.
> >
> > As I said, I ought to test this... Without metadata I wonder how Python
> > d
Steve Holden wrote:
> It's just easier to have two permitted string quotes. That way, if your
> string has an apostrophe in it you can say
>
> s = "it's"
It's particularly handy if you are building strings of a language that
already has its own quotes, e.g. SQL or XML:
sql_snippet = " wher
Bryan Olson wrote:
> Alan Morgan wrote:
>
>> slogging_away wrote:
>>
>>> Hi - I'm running Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310
>>> 32 bit (Intel)] on win32, and have a script that makes numerous checks
>>> on text files, (configuration files), so discrepancies can be reported.
>>>
Alex, Michele and Skip,
Many thanks for your help, I should find my way by putting all these
information together.
Best regards,
Franck
--
http://mail.python.org/mailman/listinfo/python-list
Pierre Quentel wrote:
> This is because Python has a hidden mechanism to detect programs
> generated by Perl scripts, and make them crash with no explanation
>
KEYBOARD !
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.spl
S Borg wrote:
> Hello,
>
> I am running Python on Mac OS X. The interpreter has been great for
> learning the basics, but I would now like to be able to reuse code.
> How do I write reusable code? I have done it "The Java way": write
> the class, and save it to my home directory, then call it fr
Ed Singleton wrote:
> I'm a fairly average programmer (better than average compared to my
> immediate colleagues). I've read every tutorial I can get my hands
> on, but I have no _memory_ of ever coming across the del keyword, let
> alone that it is fundamental to Python, and I have no idea what
> sys.stdin.read() will return when ... the
> underyling read() call is aborted by a signal.
Not "return", really? Won't it just pass an exception? I thought that was what
I was catching with the "except IOError" part there? I assumed that
sys.stdin.read() would only return a value properly at
On Wed, 08 Feb 2006 13:58:13 +1100, Delaney, Timothy (Tim) wrote:
> adam johnson wrote:
>
>> Hi All.
>> I was wondering why defining a __call__ attribute for a module
>> doesn't make it actually callable.
>
> For the same reason that the following doesn't work
[snip example]
> The __call__ attr
Steven D'Aprano wrote:
> On Wed, 08 Feb 2006 13:58:13 +1100, Delaney, Timothy (Tim) wrote:
>
> > adam johnson wrote:
> >
> >> Hi All.
> >> I was wondering why defining a __call__ attribute for a module
> >> doesn't make it actually callable.
> >
> > For the same reason that the following doesn't w
Vinay Sajip:
>Rene Pijlman:
>> It struck me as somewhat complicated as well.
>You should look at later versions of Python - your points above about
>easier configuration have already been addressed: here's a link from
>the current (2.4) docs:
>
>http://docs.python.org/lib/minimal-example.html
Yes
Ed Singleton wrote:
> Is it obvious to a newbie what the difference between mappings and
> "not-mappings", and is it obvious exactly what is and isn't a mapping?
>
> Should it be necessary to "know" python before it becomes easy to use?
QOTW! (You are joking, aren't you? :)
I can undestand how p
"Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> Ian Ward wrote:
>> Any Ideas?
> I think there is one or more ncurses bugs somewhere.
indeed. It might be nice to report them rather than jawing about it.
> The ncurses documentation suggests that you should link with
> ncurses_w instead of linking
Ian Ward <[EMAIL PROTECTED]> wrote:
> I've had to work around many curses issues while developing Urwid (a
hmm - I've read Urwid, and most of the comments I've read in that regard
reflect problems in Urwid. Perhaps it's time for you to do a little analysis.
(looking forward to bug reports, rat
Alex Martelli wrote:
> Fuzzyman <[EMAIL PROTECTED]> wrote:
>...
> > > Open the file with 'rU' mode, and check the file object's newline
> > > attribute.
> >
Just to confirm, for a UTF16 encoded file, the newlines attribute is
``None``.
All the best,
Fuzzyman
http://www.voidspace.org.uk/pyth
Hi all,
unfotunately, 'commands.getstatusoutput(command)' does not work under
windows.
Would there be any alternative?
os.system also just provides the exit number I think.
thanks a lot,
and cheers
marco
--
calmar
(o_ It rocks: LINUX + Command-Line-Interface
//\
Tempo wrote:
> I was wondering if python is a good language to build a web crawler
> with? For example, to construct a program that will routinely search x
> amount of sites to check the availability of a product. Or to search
> for news articles containing the word 'XYZ'. These are just random
> i
Fuzzyman wrote:
> Steven D'Aprano wrote:
>
>>On Wed, 08 Feb 2006 13:58:13 +1100, Delaney, Timothy (Tim) wrote:
>>
>>
>>>adam johnson wrote:
>>>
>>>
Hi All.
I was wondering why defining a __call__ attribute for a module
doesn't make it actually callable.
>>>
>>>For the same reason that
Fuzzyman wrote:
> Alex Martelli wrote:
> > Fuzzyman <[EMAIL PROTECTED]> wrote:
> >...
> > > > Open the file with 'rU' mode, and check the file object's newline
> > > > attribute.
> > >
>
> Just to confirm, for a UTF16 encoded file, the newlines attribute is
> ``None``.
>
Hmmm... having read t
On 2/8/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> you seem to be missing that we're talking about a programming language
> here. nothing is obvious if you don't know anything about the language;
> a lot of things are obvious once you've learned a little about it. a little
> is
> all it takes
Steve Holden wrote:
> Fuzzyman wrote:
> > Steven D'Aprano wrote:
> >
> >>On Wed, 08 Feb 2006 13:58:13 +1100, Delaney, Timothy (Tim) wrote:
> >>
> >>
> >>>adam johnson wrote:
> >>>
> >>>
> Hi All.
> I was wondering why defining a __call__ attribute for a module
> doesn't make it actuall
Fuzzyman wrote:
> Steve Holden wrote:
[...]
>>
>>The pursuit of orthogonality, while admirable, can lead to insanity if
>>pushed too far.
>>
>
>
> Sure - feel free to venture as far down the road of insanity as you
> like :-) To pursue your analogy, why don't we answer all usenet posts
> by pushi
"Brian Blais" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello,
>
> I am including at the end of this document (is it better as an
attachment?) some code
> for a small gui dialog. Since I am quite new to this, if anyone has any
suggestions
> for improvements to the code, bad co
On 08/02/06, Magnus Lycka <[EMAIL PROTECTED]> wrote:
> Ed Singleton wrote:
> > I'm a fairly average programmer (better than average compared to my
> > immediate colleagues). I've read every tutorial I can get my hands
> > on, but I have no _memory_ of ever coming across the del keyword, let
> > a
just a few style notes...
> def checkOutBook(self, readerName):
> "'Remove book from the front of the list, block if no books are
> available'"
I don't understand what "' is supposed to imply. If you
meant to use triple quoting, you need to use ''' or """.
Then the string can contain
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Having read previous discussions on python-dev I think I'm not the only
> Python programmer who doesn't particularly like python's "self"
> parameter:
Ok, there might be five programmers and one imam. The imam does not like
anything mo
Hey there
I'm doing some threading in python with Python 2.3 and 2.4 on Ubuntu and
Debian machines, and I've noticed that if I open a lot of threads (say,
50), I get lots of python processes with individual PIDs, which consume a
disproportionate amount of CPU. Does this mean that Python is using t
Ed Singleton wrote:
> Having bricks that work in lots of places makes the language
> 'guessable'. "I've never cleared a list before, but I've cleared
> dictionaries and I guess the same way would work here".
f = open("foo")
f.clear()
sys.stdout.clear()
os.getcwd().clear()
shelve.clear()
s =
Robin Haswell wrote:
> Hey there
>
> I'm doing some threading in python with Python 2.3 and 2.4 on Ubuntu and
> Debian machines, and I've noticed that if I open a lot of threads (say,
> 50), I get lots of python processes with individual PIDs, which consume a
> disproportionate amount of CPU. Doe
mwt wrote:
> So in a further attempt to learn some Python, I've taken the little
> Library program
> (http://groups.google.com/group/comp.lang.python/browse_thread/thread/f6a9ccf1bc136f84)
> I wrote and added several features to it. Readers now quit when they've
> read all the books in the Library.
Magnus Lycka wrote:
> just a few style notes...
>
(snip)
>
> Why bother with L? The follwing is as clear I think, and solves
> the problem of commas in the title. Also, don't put a space between
> the callable and the parenthesis please. See the Python style guide,
> PEP 008.
>
> aut
Steve Holden wrote:
(snip)
> The pursuit of orthogonality, while admirable, can lead to insanity if
> pushed too far.
>
+1 QOTW
--
bruno desthuilliers
python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for
p in '[EMAIL PROTECTED]'.split('@')])"
--
http://mail.python.org/mailm
On 08/02/06, Magnus Lycka <[EMAIL PROTECTED]> wrote:
> Ed Singleton wrote:
> > Is it obvious to a newbie what the difference between mappings and
> > "not-mappings", and is it obvious exactly what is and isn't a mapping?
> >
> > Should it be necessary to "know" python before it becomes easy to use?
"But the point is, the current situation is not newbie-friendly (I can
tell, I am a newbie)"
I will agree to that, as I consider myself still new. _But_, it's a
stumbling stone only briefly. Get enough nagging error messages, and
you learn and move on. I agree with the grandparent poster that it i
Hello,
When working with file and dir info recursively on Windows XP. I'm going
about it like this:
for root, dirs, files in os.walk(path):
for f in files:
ADD F to dictionary
for d in dirs:
ADD D to dictionary
Is it possible to do something such as this:
for root,
Frithiof Andreas Jensen wrote:
> <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> Having read previous discussions on python-dev I think I'm not the only
>> Python programmer who doesn't particularly like python's "self"
>> parameter:
>
> Ok, there might be five programmers and one
On Wed, 08 Feb 2006 14:24:38 +0100, Diez B. Roggisch wrote:
> Robin Haswell wrote:
>
>> Hey there
>>
>> I'm doing some threading in python with Python 2.3 and 2.4 on Ubuntu and
>> Debian machines, and I've noticed that if I open a lot of threads (say,
>> 50), I get lots of python processes with
Duncan Booth wrote:
> How about just concatentating the two lists:
>
>>for root, dirs, files in os.walk(path):
>for fs_object in files + dirs:
>> ADD fs_object to dictionary
Thank you Duncan! that solves the problem perfectly!
--
http://mail.python.org/mailman/listinfo/python-li
Thank you everyone for your helpful replies!
I think the problems that arise with nested and overly large lists and
dictionaries, and difficulties of handling other mutable datatypes will
make my little assignment just too difficult. I'll just specify that
call-by-reference isn't supported and lea
Steve Holden <[EMAIL PROTECTED]> wrote:
>Huy wrote:
>> I've been unable to find information clarifying this but. What is the
>> difference between 'somestring' and "somestring"?
>It's just easier to have two permitted string quotes. That way, if your
>string has an apostrophe in it you can say
>
Thanks for the help so far.
There are two Python applications involved, one runs on a remote PC
(server) and another on the users PC (client).
The server at present merely receives and sends out messages via an
instant messaging platform. Based on the information it receives via
the IM platform i
rtilley wrote:
> Hello,
>
> When working with file and dir info recursively on Windows XP. I'm going
> about it like this:
>
> for root, dirs, files in os.walk(path):
> for f in files:
> ADD F to dictionary
> for d in dirs:
> ADD D to dictionary
>
> Is it possible to do
rtilley wrote:
> Just to clarify. In this particular case, I do not need to differentiate
> between files and dirs... so would it be possible to do something such
> as this:
>
How about just concatentating the two lists:
> for root, dirs, files in os.walk(path):
> for fs_object in files,
bruno at modulix wrote:
[...]
> Suppose you have to match a line against a list of regexp and log if it
> doesn't match. You could of course repeat the whole code for each
> regexp, ie:
>
> if not re.match(r'a/regexp/here', line):
> log('a first message')
>
> if not re.match(r'another/regexp/her
Kirk McDonald wrote:
> I think it's perfectly consistent:
>
> >>> class B(object):
> ... def bar(self): pass
> ...
> >>> B.bar
>
> >>> type(B.bar)
>
> >>> b = B()
> >>> b.bar
> >
> >>> type(b.bar)
>
> >>> id(B.bar)
> -1211888788
> >>> id(b.bar)
> -1211888788
>
> It's the same func
Op 2006-02-08, Steve Holden schreef <[EMAIL PROTECTED]>:
> Fuzzyman wrote:
>> Steve Holden wrote:
> [...]
>>>
>>>The pursuit of orthogonality, while admirable, can lead to insanity if
>>>pushed too far.
>>>
>>
>>
>> Sure - feel free to venture as far down the road of insanity as you
>> like :-) T
[EMAIL PROTECTED] wrote:
> H!,
>
> Is it possible to get a value value ?
>
> When I do this:
> -
> theXML = """
> The Fascist Menace
> """
> import xml.dom.minidom as dom
> doc = dom.parseString(theXML)
> print doc.getElementsByTagName('title
Hello, i wanna know how to communicate my python program with my
winmodem on PC...thanks!!!
--
http://mail.python.org/mailman/listinfo/python-list
Op 2006-02-08, Steve Holden schreef <[EMAIL PROTECTED]>:
>
> Why should a module be callable? What's the advantage? Should we be able
> to add two modules together, yielding a module that contains all the
> code of both modules? What happens if I multiply a module by two -
> presumably the resul
I'm newbie with that xml stuff.
The only thing I must read is the response I get from a EPP server.
A response like this:
http://www.eurid.eu/xml/epp/epp-1.0";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:contact="http://www.eurid.eu/xml/epp/contact-1.0";
xmlns:domain="http://www
What editor shall I use if my Python script must contain utf-8
characters?
I use XP
Thank you for reply
l.b.
--
http://mail.python.org/mailman/listinfo/python-list
mwt <[EMAIL PROTECTED]> wrote:
>while len(self.stacks) == 0:
To (kind of) repeat myself, the idiomatic Python would be:
while not self.stacks:
An empty list is considered to be false, hence testing the list
itself is the same as testing len(l) > 0 .
As someone else has noticed,
Hi.
I would like to know if there's any todo list on python project.
My interest in doing a undergraduate project.
It could be anything in the python core interpreter. I program C/C++.
Thanks in advance.
Regards.
Joao Macaiba (wavefunction)
--
http://mail.python.org/mailman/listinfo/python-l
> What editor shall I use if my Python script must contain utf-8
> characters?
> I use XP
vim :-)
> Thank you for reply
> l.b.
not for all :-)
--
http://mail.python.org/mailman/listinfo/python-list
is vim for XP?
--
http://mail.python.org/mailman/listinfo/python-list
You should give a go to os.popen( ). Article
6.1.2 and 6.1.3 in the Python Library doc.
I recently wrote a program that would create a pipe using the popen()
method, and would enter a while loop. At each iteration, it would read
one line of the pipe output, and the loop would break when it gets a
Ok,
I give up. DRY = Don't Repeat Yourself (google Pragmatic Programmers)
but SPOT? Google is little help here, SPOT is too common a word.
Thanks!
--
http://mail.python.org/mailman/listinfo/python-list
Kent Johnson wrote:
> Kirk McDonald wrote:
...
>> >>> id(B.bar)
>> -1211888788
>> >>> id(b.bar)
>> -1211888788
>>
>> It's the same function, whether it's bound or not
>
> No, it's not the same function. You got the same id because you didn't
> bind B.bar and b.bar to anything so the id was
I did not find where I can set encoding type in vim
--
http://mail.python.org/mailman/listinfo/python-list
Magnus Lycka wrote:
>... I sometimes come across things that I once new but had forgotten.
I'm sorry, and I mean no offense, _but_ I think _new_ there is a
lovely typo. :-) I stopped, corrected it in my head, proceeded,
and then I backed up, put it back and laughed out loud.
--Scott David Daniel
Steven D'Aprano wrote:
> On Wed, 08 Feb 2006 13:58:13 +1100, Delaney, Timothy (Tim) wrote:
>
>> adam johnson wrote:
>>
>>> Hi All.
>>> I was wondering why defining a __call__ attribute for a module
>>> doesn't make it actually callable.
>> For the same reason that the following doesn't work
> [sn
Thank you for all your help; it makes perfect sense now.
--
http://mail.python.org/mailman/listinfo/python-list
Hi, I'm new to Python, and GUI development, but am no novice to backend
programming. Aside from mastering the standard language, I will
eventually be developing applications dealing with images and controls.
Thus forth I have been testing out PyGTK & it appears to be quite
robust (that and I like
Joao Macaiba <[EMAIL PROTECTED]> wrote:
> Hi.
>
> I would like to know if there's any todo list on python project.
>
> My interest in doing a undergraduate project.
>
> It could be anything in the python core interpreter. I program C/C++.
The PEP index shows several PEPs approved but not imple
http://www.pspad.com/en/
Petr Jakes
--
http://mail.python.org/mailman/listinfo/python-list
Robin Haswell <[EMAIL PROTECTED]> wrote:
...
> Cheers for that info. The thread's main tasks are getting webpages
> (spidering), the actual amount of processing done in each thread is
> minimal - that's why I'm confused by the CPU usage.
BTW, spidering is a great use case for async (even-driven
[Mark Fink]
> I wrote a Jython class that inherits from a Java class and (thats the
> plan) overrides one method. Everything should stay the same.
>
> If I run this nothing happens whereas if I run the Java class it says:
> usage: java fit.FitServer [-v] host port socketTicket
> -v ver
On 2006-02-08, Ian Ward <[EMAIL PROTECTED]> wrote:
> I think there are enough escape sequences common to all modern terminals
> so that I can build a generic curses-replacement for my library.
Why not use termcap/terminfo?
--
Grant Edwards grante Yow! Where does
On 2/8/06, Alex Martelli <[EMAIL PROTECTED]> wrote:
>
> Bot? me? did I fail a Turing test again without even noticing?!
If you'd noticed the test, you'd have passed.
;-)
--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
--
http://mail.python.org/mailman/listinfo/p
I use it on XPvisit http://www.vim.org/download.php , and scroll
down to the Windows section.
--Brian
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> On Behalf Of Lad
> Sent: Wednesday, February 08, 2006 10:08
> To: python-list@python.org
> Subject: Re:
Thanks for your response. I'll try to install all the same versions that you
have.
I have removed my version of Python and installed ActivePython
(ActivePython-2.4.2.10-win32-x86.msi).
Could you please tell me which versions of the following you have installed:
NumPy
SciPy
RPy
R
I have not ins
[...]
>> It's the same function, whether it's bound or not. Thus, it should
>> always have the same type.
>
>
> No, it's not the same function. You got the same id because you didn't
> bind B.bar and b.bar to anything so the id was reused.
thank you for the explanation
it's indeed tricky wit
A slim lady in a brown overcoat appears and says with a silly
French accent: "Lizten very carefully, I vill zay ziz only onze."
BTW, I happen to reply to Ed's post now, but I'm really responding
to a fairly common attitude which I find somewhat counterproductive.
I hope people are openminded and a
Magnus Lycka <[EMAIL PROTECTED]> wrote:
...
> I dunno, but there are these two guys, Sergey Brin and Lawrence Page,
> who wrote a web crawler in Python. As far as I understood, they were
> fairly successful with it. I think they called their system Koogle,
> Bugle, or Gobble or something like th
ElementTree's XML serialization routine implied by tree._write(file,
node, encoding, namespaces looks like this (elided):
def _write(self, file, node, encoding, namespaces):
# write XML to file
tag = node.tag
if tag is Comment:
file.write("" % _escape_
On 2006-02-08, Joel Hedlund <[EMAIL PROTECTED]> wrote:
>> sys.stdin.read() will return when ... the
>> underyling read() call is aborted by a signal.
>
> Not "return", really?
Yes, really. On a SIGWINCH, the read() will _either_ return
currently buffered data or thrown an IOError exception. You
Robin Haswell wrote:
> Hey there
>
> I'm doing some threading in python with Python 2.3 and 2.4 on Ubuntu and
> Debian machines, and I've noticed that if I open a lot of threads (say,
> 50), I get lots of python processes with individual PIDs, which consume a
> disproportionate amount of CPU. Does
I am new in using Python
Anyone know how to implement breadth first search using Python? Can Python
create list dynamically, I want to implement a program which will read data
from a file and store each line into a list, is this possible?
Please send mail to me at [EMAIL PROTECTED] or reply this
Lad wrote:
> I did not find where I can set encoding type in vim
Google is your friend.
http://vim.sourceforge.net/scripts/script.php?script_id=789
http://www.vim.org/tips/tip.php?tip_id=246
http://www.vim.org/htmldoc/mbyte.html
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Ok,
>
> I give up. DRY = Don't Repeat Yourself (google Pragmatic Programmers)
> but SPOT? Google is little help here, SPOT is too common a word.
The only SPOT I worked with (as I know of) was SPOT4
(Le Systeme Pour 'l Observation de la Terre) but that's
probably not it
News wrote:
> I am new in using Python
>
> Anyone know how to implement breadth first search using Python?
Breadth-first search of what? It depends what kind of tree you're
searching, but here's a page with a few implementations:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/231503
Thomas Dickey wrote:
> hmm - I've read Urwid, and most of the comments I've read in that regard
> reflect problems in Urwid. Perhaps it's time for you to do a little analysis.
>
> (looking forward to bug reports, rather than line noise)
A fair request. My appologies for the inflammatory subject
Can custom __setattr__ methods and properties be mixed in new style
classes?
I experimented with a new style class with both a custom __setattr__
method and a property. Attributes controlled by the __setattr__ method
work fine. When I attempt to set or get the property it raises the
error: "TypeEr
I'm am relatively new to Python but use it daily. Today, I went looking
for a function, like PHP's number_function, that will take a number and
return a string with number formatted with grouped thousands and the
decimal portion rounded to a given number of places. This is certainly
needed wh
> Anyone know how to implement breadth first search using Python?
Yes. Granted, for more details, you'd have to describe the data
structure you're trying to navigate breadth-first.
> Can Python create list dynamically
Is Perl write-only?
Does Lisp use too many parens?
Of course! :)
Not only
I see the error: the get and set properties are inverted. Now it works.
--
http://mail.python.org/mailman/listinfo/python-list
Chris McDonough wrote:
>> Can Python
>> create list dynamically, I want to implement a program which will read
>> data from a file and store each line into a list, is this possible?
>
> L = []
> [L.append(line) for line in (open('filename.txt')]
Why would you create two lists, one filled only wi
Chris McDonough wrote:
> L = []
> [L.append(line) for line in (open('filename.txt')]
Ouch.
Did you perhaps mean:
L = [ line for line in open('filename.txt') ]
Or, with better error handling:
try:
f = open('filename.txt')
except IOError:
# handle error here
else:
L = [ line for lin
Diez B. Roggisch <[EMAIL PROTECTED]> wrote:
>> channel = orb.getRootInterface(channelname)
>> chadmin = channel.for_consumers()
>> supplier = chadmin.obtain_push_supplier()
>> listener = EventListener()
>> supplier.connect_push_consumer(listener)
>
> Not sure, but I guess you want a
>
> listener
Chris McDonough wrote:
> News wrote:
>... Can Python
>> create list dynamically, I want to implement a program which will read
>> data
>> from a file and store each line into a list, is this possible?
>
> L = []
> [L.append(line) for line in (open('filename.txt')]
>
> - C
Woops, crossed wires
>> Nir Aides wrote:
>>> Is there a solution or a work around for the sys.path problem with
>>> unicode folder names on Windows XP?
>>>
>>> I need to be able to import modules from a folder with a non-ascii name.
> Martin v. Löwis wrote:
>> If the name is restricted to the CP_ACP code page (i.e.
"L.C. Rees" wrote:
> This is the code for the property at the end of the class definition:
>
> def _settext(self, txt):
> self._tree.text = txt
>
> def _gettext(self, txt):
> return self._tree.text
>
> def _deltext(self, txt):
> self._tree.text = ''
>
> text
I'm looking for a way to send a simple, plain text email message
using Python. My initial attempts are failing with the following error:
socket.error: (61, 'Connection refused')
Does this imply that I do not have the machine's smtp server
running? (I don't; and I'd like to avoid se
L.C. Rees wrote:
> Can custom __setattr__ methods and properties be mixed in new style
> classes?
>
> I experimented with a new style class with both a custom __setattr__
> method and a property. Attributes controlled by the __setattr__ method
> work fine. When I attempt to set or get the property
Peter Otten wrote:
> Chris McDonough wrote:
>
>>> Can Python
>>> create list dynamically, I want to implement a program which will read
>>> data from a file and store each line into a list, is this possible?
>> L = []
>> [L.append(line) for line in (open('filename.txt')]
>
> Why would you create
pdt wrote:
> Hello, i wanna know how to communicate my python program with my
> winmodem on PC...thanks!!!
Use pyserial.
Diez
--
http://mail.python.org/mailman/listinfo/python-list
1 - 100 of 219 matches
Mail list logo