Kenneth McDonald wrote:
>
> With the most recent edition of PyDev, I find Eclipse works quite well
> for me.
>
Since you mentioned it, I have a question that searching around and
poking around has not solved for me, yet.
Do you have auto-completion working with your setup? It does not seem
to w
> You really need to do some debugging here. There must be more error
> message than that, or there are some issues with libdl on the target
> system. A common problem is that it gives an error message that
> some symbols could not be found when loading the shared library,
> and that these symbols
Michael B. Trausch a écrit :
> Kenneth McDonald wrote:
> >
> > With the most recent edition of PyDev, I find Eclipse works quite well
> > for me.
> >
>
> Since you mentioned it, I have a question that searching around and
> poking around has not solved for me, yet.
>
> Do you have auto-completion
There're too little comments, and too much Chinese characters, and
maybe you should give us an introduction about what renju is.
--
http://mail.python.org/mailman/listinfo/python-list
Oh, great. Learn something new everyday.
For this, what I did was to build up a string, and then use eval on the
string. Very ugly.
Now I can simply do a reduce.
Thanks,
Brian Beck wrote:
> John Henry wrote:
> > What's the cleanest way to say:
> >
> > 1) Give me a list of the items that are
[EMAIL PROTECTED] wrote:
> #!C:\\Python25
Just from curiosity: Since when does the hash bang work in Windows?
Regards,
Björn
--
BOFH excuse #417:
Computer room being moved. Our systems are down for the weekend.
--
http://mail.python.org/mailman/listinfo/python-list
Wijaya Edward wrote:
> How can we print out the hidden character like
> "\n", "\r" etc in Python?
Try
repr(var)[1:-1]
CMIIW. :)
Regards,
Björn
--
BOFH excuse #271:
The kernel license has expired
--
http://mail.python.org/mailman/listinfo/python-list
Yee Hah! :D Thanks Seo! :D > http://www.oreillynet.com/xml/blog/2006/10/seo_sanghyeonipce_ironpython_c.html
On 10/26/06, Sanghyeon Seo <[EMAIL PROTECTED]> wrote:
This is the third release of IronPython Community Edition (IPCE).Get it here.http://sparcs.kaist.ac.kr/~tinuviel/download/IPCE-r3.zip
Th
In article <[EMAIL PROTECTED]>,
Steve Holden <[EMAIL PROTECTED]> wrote:
...
> Maybe so, but that "rule" (and let's not forget that the zen is not
> actually a set of prescriptive rules but rather guidelines for the
> informed) is immediately preceded by the most important "rule" of all:
> "Beau
Bjoern Schliessmann wrote:
>> #!C:\\Python25
>
> Just from curiosity: Since when does the hash bang work in Windows?
cygwin? exemaker? some kind of web server?
--
http://mail.python.org/mailman/listinfo/python-list
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 "issuer()"
> return are strings,
Donn Cave wrote:
> In article <[EMAIL PROTECTED]>,
> John Nagle <[EMAIL PROTECTED]> wrote:
>>
>>Note that
>>
>>"OU=Terms of use at www.verisign.com/rpa (c)00"
>>
>>with a "/" in the middle of the value field.
>
> ...
>
>>Is there a workaround for this? Without rebuilding Python
>>and becomi
Paul Rubin wrote:
>
> To dump out the certificate? Try:
>
>openssl x509 -text -in filename.crt
>
> if the cert is in a file. Omit that -in parameter if you want openssl
> to read from stdin. Of course now you get this other text format
> thing to parse, but it's not so bad.
I wouldn't re
We are very pleased to announce the release of NumPy 1.0 available for
download at http://www.numpy.org
This release is the culmination of over 18 months of effort to allow
unification of the Numeric and Numarray communities. NumPy provides the
features of both packages as well as comparable
Tim Roberts wrote:
>> C:\temp\foo\bar>cd ..
>> C:\temp\foo>cd ..
>> C:\temp>cd /foo/bar
>
> This one does not work for me, but as long as the initial slash is back,
> the rest can be foreward:
>
> C:\tmp>cd /foo/bar
> The system cannot find the path specified.
> C:\tmp>cd \foo/bar
>
Hello All,
Here is a script I wrote to validate the cert sent by
the server. It just makes system calls to open ssl.
This is because python support is inadequate in this
area. Let me know if this is helpful. I monkeyed
with twisted, m2crypto, pyopenssl, and found myself
sinking into a deep depr
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
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
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')
>
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
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
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
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
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
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
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]
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
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-
[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
[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
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
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
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
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
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
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;
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
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
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)
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
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,
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
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
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
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
__
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
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
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")
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...
> 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
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
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]>
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 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
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
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
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
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
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
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
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
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]>
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
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
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
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
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
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 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
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
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
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
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 <[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
"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.
> >
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
"
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 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
"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
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
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
>
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
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
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
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
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
-- 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
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
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
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
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
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
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', '-', '-'
"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
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
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
"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
>
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
101 - 200 of 216 matches
Mail list logo