@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14



Comments:

<0> Ah...
<1> well, not '==', but close enough.
<0> Yeah.
<1> don't compare against True or False, just use it as a boolean value.
<0> if <whatever> ??
<1> yes.
<2> Boingo so you can do: if set(listA).intersect(listB): blah()
<0> vs if <whateer> == True ?
<2> right
<1> Boingo: never use 'if <whatever> == True'.
<0> gotcha.
<0> Yhg1s: Why not?
<3> def IsTrue(arg): if arg==True: return True ; else: return False
<0> Yhg1s: Seems clearer from a readability standpoint.
<1> Boingo: because all other True values will evaluate as 'false'.



<0> Oh.
<1> Boingo: since they aren't equal to True, even though they are true when evaluated in a boolean context.
<1> if you *must* compare them that way, use 'if bool(val) == True'. But that's awkwardly redundant.
<0> So ["fdsi"] equals true, but not if I do == True
<1> it doesn't 'equal true'
<0> Evaluates to true?
<1> it is 'boolean true'. if considers it 'true'. but that's not the same thing as 'True' :)
<2> Boingo in english, we might say "It is True that the sky is blue", but we wouldn't say that "A blue sky EQUALS Truth"
<0> Gotcha.
<0> I will keep that in mind. Don't think I have ever hit that problem, but I will keep it in mind.
<0> Could be tough to track that down in an error situation.
<1> life was so much easier when Python didn't have True and False.
<4> on the other hand, I will troll a bit by pointing out that if 1 == True will evaluate as true :P
<1> arkanes: yes, but 2 == True will not.
<2> Thus proving the Truth Of One!
<0> but if 2 will?
<1> Boingo: yes.
<2> Boingo yes
<0> Yeah. Gotcha.
<5> I AM BACK.
<3> Oh great...
<6> so i figured out the mod_python thing
<2> EvanCarroll thanks for the warning :-)
<5> Your welcome.
<7> all values in python are true or false; True and False just happen to be ones that know it
<8> how can I check if something is a string?
<8> like isStr() or something
<9> When I want to add something to a string, I usually say "string += 'string'" I
<9> 'm wondering if there's a =+
<10> what would you expect =+ to do?
<9> baykal, import types; if type(thing_I_think_is_a_string) == types.StringType: print "It's a string"
<10> (and no, it doesn't exist as a single operator)
<9> timl, add the thing to the beginning of the string.
<8> mischko, tnx xx
<11> mischko: ick that is a bad idea
<12> why the hell redhat RHEL 3.x use python 2.2
<9> I'm just looking for a simple syntax to do it. There's a lot of ways.
<12> it making my life harder :(
<9> xerophyte, that's one of the reasons I moved away from RedHat completely. They rely on a specific version of Python.
<13> Yhg1s: are you interested in my timeit results? They're interesting -> http://python.pastebin.com/531462
<14> python 2.2? damn
<11> instead try doing if isinstance(item, basestring)
<12> i know this is ****s most our server are RHEL 3 x
<9> kosh, who are you addressing with that suggestion?
<11> mischko: you
<11> mischko: using type like that is a horrible idea
<9> to add two strings together?
<15> 4.x is out, and it has 2.3. But RHEL is about stability anyway.
<15> If you want, build a 2.4 RPM>
<11> mishari: ", import types; if type(thing_I_think_is_a_string) == types.StringType: print "It's a string""
<9> kosh, as in "isinstance(item, strings.StringType)"?
<9> types.StringType
<9> not strings.StringType
<9> isinstance(item, types.StringType)
<11> mischko: isinstnace(item, basestring)
<9> where does basestring come from?
<16> it's builtin
<11> yup
<9> what's the same thing for a tuple?
<9> list, etc.
<11> tuple



<11> list
<11> dict
<11> etc
<9> basetuple or tuple?
<13> Yhg1s: this is a better one -> http://python.pastebin.com/531463
<17> isinstance(item,str)
<9> xerophyte, you seeing this?
<9> solsTiCe, what's the types module good for?
<9> s/solsTiCe/so
<9> :(
<16> readability
<9> xchat foiled me there. I type "So, what's..." and it change it to a nick!
<9> I didn't hit tab for nick completion.
<9> I like isinstance better as I don't have to import something to do it.
<11> isinstance is better since it also covers inheritance
<11> using type like that is a mistake
<9> Thanks for the tip. I missed that somewhere. That should be documented in the types module.
<12> python 2.4 is backward compatible with python 2.2 am i right .. so if i upgrade it will not break anything it that right just wondering
<9> baykal, did you see the subsequent discussion on types?
<9> xerophyte, sorry for directing that question at you earlier. I meant baykal.
<15> xerophyte: Well, don't install python2.4 as /usr/bin/python.
<15> xerophyte: That will break RH's stuff
<9> xerophyte, There are are redhat specific libs in the 2.2 install. You install 2.4 and it won't see them.
<9> s/libs/packages
<12> hmmm
<12> Erwin, dont wanna have 2 python
<12> hmmm
<12> its ****s
<9> What specifically is giving you stress about the two-pythons parallel install?
<12> i need to write install script which work with cpanel servers
<15> Why not? Who cares? Are you running of a flashcard in your MP3 player?
<12> most of the cpanel server use RHEL 3
<12> i can not ask the clinets to replace or install 2.4
<12> so just wondering if i should use the python
<15> So target 2.2.
<12> hmmm
<15> It's not like it's a bad python, it's just not as new as 2.4.
<12> and it will run on 2.4 and 2.3 am ir ight
<12> true its missing good functions ;)
<15> Generally. Unless you name your variables "yield"
<12> hmmm
<9> if you're writing for RHEL then the clear thing to do is target their version of Python. It will make life simpler in the long run.
<12> i actually it should run with 2.3 2.4 and 2.2
<12> if i write with 2.2
<12> it will run on 2.3 and 2.4 am i right
<18> using popen3 can you p*** variables to system commands that you gather in the rest of your python script?
<19> http://www.valvehacks.zaccum.com/ - great cs dod hl2 (valve) hacks
<7> possibly, but I'd use subprocess
<11> dsasda: what does that have to do with python?
<7> dsasda: 403
<7> ah, a spammer
<9> xerophyte, You should be fine.
<20> yo
<20> for those who know snakelet servers: how can i get more information about a startup error? all i get is "Server couldn't start due to errors.", and everything in the logging.cfg is on DEBUG
<21> accidently typing python.com instead of .org at work and stuff must get people in trouble :P
<22> haha
<22> what is at python.com?
<22> oh nice
<22> haha
<22> hi def blowjobs :)
<23> hi, I'm new to python
<21> python00b
<23> what's the mess with numeric arrays? I see 3 different packages, numeric, numarray, scipy
<23> is there an "official" something? a "better" one?
<11> numarray replaces numeric
<11> scipy I think can use either one but I have not checked in a long time now
<23> and I read that numpy replaces numarray, and then that there will be a merge...
<23> http://www.scipy.org/wikis/numdesign/num3news
<18> deltab, do you have an example of subprocess?
<7> riddlebox: doing what?
<24> why may exc_info() return an empty string?
<25> is there some way to convert a prototype object into another cl***?
<18> deltab, I want to basically run a mysql command, with some variables I collected in my python script
<26> I wrote a little script to read stuff off a website using urllib. The only problem is the source output I get isn't the same as I get from a regular browser like IE or Mozilla (I suspect they're filtering content based on the program that access the page)... can anyone give me more info how this works?


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #python
or
Go to some related logs:

#math
what is the location of c header files that match
FC5 Error inserting fuse
mike12341
unknown filesystem type 'iso9660'
ubuntu wide fat fonts
aeiedil
cramfs: wrong magic ltsp
python pyw PyQt4
#gaim



Home  |  disclaimer  |  contact  |  submit quotes