At 02:41 PM 3/6/2007, Alan Gauld wrote:
>"Dick Moores" <[EMAIL PROTECTED]> wrote
>
> > Sorry, topic and keyword documentation is not available because the
> > Python
> > HTML documentation files could not be found. If you have installed
> > them,
> > please set the environment variable PYTHONDOCS
Kent Johnson wrote:
> This is a popular question. It comes up frequently on comp.lang.python
> and there are many recipes in the online cookbook.
Here is a good starting point if you want to see a variety of ways to
uniquify (?) sequences:
http://tinyurl.com/3cqnj5
Make sure you look at the ref
Rob Andrews wrote:
> I'm trying to think of the best way to go about this one, as the files
> I have to sort are *big*.
>
> They're ASCII files with each row consisting of a series of
> fixed-length fields, each of which has a corresponding format file.
> (To be specific, these files are FirstLogi
David Perlman wrote:
> On Mar 6, 2007, at 4:28 PM, wesley chun wrote:
>
>
>>> >>> x=('i' in 'i')
>>> >>> x
>>> True
>>> >>> y='i'
>>> >>> x==y
>>> False
>>>
>> you're right when you talk about "casting" altho that's not what
>> python does. it merely performs an object value comparis
David Perlman wrote:
> This helps convince me that I still don't understand why the original
> code snippet worked at all. :)
>
> These code examples make perfect sense. This one doesn't, and
> appears to be an inconsistency:
>
> >>> word2 = 'hello'
> >>> item = 'e'
> >>> item in word2
>
I think it's a little strange and possibly problematic that type(1)
is 'int' and type(True) is 'bool' but
1 == True
specifically evaluates to True even though anything else, even if it
evaluates to True when cast as a boolean, is not == True.
>>> 1 == True
True
>>> 2 == True
False
>>> 0 ==
On 07/03/07, Rob Andrews <[EMAIL PROTECTED]> wrote:
> I'm trying to think of the best way to go about this one, as the files
> I have to sort are *big*.
[...]
> I haven't yet figured out a way to apply sort() to this problem,
> although I'm certain the failing is my own.
To use sort(), you'll have
On 07/03/07, David Perlman <[EMAIL PROTECTED]> wrote:
> On Mar 6, 2007, at 11:03 AM, Alan Gauld wrote:
> > It's doing the latter and since anything that's not 'empty' in
> > Python evaluates to true we wind up checking whether
> > true == (item in word)
> >
> > So if the item is in word we get true
On Mar 6, 2007, at 4:28 PM, wesley chun wrote:
>> >>> x=('i' in 'i')
>> >>> x
>> True
>> >>> y='i'
>> >>> x==y
>> False
>
> you're right when you talk about "casting" altho that's not what
> python does. it merely performs an object value comparison when you
> use '=='. for example, change
"Dick Moores" <[EMAIL PROTECTED]> wrote
> Sorry, topic and keyword documentation is not available because the
> Python
> HTML documentation files could not be found. If you have installed
> them,
> please set the environment variable PYTHONDOCS to indicate their
> location.
>
"David Perlman" <[EMAIL PROTECTED]> wrote
> Sorry, but this still doesn't make sense to me.
>
>>> x=('i' in 'i')
>>> x
True
>>> y='i'
>>> x==y
False
> But the == operator doesn't cast its operands as Booleans;
Good catch!
I don't understand it now either.
But I've been up since 4:30am and
I'm trying to think of the best way to go about this one, as the files
I have to sort are *big*.
They're ASCII files with each row consisting of a series of
fixed-length fields, each of which has a corresponding format file.
(To be specific, these files are FirstLogic compatible.)
I'm looking to
> >>> x=('i' in 'i')
> >>> x
> True
> >>> y='i'
> >>> x==y
> False
you're right when you talk about "casting" altho that's not what
python does. it merely performs an object value comparison when you
use '=='. for example, change your code above to:
>>> True == 'i'# because this is what
On Mar 6, 2007, at 11:03 AM, Alan Gauld wrote:
> It's doing the latter and since anything that's not 'empty' in
> Python evaluates to true we wind up checking whether
> true == (item in word)
>
> So if the item is in word we get true == true which is true.
>
> HTH,
Sorry, but this still doesn't ma
===
>>>help('assert')
Sorry, topic and keyword documentation is not available because the Python
HTML documentation files could not be found. If you have installed them,
please set the environment variable PYTHONDOCS to indicate their location.
===
Andrei wrote:
> Dick Moores wrote:
>
>> I've been trying to learn new things from the Cookbook, but here's a
>> recipe the utility of which I don't understand at all. Why interpolation
>> (whether the ruby way or not)? Maybe a better example than the couple
>> given would help me?
>>
>
Thanks, Alan. I really appreciate the discussion.
--C
2007/3/6, ALAN GAULD <[EMAIL PROTECTED]>:
> Hm, I'm not sure I see your point. Could an evil hacker not just
> as easily change the dictionary in the python code
> (or somewhere else in the code) to perform such evil operations?
If they ha
> Hm, I'm not sure I see your point. Could an evil hacker not just
> as
easily change the dictionary in the python code
> (or somewhere else in
the code) to perform such evil operations?
If they have access to the source code you are right of course.
But typically the source will be in a secure
Dick Moores wrote:
> I've been trying to learn new things from the Cookbook, but here's a
> recipe the utility of which I don't understand at all. Why interpolation
> (whether the ruby way or not)? Maybe a better example than the couple
> given would help me?
Normal string formatting in Pytho
Cecilia Alm wrote:
> Hm, I'm not sure I see your point. Could an evil hacker not just as
> easily change the dictionary in the python code (or somewhere else in
> the code) to perform such evil operations?
Not too easily, if the code were distributed as .pycs. However, running
code you read in
Hm, I'm not sure I see your point. Could an evil hacker not just as easily
change the dictionary in the python code (or somewhere else in the code) to
perform such evil operations?
--C
2007/3/5, ALAN GAULD <[EMAIL PROTECTED]>:
> That's neat. When just the function call is the string,
> eval()
I've been trying to learn new things from the Cookbook, but here's a
recipe the utility of which I don't understand at all. Why interpolation
(whether the ruby way or not)? Maybe a better example than the couple
given would help me?
The description is
"Interpolate variables and expressions in s
"OkaMthembo" <[EMAIL PROTECTED]> wrote
> I am keen to find out if there are any frameworks
> for Python mobile web development out there.
If you mean WAP applications then so far as I'm
aware there is nothing different at the server end
except they serve up some specific XML style
documents
"zannah marsh" <[EMAIL PROTECTED]> wrote
> rikart pointed out that you need to use a range to get to the
> indicies of
> the items in the string.
>
> for item in range(len(string))...
> if word1[item] == word2[item]
>
There is another way which is to use enumerate which
returns both the item
zannah marsh wrote:
> what I was trying to do with that loop is check each character in the
> string against the corresponding character at the same position in the
> second string. rikart pointed out that my loop was actually checking
> if that character exists anywhere in the second string.
[s
Hello All,
I am keen to find out if there are any frameworks for Python mobile web
development out there.
Does anyone know of a major/popular mobile web app written in python?
Moreover, if i wrote a mobile web app
with standard HTML for presentation and Python as a server-side language,
would the
what I was trying to do with that loop is check each character in the string
against the corresponding character at the same position in the second
string. rikart pointed out that my loop was actually checking if that
character exists anywhere in the second string.
basically, in pseudocode:
for t
OK, so now I need to pick a freeware installer to bundle it all up and
install it real easy for the non technical minded, and fire off the
python self installer I include with it.
So let's refine this tread to INSTALLER discussion. Recomendations,
comments, criticisms, links to webpages, etc.
Hello All,
I am keen to find out if there are any frameworks for Python mobile web
development out there.
Does anyone know of a major/popular mobile web app written in python?
Moreover, if i wrote a mobile web app
with standard HTML for presentation and Python as a server-side language,
would the
"David Perlman" <[EMAIL PROTECTED]> wrote
> I can't figure out how this would ever work at all. It seems like
> it's either checking to see whether boolean TRUE is in word2, or
> else
> it's checking to see whether item is equal to boolean TRUE or FALSE,
> and neither of those should ever be tr
David Perlman wrote:
> OK, I'm new to python too so I don't assume I know what I'm talking
> about yet, but this looks like a mess to me. What exactly does "item
> == item in word2" evaluate to? Does "in" or "==" have higher
> precedence?
>
> I can't figure out how this would ever work at a
OK, I'm new to python too so I don't assume I know what I'm talking
about yet, but this looks like a mess to me. What exactly does "item
== item in word2" evaluate to? Does "in" or "==" have higher
precedence?
I can't figure out how this would ever work at all. It seems like
it's either
Kirk Bailey wrote:
> 2. It takes python being in the laptop so it can be used. As I do not
> own it, I hesitate to bundle it in. What's the legal aspect of providing
> the language the app needs so it will run?
This is not a problem, you can distribute a package that includes Python.
http://www.
33 matches
Mail list logo