any way to "dereference" a path with symlinks?
|thefirstdude||what's the best way to add a zero to a string if it is only 1 char long|
|SpComb||not chatting as root|
thefirstdude: you want to format numbers or something else?
|thefirstdude||I just want if a string is less than 2 long make it 2 long by adding 0's in front|
|SpComb||let me guess, is this string a number?|
|thefirstdude||or an arbitrary number|
I know I can do if len(string): string = '0' + string...
but is there no better way?
|plastic_wrap||i am having some difficuly raising custom exceptions in python 2.4. ClassA inherits Exception, classB inherits class A. I f I call raise ClassB, the __init__ method throws an error when it tries to call super(ClassB, self)__init__. the error is argument 1 must be type, not classobj|
|stepz||string = max(0,2-len(string))*'0' + string|
|SpComb||if it's a number, "%02d" % (your number)|
|SpComb||seems you can't pad strings with anything but spaces|
|Adri2000||how can I catch more than one line with sys.stdin.readline() ?|
|plastic_wrap||last time to fix this error i had to change the class to inherit from object.... but if i do that then i cant call raise ClassB as its not inheriting from Exception|
|^alien||is there anything like PHP's explode in python?|
|stepz||hmm, the max isn't even necessary|
|Jafet||The split member.|
|SpComb||plastic_wrap: inherit A from both Exception and object?|
|bytecolor||^alien, christ I hope not ;)|
|Jafet||re also provides regular expression splitting I think|
|stepz||negative_number * string == ''|
|mmiikkee12||can anyone explain what's going on here? >> http://pastebin.ca/451507|
|SpComb||mmiikkee12: int/int = int|
|mmiikkee12||SpComb: oh, i see. 119/200 = 0... so why is it letting me divide by 0?|
|stepz||this will be changed, you can do from __future__ import division to get expected behaviour|
|SpComb||mmiikkee12: multiply by zero?|
never mind :)
|plastic_wrap||SpComb: good call, i tried that, didnt work. i get exceptions must be classes, instances, or strings (deprecated), not ClassB|
|SpComb||plastic_wrap: what does ClassB inherit from, exactly? class ClassB (ClassA) : ?|