#apache #archlinux #asterisk #centos #debian #gentoo #haskell #kde #kubuntu #lisp #math #mysql #perl #python #ruby-lang #rubyonrails #suse #ubuntu #vim #wikipedia 0 1 2 3 4 5 6 7 8 9 10 11 12 13
Top Prev 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 Next
#python
<Necroalbert> ^^
<ZenMasterJG> its been fun for me lately, i'm doing python for a big project, c++ for school, and java for work...
<ZenMasterJG> i seriously did about half of a test in python before i remembered we were supposed to be writing it in C.
<ZenMasterJG> the prof. looked at me pretty funny when i handed that in... all my python code crossed out.
<arkanes> it's best when the assignment is something like "implement a hash table"
<kbrooks> crossed out ?
<ZenMasterJG> kbrooks: writing code, on paper for the test. crossed out. with a pen.
<esperegu> how can i except all exceptions while still printing the error?
<moldy> try:
<moldy> raise Exception("Test")
<moldy> except Exception, e:
<moldy> print e
<arkanes> in 2.5 that won't get "really all" exceptions
<esperegu> moldy: thx! looks like another typo in the handling of the exception that gave the error
<esperegu> arkanes: why's that?
<arkanes> theres a couple exceptions that now derive from BaseException, which is higher up
<arkanes> SystemExit and some other ones I can't recall right now
<arkanes> you usually don't want to catch them, thats why
<ZenMasterJG> so just do try: <blah> except BaseException, e: print e
<arkanes> bare except + the traceback module is also a solution
<arkanes> except: import traceback;traceback.print_exc()
<krisp> hey guys - I'm a php developer looking to have a good at python to expand my sk9ill base... where do I start - and can I sun it in conjection with php ?
<arkanes> diveintopython.org
<arkanes> alhtough you will need to unlearn much of your PHP
<zyp> once you've learned python, you don't want to go back to php ;)
<krisp> lol
<krisp> I use the wamp project to set up windows servers... - any idea how I just set it up to run ?
<krisp> also - shoulI download ActivePython (f ?
<arkanes> are you looking for something specifically in the same area as PHP?
<krisp> yes...
<arkanes> then what you really want is one of the Python web frameworks
<krisp> I run an apache server... an just want to be able to use .py files on there to begine with -
<krisp> I think django sounds good too
<arkanes> Python itself is general purpose and doesn't have a special focus on web programming
<timonator> yes, django is great
<Rustre> esperegu, you could also use the code given in the tutorial : http://www.python.org/doc/current/tut/node10.html#SECTION0010300000000000000000
<T`> i use turbogears which is pretty good too
<Rustre> look at the end of the section, there's an "except:"
<krisp> that's what's really confused me - because php is mainly JUST web based it's dead easy to set up with apache (especially thanks to the WAMP project) but can I run python with it... and how :P ?
<Rustre> and you print the type of the error with sys.exc_info()[0]
<sipher> before I start to cry.. is there a bit of code that will parse the results of ftplib's dir() into a tuple or something? I'm only so-so with regex.. and apparently.. the format isn't defined by any RFC.. so there's DOS and UNIX formats.. which.. bah
<krisp> so django is what I should install - not python per se ?
<arkanes> django at least, probably turbogears, can be set up out of box to run on thier own servers
<arkanes> sipher: I had the pleasure of working with the author of an ftp client
<sipher> and it's space padded to pretty print for telnet clients
<sipher> which is even worse
<arkanes> sipher: and his parser to try to figure out the output of dir was over 1000 lines
<krisp> I just want to get it running WITH php also...
<sipher> I thought it was tab delimited at first
<sipher> !!
Previous Page Next Page