From: [EMAIL PROTECTED] on behalf of Wijaya Edward
Sent: Thu 10/26/2006 11:47 PM
To: python-list@python.org
Subject: Slurping All Content of a File into a Variable
Hi,
How can we slurp content of a single file
into one variable?
I tried this:
>>> myfile_
Hi,
How can we slurp content of a single file
into one variable?
I tried this:
>>> myfile_content = open('somefile.txt')
>>> print myfile_content,
>>>
But it doesn't print the content of the file.
Regards,
-- Edward WIJAYA
SINGAPORE
Institute For Infocomm Research - Dis
Robert Kern wrote:
> George Sakkis wrote:
> > ImportError:
> > /usr/local/lib/python2.4/site-packages/numpy/linalg/lapack_lite.so:
> > undefined symbol: zheevd_
> >
> > Googling for "undefined symbol: zheevd_" returned no hits, at which
> > point I gave up for now; hopefully someone will have a su
On 10/27/06, Cameron Walsh <[EMAIL PROTECTED]> wrote:
> limodou wrote:
> > On 10/27/06, Wijaya Edward <[EMAIL PROTECTED]> wrote:
> >>
> >> Thanks but my intention is to strictly use regex.
> >> Since there are separator I need to include as delimiter
> >> Especially for the case like this:
> >>
> >
Ivan Vinogradov wrote:
> Dear All,
>
> I would greatly appreciate a nudge in the right direction concerning
> the use of cwd argument in the call function from subprocess module.
>
> The setup is as follows:
>
> driver.py <- python script
> core/ <- directory
>
[EMAIL PROTECTED] wrote:
> I am a beginner of programming and started to learn Python a week ago.
> last 3 days, i write this little tool for Renju.if you have any advice
> on my code,please tell me
> s = ''
>
> for i in range (0,len(done) - 1):
> s = s +str(done[i][0]) + str(done
Hi Steve,
The output is as the following (excluding the "---start---" and
"---end---"):
---start---
die now
Traceback (most recent call last):
File "../../../scratch/python/tmp.py", line 39, in ?
channel, details = server.accept()
File "/usr/lib/python2.4/socket.py", line 169, in accept
Wijaya Edward wrote:
> Since there are separator I need to include as delimiter
> Especially for the case like this:
>
str = '\xc5\xeb\xc7\xd5\xbc--FOO--BAR'
field = list(str)
print field
> ['\xc5', '\xeb', '\xc7', '\xd5', '\xbc', '-', '-', 'F', 'O', 'O', '-', '-',
> 'B', 'A', 'R'
Michael Ströder wrote:
> John Nagle wrote:
>
>>The Python SSL object offers two methods from obtaining
>>the info from an SSL certificate, "server()" and "issuer()".
>>The actual values in the certificate are a series of name/value
>>pairs in ASN.1 binary format. But what "server()" and "issu
[EMAIL PROTECTED] wrote:
> Dennis Lee Bieber wrote:
>> On Fri, 27 Oct 2006 03:48:25 GMT, Michael Naunton
>> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>>
>>> This may seem pendantic, but CS is mostly about thinking about (and thus
>> Someday I should arrange to do a lost
Robert Kern wrote:
> George Sakkis wrote:
>> By the way, it would be great if numpy's mailing list was mirrored to a
>> google group; sourceforge and gmane are just horrible to use.
>
> Sorry, I don't think that Google Groups does mirroring like GMane does.
Never mind.
http://groups.google.c
limodou wrote:
> On 10/27/06, Wijaya Edward <[EMAIL PROTECTED]> wrote:
>>
>> Thanks but my intention is to strictly use regex.
>> Since there are separator I need to include as delimiter
>> Especially for the case like this:
>>
>> >>> str = '\xc5\xeb\xc7\xd5\xbc--FOO--BAR'
>> >>> field = list(str)
George Sakkis wrote:
> ImportError:
> /usr/local/lib/python2.4/site-packages/numpy/linalg/lapack_lite.so:
> undefined symbol: zheevd_
>
> Googling for "undefined symbol: zheevd_" returned no hits, at which
> point I gave up for now; hopefully someone will have a suggestion on
> what to do next (ot
Ben Finney wrote:
> Apparently that learning also didn't include the prohibitions against
> colluding with others. Nevertheless, I'll bet they are still present.
http://www.csu.edu.au/acad_sec/manuals/gcontm.htm
Part G6
Collusion
A student colludes when he or she works without
mumebuhi wrote:
> I am having problem to kill the following script completely. The script
> basically does the following. The main thread creates a new thread,
> which does a completely useless thing, and then starts excepting for a
> connection via socket.
>
> # start
> import pickle
> import sig
Travis E. Oliphant wrote:
> We are very pleased to announce the release of NumPy 1.0 available for
> download at http://www.numpy.org
Congratulations for this great package and the tremendous effort that
was put on it! Hopefully with this release, the 'array wars' are over;
we may not be able to a
I am having problem to kill the following script completely. The script
basically does the following. The main thread creates a new thread,
which does a completely useless thing, and then starts excepting for a
connection via socket.
# start
import pickle
import signal
import simplejson
import soc
"Paddy" <[EMAIL PROTECTED]> writes:
> None is what Python readers would expect as a sentinel value, but if
> any of your data fields could have None as a valid value then you may
> have to switch to a module level constant.
> Be wary of using sentinel values which are strings, if your data could
>
Dennis Lee Bieber wrote:
> On Fri, 27 Oct 2006 03:48:25 GMT, Michael Naunton
> <[EMAIL PROTECTED]> declaimed the following in comp.lang.python:
>
> >
> > This may seem pendantic, but CS is mostly about thinking about (and thus
>
>Someday I should arrange to do a lost-wax casting of a
> /pe
On 10/27/06, Wijaya Edward <[EMAIL PROTECTED]> wrote:
>
> Thanks but my intention is to strictly use regex.
> Since there are separator I need to include as delimiter
> Especially for the case like this:
>
> >>> str = '\xc5\xeb\xc7\xd5\xbc--FOO--BAR'
> >>> field = list(str)
> >>> print field
> ['\x
"Michael B. Trausch" <"mike$#at^&nospam!%trauschus"> wrote:
> Basically, is there something that will log every line of Python code
> executed, in its order of execution, to a text file so that I can see
> what is (or isn't) happening that I am expecting?
Python itself can do this for you. A __VE
Thanks but my intention is to strictly use regex.
Since there are separator I need to include as delimiter
Especially for the case like this:
>>> str = '\xc5\xeb\xc7\xd5\xbc--FOO--BAR'
>>> field = list(str)
>>> print field
['\xc5', '\xeb', '\xc7', '\xd5', '\xbc', '-', '-', 'F', 'O', 'O', '-', '-'
DataSmash wrote:
> Hello,
> I need to search and replace 4 words in a text file.
> Below is my attempt at it, but this code appends
> a copy of the text file within itself 4 times.
> Can someone help me out.
> Thanks!
>
> # Search & Replace
> file = open("text.txt", "r")
> text = file.read()
> fil
Ben Finney wrote:
> Howdy all,
>
> Ned Batchelder blogged[0] about a debate over checking function
> parameters, and to what extent dynamic typing should be relied upon.
>
> I was one of many who commented, but I wrote what purports to be a
> comprehensive checklist when considering special-case in
Wijaya Edward wrote:
> Hi all,
>
> I was trying to split a string that
> represent chinese characters below:
>
>
str = '\xc5\xeb\xc7\xd5\xbc'
print str2,
> ???
fields2 = split(r'\\',str)
print fields2,
> ['\xc5\xeb\xc7\xd5\xbc']
>
> But why the split function here doesn't
Wijaya Edward wrote:
> Hi,
>
> How can we slurp all content of a single file
> into one variable?
>
> I tried this:
>
myfile_content = open('somefile.txt')
print myfile_content,
>
>
>
> But it doesn't print the content of the file.
>>> help(open)
Help on built-in function ope
Robert Kern wrote:
> Ben Finney wrote:
>
> > Would it make sense to *define* a truth value for iterators? Or at
> > least to enable those that *are* able to say "I'm empty" to do so in a
> > way that boolean contexts can interpret as "false"?
> >
> > Perhaps allowing (but not requiring) an iterato
-- Forwarded message --
From: limodou <[EMAIL PROTECTED]>
Date: Oct 27, 2006 11:51 AM
Subject: Re: How to Split Chinese Character with backslash representation?
To: Wijaya Edward <[EMAIL PROTECTED]>
On 10/27/06, Wijaya Edward <[EMAIL PROTECTED]> wrote:
>
> Hi all,
>
> I was trying
On 26 Oct 2006 02:27:16 -0700, Arun Nair <[EMAIL PROTECTED]> wrote:
It is clear your professor does not understand computer science. Switch
to a new university now.
As noted in the problem, a deck has 52 cards. cardsLeft(self) therefore
always returns 52.
This may seem pendantic, but CS is
Ben Finney wrote:
> "Carl Banks" <[EMAIL PROTECTED]> writes:
>
> > An iterator is not a sequence, and it's impossible to determine
> > whether an iterator is "empty" in general, except by trying to get
> > an item from it. [...]
> >
> > IMO, this is big time wart in the language. Iterators have n
Hi all,
I was trying to split a string that
represent chinese characters below:
>>> str = '\xc5\xeb\xc7\xd5\xbc'
>>> print str2,
???
>>> fields2 = split(r'\\',str)
>>> print fields2,
['\xc5\xeb\xc7\xd5\xbc']
But why the split function here doesn't seem
to do the job for obtaining the desire
It does not look nice at all, mainly because you are asking either asking the
question upside down, or not providing enough information.
If a and b are of vastly different sizes, say so. Otherwise, think about your
algorithm, and realize you are asking for things in b if they exist in a:
> dict
Ben Finney wrote:
> Would it make sense to *define* a truth value for iterators? Or at
> least to enable those that *are* able to say "I'm empty" to do so in a
> way that boolean contexts can interpret as "false"?
>
> Perhaps allowing (but not requiring) an iterator object to grow a
> 'len' metho
Ivan Vinogradov wrote:
> Dear All,
>
> I would greatly appreciate a nudge in the right direction concerning
> the use of cwd argument in the call function from subprocess module.
>
> The setup is as follows:
>
> driver.py <- python script
> core/ <- directory
>
Steven Bethard wrote:
>
> As you noted, you'll get an error if you try to concatenate B as a set
> to the list.
>
> Steve
Whoops, remind me to check things work before I type them. In the mean
time, here are some more interesting timing results:
With a larger data set, 500 elements instead o
"Carl Banks" <[EMAIL PROTECTED]> writes:
> An iterator is not a sequence, and it's impossible to determine
> whether an iterator is "empty" in general, except by trying to get
> an item from it. [...]
>
> IMO, this is big time wart in the language. Iterators have no
> calculatable truth value; fo
Ben Finney wrote:
> Gabriel Genellina <[EMAIL PROTECTED]> writes:
>
> > At Wednesday 25/10/2006 23:29, Paul Rubin wrote:
> > >Steve Holden <[EMAIL PROTECTED]> writes:
> > >I get that iter(()) is True (Python 2.3.4).
> >
> > It's False on 2.4.2 - and perhaps it's what one would expect, but
> > since
Jean-Paul Calderone <[EMAIL PROTECTED]> writes:
> 1) Write unit tests for your code. Keep writing unit tests until
> you have some that _don't pass_. Then fix your code so that they
> do. When you do further development, write the tests first, then
> implement the code that makes them pass.
He
Ben Finney <[EMAIL PROTECTED]> writes:
> The 'read' method of the resulting file object will return the
> contents of the file. You may also want to read the documentation of
> thile objects to see what else you can do with them.
And ith you couldn't underthtand my thpeetch impediment, I meanth
"
"Peter Decker" <[EMAIL PROTECTED]> writes:
> On 10/26/06, Ben Finney <[EMAIL PROTECTED]> wrote:
> > There is always the option to not send messages to this list using
> > that mail server. I don't care what option is taken, so long as
> > the useless and obnoxious headers on his messages stop.
> >
Wijaya Edward <[EMAIL PROTECTED]> writes:
> >>> myfile_content = open('somefile.txt')
> >>> print myfile_content,
>
> >>>
>
> But it doesn't print the content of the file.
That's right, because "the content of the file" is not what open() is
documented to return; it is documented as returning a
On Thu, 26 Oct 2006 21:52:42 -0400, "Michael B. Trausch" wrote:
>Alright, I seem to be at a loss for what I am looking for, and I am not
>even really all that sure if it is possible or not. I found the 'pdb'
>debugger, but I was wondering if there was something that would trace or
>log the order
Wijaya Edward wrote:
> Hi,
>
> How can we slurp all content of a single file
> into one variable?
>
> I tried this:
>
>
myfile_content = open('somefile.txt')
print myfile_content,
>
>
>
>
>
> But it doesn't print the content of the file.
>
Because you haven't read it!
data
Alright, I seem to be at a loss for what I am looking for, and I am not
even really all that sure if it is possible or not. I found the 'pdb'
debugger, but I was wondering if there was something that would trace or
log the order of line execution for a multi-module Python program. I am
having a l
On 2006-10-27, Wijaya Edward <[EMAIL PROTECTED]> wrote:
> How can we slurp all content of a single file
> into one variable?
http://docs.python.org/tut/node9.html#SECTION00920
I suggest you read the rest of the tutorial as well.
--
Grant Edwards grante
Hi,
How can we slurp all content of a single file
into one variable?
I tried this:
>>> myfile_content = open('somefile.txt')
>>> print myfile_content,
>>>
But it doesn't print the content of the file.
Regards,
-- Edward WIJAYA
SINGAPORE
Institute For Infocomm Research -
On 10/26/06, Ben Finney <[EMAIL PROTECTED]> wrote:
> > I agree it's a pain, but Fulvio may not have it in his power to
> > switch the header off. Mail admins do some incredibly stupid things.
>
> There is always the option to not send messages to this list using
> that mail server. I don't care wh
Howdy all,
Ned Batchelder blogged[0] about a debate over checking function
parameters, and to what extent dynamic typing should be relied upon.
I was one of many who commented, but I wrote what purports to be a
comprehensive checklist when considering special-case inputs for
functions. I thought
Patch / Bug Summary
___
Patches : 434 open ( +3) / 3430 closed ( +5) / 3864 total ( +8)
Bugs: 929 open (+13) / 6285 closed (+12) / 7214 total (+25)
RFE : 245 open ( +1) / 240 closed ( +0) / 485 total ( +1)
New / Reopened Patches
__
various d
Ben Finney wrote:
> Gabriel Genellina <[EMAIL PROTECTED]> writes:
>
>
>>At Wednesday 25/10/2006 23:29, Paul Rubin wrote:
>>
>>>Steve Holden <[EMAIL PROTECTED]> writes:
>>>I get that iter(()) is True (Python 2.3.4).
>>
No I didn't - that was Paul Rubin.
>>It's False on 2.4.2 - and perhaps it's wh
I just meant that I was going to bed and didn't have time to do it the
same night. I'll see if I can make it work, use it forever . . . I'll
do it.
--
http://mail.python.org/mailman/listinfo/python-list
What I mean was that it was late and I needed sleep. I'll work with
Vim, but it's not like I can spend a week learning it anyway, I don't
have that much time AND time to actualy program. And thanks all to have
posted suggestions and comments thus far.
--
http://mail.python.org/mailman/listinfo/py
robert wrote:
> in Gnuplot (Gnuplot.utils) the input array will be converted to a Numeric
> float array as shown below. When I insert a numpy array into Gnuplot like
> that below, numbers 7.44 are cast to 7.0
> Why is this and what should I do ? Is this bug in numpy or in Numeric?
>
>
> [Dbg]>
Klaas wrote:
> Michael B. Trausch wrote:
>> Is there a way to debug scripts that cause segmentation faults? I can
>> do a backtrace in gdb on Python, but that doesn't really help me all
>> that much since, well, it has nothing to do with my script... :-P
>
> Yes. If you think it is a python inte
At Thursday 26/10/2006 19:57, Ben Finney wrote:
Gabriel Genellina <[EMAIL PROTECTED]> writes:
> At Wednesday 25/10/2006 23:29, Paul Rubin wrote:
> >Steve Holden <[EMAIL PROTECTED]> writes:
> >I get that iter(()) is True (Python 2.3.4).
>
> It's False on 2.4.2 - and perhaps it's what one would ex
Harry George <[EMAIL PROTECTED]> writes:
> John Salerno <[EMAIL PROTECTED]> writes:
> > Yeah, it was all the customizing that I could never figure out.
>
> years ago this worked for people I was supporting:
> set softtabstop=4 shiftwidth=4 expandtab
That's all I've ever needed vim to do with my
Gabriel Genellina <[EMAIL PROTECTED]> writes:
> At Wednesday 25/10/2006 23:29, Paul Rubin wrote:
> >Steve Holden <[EMAIL PROTECTED]> writes:
> >I get that iter(()) is True (Python 2.3.4).
>
> It's False on 2.4.2 - and perhaps it's what one would expect, but
> since this behavior is not documented
Bruno Desthuilliers <[EMAIL PROTECTED]> writes:
> Arun Nair wrote:
> > [more homework assignments, not working]
> Do you really expect us to run your code, fix the bugs and send it
> back?
Yes, he apparently does. He's told us that it's homework, but that he
hasn't learned enough from his teacher
Steve Holden <[EMAIL PROTECTED]> writes:
> Please stop sending messages with obnoxious content like this.
Yes, I guess I should have expected a response like that from someone
:-)
> If you insist on telling someone off publicly via a newsgroup, once
> is enough.
Apparently not. I tried initiall
Dear All,
I would greatly appreciate a nudge in the right direction concerning
the use of cwd argument in the call function from subprocess module.
The setup is as follows:
driver.py <- python script
core/ <- directory
main<- fortran executab
robert a écrit :
(snip)
> class MemoCache(dict): # cache expensive Objects during a session
> (memory only)
>def memo(self, k, f):
>try: return self[k]
>except IndexError:
>return self.setdefault(k, f())
> cache=MemoCache()
> ...
>
> o = cache.memo( complex-key-exp
DataSmash a écrit :
> Hello,
> I need to search and replace 4 words in a text file.
> Below is my attempt at it, but this code appends
> a copy of the text file within itself 4 times.
> Can someone help me out.
> Thanks!
>
> # Search & Replace
> file = open("text.txt", "r")
NB : avoid using 'file'
robert wrote:
> in Gnuplot (Gnuplot.utils) the input array will be converted to a Numeric
> float array as shown below. When I insert a numpy array into Gnuplot like
> that below, numbers 7.44 are cast to 7.0
> Why is this and what should I do ? Is this bug in numpy or in Numeric?
>
>
> [Dbg]>
In <[EMAIL PROTECTED]>, DataSmash
wrote:
> I need to search and replace 4 words in a text file.
> Below is my attempt at it, but this code appends
> a copy of the text file within itself 4 times.
Because you `write()` the whole text four times to the file. Make the 4
replacements first and rebin
> Below is my attempt at it, but this code appends
> a copy of the text file within itself 4 times.
> Can someone help me out.
[snip]
> file = open("text.txt", "w")
> file.write(text.replace("Left_RefAddr", "FromLeft"))
> file.write(text.replace("Left_NonRefAddr", "ToLeft"))
> file.write(text.repla
On 2006-10-24 02:58:56 +0200, "Michael B. Trausch"
<"mike$#at^&nospam!%trauschus"> said:
> Is there a way to debug scripts that cause segmentation faults? I can
> do a backtrace in gdb on Python, but that doesn't really help me all
> that much since, well, it has nothing to do with my script...
Hello,
I need to search and replace 4 words in a text file.
Below is my attempt at it, but this code appends
a copy of the text file within itself 4 times.
Can someone help me out.
Thanks!
# Search & Replace
file = open("text.txt", "r")
text = file.read()
file.close()
file = open("text.txt", "w")
Michael B. Trausch wrote:
> Not really über-qualified to say anything, but I think that the
> following would be better:
>
> try:
> f = open('file.sql')
> script = f.read()
> f.close()
> except IOError:
> wx.MessageBox('Message', 'Message Title')
>
>> Do they both do the
John Salerno wrote:
> robert wrote:
>> Robin Dunn wrote:
>>> Announcing
>>> --
>>>
>>> The 2.7.1.3 release of wxPython is now available for download at
>>> http://wxpython.org/download.php. This release is a yet another
>>> quick-turnaround bugfix release designed to solve some problems, p
At Thursday 26/10/2006 09:39, [EMAIL PROTECTED] wrote:
def openfile():
global mark
global step
global done
global interator
global mainname
global beensaved
Too many globals for my taste...
--
Gabriel Genellina
Softlab SRL
__
robert wrote:
> Robin Dunn wrote:
>> Announcing
>> --
>>
>> The 2.7.1.3 release of wxPython is now available for download at
>> http://wxpython.org/download.php. This release is a yet another
>> quick-turnaround bugfix release designed to solve some problems, plust
>> some minor enhancemen
Chelonian wrote:
> [EMAIL PROTECTED] wrote:
>> I am a beginner of programming and started to learn Python a week ago.
>> last 3 days, i write this little tool for Renju...
>
> Tell you what, I will trade you my fluent English for your ability to
> write that in 3 days as a beginning programmer who
I am trying to compile Python 2.5 on AIX 5.3. I used
export PATH=/usr/bin:/usr/vacpp/bin
OPT=-O2 ./configure --with-gcc="xlc_r -q64" --with-cxx="xlC_r -q64"
--disable-ipv6 AR="ar -X64"
make
The following error stops make in its track:
building '_locale' extension
./Modules/ld_so_aix xlc_r -q64
Fredrik Lundh wrote:
> This wasn't very difficult, was it?
Well when you put it that way, no! :)
But one thing that caught me up was what happens if the initial
expression raises an exception? For example:
with open('file.txt'):
#do stuff
If the file can't be opened for whatever reason,
Robin Dunn wrote:
> Announcing
> --
>
> The 2.7.1.3 release of wxPython is now available for download at
> http://wxpython.org/download.php. This release is a yet another
> quick-turnaround bugfix release designed to solve some problems, plust
> some minor enhancements. This will likely
Paul Rubin wrote:
> Steven Bethard <[EMAIL PROTECTED]> writes:
>> Cameron Walsh wrote:
>>> Which brings me to the question, would this solution:
>>> B = set(B)
>>> A = B + list(x for x in A if x not in B)
>>> be faster than this solution:
>>> B = set(B)
>>> A.sort(key=B.__contains__, reverse=True)
Steve Holden wrote:
> Or use raw_input(), which was designed for such situations:
>
thx, did not know about that ...
--
http://mail.python.org/mailman/listinfo/python-list
At Wednesday 25/10/2006 23:29, Paul Rubin wrote:
Steve Holden <[EMAIL PROTECTED]> writes:
> Gabriel Genellina wrote:
> > iter(())
I get that iter(()) is True (Python 2.3.4).
It's False on 2.4.2 - and perhaps it's what one would expect, but
since this behavior is not documented anywhere, one
Mike Kent wrote:
> robert wrote:
>> I want to use a computation cache scheme like
>>
>>
>> o = CACHECOMPUTE complex-key-expr expensive-calc-expr
>>
>>
>> frequently and elegantly without writing complex-key-expr or
>> expensive-calc-expr twice.
>> So its ugly:
>>
>> _=complex-key-expr;
robert wrote:
> I want to use a computation cache scheme like
>
> o = CACHECOMPUTE complex-key-expr expensive-calc-expr
>
> frequently and elegantly without writing complex-key-expr or
> expensive-calc-expr twice.
> So its ugly:
>
> _=complex-key-expr; o=cache.get(_) or
> cache
Gabriel Genellina wrote:
> At Thursday 26/10/2006 16:30, robert wrote:
>
>> I want to use a computation cache scheme like
>>
>>
>> o = CACHECOMPUTE complex-key-expr expensive-calc-expr
>>
>>
>> frequently and elegantly without writing complex-key-expr or
>> expensive-calc-expr twice.
>>
robert wrote:
> I want to use a computation cache scheme like
>
>
> o = CACHECOMPUTE complex-key-expr expensive-calc-expr
>
>
> frequently and elegantly without writing complex-key-expr or
> expensive-calc-expr twice.
> So its ugly:
>
> _=complex-key-expr; o=cache.get(_) or
> cache
in Gnuplot (Gnuplot.utils) the input array will be converted to a Numeric float
array as shown below. When I insert a numpy array into Gnuplot like that below,
numbers 7.44 are cast to 7.0
Why is this and what should I do ? Is this bug in numpy or in Numeric?
[Dbg]>>> m #numpy array
ar
John Salerno wrote:
>> Not sure about the with-- I just went to read the PEP on it, and it
>> confused me greatly. :-) So, I don't know.
>
> Ditto. :)
No need to be confused; the "with" statement is actually very simple.
Consider this piece of code:
set things up
try:
do s
John Salerno <[EMAIL PROTECTED]> writes:
> Neil Cerutti wrote:
> > On 2006-10-26, John Salerno <[EMAIL PROTECTED]> wrote:
> >> [EMAIL PROTECTED] wrote:
> >>> as I have yet to try Vim - maybe I'll try tomarrow.
> >> Warning: Vim isn't something you just "try tomorrow" :)
> > You can become profici
At Thursday 26/10/2006 16:30, robert wrote:
I want to use a computation cache scheme like
o = CACHECOMPUTE complex-key-expr expensive-calc-expr
frequently and elegantly without writing complex-key-expr or
expensive-calc-expr twice.
So its ugly:
_=complex-key-expr; o=cach
[EMAIL PROTECTED] wrote:
> I am a beginner of programming and started to learn Python a week ago.
> last 3 days, i write this little tool for Renju...
Tell you what, I will trade you my fluent English for your ability to
write that in 3 days as a beginning programmer who started learning
Python a
[EMAIL PROTECTED] schrieb:
> I realize that this should include a ('.so','rb',3) entry (should it
> not? 3->imp.C_EXTENSION) if it were going to locate the c extension.
> Thus, my revised question would be what sets the suffixes for import?
> How do/Can I change this?
It depends on the target supp
I want to use a computation cache scheme like
o = CACHECOMPUTE complex-key-expr expensive-calc-expr
frequently and elegantly without writing complex-key-expr or
expensive-calc-expr twice.
So its ugly:
_=complex-key-expr; o=cache.get(_) or
cache.setdefault(_,expensive-calc-
Michael B. Trausch wrote:
> Not really über-qualified to say anything, but I think that the
> following would be better:
>
> try:
> f = open('file.sql')
> script = f.read()
> f.close()
> except IOError:
> wx.MessageBox('Message', 'Message Title')
I was thinking of somethi
On 2006-10-26, Tim Chase <[EMAIL PROTECTED]> wrote:
> There's no "zip" in the "baz" directory, so let's copy it
> there:
>
> C:\temp>copy foo/bar/zip foo/baz
> foo\zip
> Overwrite foo\zip? (Yes/No/All): y
> The file cannot be copied onto itself.
> 0 file(s) copied.
>
> What the [expletive]
BartlebyScrivener wrote:
> >> Vim
> >> you'll be frustrated for about a week,
>
> You'll be frustrated for at least two weeks. But you'll use it forever
> for everything from writing to programming, so who cares?
>
> Auto completion is called omni completion in VIM
>
> type ':h new-omni-completion
John Salerno wrote:
> def create_sql_script(self):
> try:
> with open('labtables.sql') as sql_script:
> return sql_script.read()
> except IOError:
> wx.MessageBox('Could not locate the file "labtables.sql"',
> 'Fi
Kenneth McDonald wrote:
> I'm trying to write a 'flatten' generator which, when give a
> generator/iterator that can yield iterators, generators, and other data
> types, will 'flatten' everything so that it in turns yields stuff by
> simply yielding the instances of other types, and recursively yi
Announcing
--
The 2.7.1.3 release of wxPython is now available for download at
http://wxpython.org/download.php. This release is a yet another
quick-turnaround bugfix release designed to solve some problems, plust
some minor enhancements. This will likely be the last 2.7.1.x
release. So
olive wrote:
>
> Did you try to set your PYTHONPATH properly with the same content in
> both central AND project preferences ?
>
Yep. Still does it. And the kicker is, that it does it with things
that it shouldn't have to wonder terribly much about -- classes that I
have custom-built, where it
John Salerno enlightened us with:
> Hmm, looks like this doesn't work anyway if open() doesn't work,
> because then f.close() raises an UnboundLocalError for obvious
> reasons.
Neither work 100% correct, actually. If the file can be located and
opened, but not read, the message
Could not loca
John Salerno wrote:
> def create_sql_script(self):
> try:
> f = open('labtables.sql')
> sql_script = f.read()
> except IOError:
> wx.MessageBox('Could not locate the file "labtables.sql"',
> 'File Not Found')
>
def create_sql_script(self):
try:
with open('labtables.sql') as sql_script:
return sql_script.read()
except IOError:
wx.MessageBox('Could not locate the file "labtables.sql"',
'File Not Found')
OR
Neil Cerutti wrote:
> On 2006-10-26, John Salerno <[EMAIL PROTECTED]> wrote:
>> [EMAIL PROTECTED] wrote:
>>> as I have yet to try Vim - maybe I'll try tomarrow.
>> Warning: Vim isn't something you just "try tomorrow" :)
>
> You can become proficient enough for basic editing in about 20
> minutes
1 - 100 of 216 matches
Mail list logo