@# 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 15



Comments:

<0> http://www.python.org/dev/peps/pep-0008/
<1> blackdroid_wd, that's what i was quoting of course
<1> your argument about mistaken configuration doesn't add up unless you mean people that have 'turn tabs to spaces' on
<0> jonas22: you are free to use whatever you want.
<1> was just wondering
<1> if most people use spaces
<1> i am pretty surprised, since most people i know (of course, the tiniest of subsets) use tabs
<0> jonas22: Ive had this discussion leading to no ends. some just wont let go of hardtabs.
<1> i've read somewhere guido regretted allowing tabs
<2> jonas22: Tabs versus spaces are the oldest flamewar possible... I would favorite TABs but have accepted that many others use spaces.
<0> yes since that has led to python code that is hard to follow when the indentation ****s up.
<1> yeah i want to stay away from the flamewar, i guess i was just surprised at that quote from 0008
<2> jonas22: My opinion: one TAB is exactly one indentation level. There is nothing wrong with that. Some people even voluntarily hit the space bar four times to get one level of indentation. That's not very intuitive IMO.
<3> The plan is to disallow tabs in py3000
<0> Erwin: \o/ :)
<4> tabs ****



<3> My TAB key in emacs, doesn't insert a tab. It indents one level (not that it's requird often, as the python mode automatically indents)
<4> normal editors allow you to set the tab key to insert x spaces
<1> i hope that is thrown out; i'd rather python just run with -tt by default
<5> Given a command argument such as `foo [ -n ] bar baz [ -s <1|2> ]' how would you represent this in a data structure? I need to use this data structure to generate a GUI (PyGTK) and from this GUI generate a proper command argument (this is a GUI front-end for a CLI program, and there are many such arguments). Any ideas, documents, or code I can check out?
<1> have you looked at optparse
<3> tp76: -n (checkbox), "bar baz" -- input box? Depends on what it means. -s 1/2 -- radio button, maybe with 2 (if either 1 or 2 is default unless you specify it) or 3 choices
<5> jonas22: yes, but it's not for parsing a command line. It's for generating a GUI which in turn generates this command line. I then send this command line to a CLI program.
<1> ah, the other way around
<5> Erwin: yes, I thought about parsing a string like "foo [ -n ] bar%d{0,100} baz%d{10,50} ..." %d meaning an int and {0,100} giving the range, or something like that.
<5> There's also the problem of "infinite" repetitions of some arguments, such as `foo a b [ a b ... ]'
<3> Well, I don't think you can generate a good GUI from that automatically
<5> I was hoping I could generate a sufficient GUI, because there are almost a 100 such arguments. Hard-coding it would be quite time consuming, though, the end result would probably be better.
<6> How do I know if a cl*** instance has a few methods? will hasattr(cls, 'meth') do it?
<7> hi, how can i get the methods of an object in python ?
<8> lwolf: the inspect module.
<7> Yhg1s, ok.. thanx
<8> or the 'pydoc' command-line tool, or the 'pydoc' module, depending on what you're looking for.
<9> d
<9> how can i add element od the list to gadfly database ?
<9> anyone know ?
<9> i know :)
<9> thanks
<9> for helping me
<10> did i miss something? who did help you?
<11> szalony_zdzich: anytime
<12> hi. can you guys point me to some good documentation for client server programming in python?
<13> Loady: you might want to check out twisted, thats a nice industrial grade server/client framework
<14> greetings
<12> ok.. thanks
<14> i have a question about finding out a module path
<14> I am currently doing import foo; path = foo.__file__
<14> is it possible to do such a thing *without* importing the module ?
<14> basically answering the question "where would module foo come from if it would be imported now?"
<14> ?
<10> lucsky: you could go through each path in sys.path and look if there is a file with the right name in it
<14> right, but then I would also have to handle zip imports manually
<8> lucsky: the 'imp' module.
<14> Yhg1s: sweetness, that's exactly what I need
<14> thanks a bunch
<15> has SSL socket timeouts been fixed in 2.5?
<15> or some form of workaround found?
<16> re all
<16> having a string s i need to find a substring of s that matches a regular expression e
<16> how can i do that?
<15> using the re module
<15> look at re.search
<17> EtnaRosso, What languages do you know already?
<16> java and c
<17> Okay, good. This won't be too foreign then.
<16> ok now i have
<16> re.findall('".*"','att="va" AND att="va1"')
<16> but it returns the biggest occurrence
<16> i need va and va1
<10> EtnaRosso: either are'"[^"]*"' or are'".*?'
<18> you can specify non-greedy can't you?
<10> wtf? the 'are' should be only the middle letter of 'are'
<8> thta's what .*? does.
<8> ChrisLong: xchat? mirc? they think it's useful to translate lone 'r' to 'are' :)
<18> yep just read that now :)
<10> Yhg1s: gaim, but yes that was it. but now it's fixed.. r r r
<16> Yhg1s: .* if for "any character"



<8> EtnaRosso: yes, and .*? is for 'any character, but match non-greedy'
<16> ah good idea any except "
<15> how do I poke people to see if a bug has been looked at and fixed? it's a rather crucial bug...
<8> Moof: depends on the people.
<8> Moof: if you mean a bug in Python, download alpha2 and try it.
<8> or look at the bugreport and see if it says 'fixed'.
<15> it doesn't say "fixed"
<15> btu it hasn't been touched in 8 months
<15> bug 1153016
<8> Moof: www.python.org/sf/1153016 ?
<15> yes
<16> thanks all
<10> EtnaRosso: you're welcome
<8> Moof: I'll see if I can reproduce it.
<15> thanks muchly
<13> EtnaRosso: you might want to instalk kodos if you're new to regexps (thats a python regexp debugger/editor)
<8> Moof: I can't reproduce it even in Python 2.4.3.
<15> hmm, fun
<15> defintiely happening here on windows
<15> oh, wait, this is 2.4.2
<15> my colleague in madrid gets it on 2.4.3
<8> well, if you set a timeout and a timeout *occurs*, it does of course raise the exception. that's what it's meant to do
<15> yeah
<15> that's fine
<15> I can cope with that
<15> but it doesnt' get that far
<15> and more tot he point, it should rase a TimeoutException or somesuch
<19> Does anyone know if there is a way to handle rar files with python under linux?
<13> hawking: there is a "unrar" you could execute via os.system()
<19> pfote: well I know of that .. I just wonder if there is a python library or smth like that for rar stuff
<19> but there isn't as it seems
<15> Yhg1s: definitely happening to me in 2.4.3
<8> Moof: then I don't understand what you mean by 'happening'. Does it wait 30 seconds, or whatever the timeout is set to, or does it report an error immediately?
<15> it reports an IOError eimmediately
<15> er
<15> URLError: <urlopen error (2, 'The operation did not complete (read)')>
<8> right away? what did you set the timeout to?
<15> 10000.0
<15> or 10000
<15> tried both
<15> if I set it to None, it works
<8> nope, can't reproduce it here.
<8> everything I do just waits patiently.
<15> trying to do a urllib2.urlopen('https://sourceforge.net/')
<8> Python 2.4.3 (#2, Apr 1 2006, 12:30:11)
<8> >>> socket.setdefaulttimeout(30000)
<8> >>> urllib2.urlopen('https://sourceforge.net/')
<8> <addinfourl at 47554169133176 whose fp = <socket._fileobject object at 0x2b400f7a3210>>
<8> (returns that after about a second.)
<8> when I set the timeout to very low, I get urllib2.URLError: <urlopen error timed out>
<8> or urllib2.URLError: <urlopen error The connect operation timed out>
<8> or urllib2.URLError: <urlopen error The read operation timed out>
<8> (depending on timing issues.)
<13> Moof: could your server side be the problem?
<8> we're both testing with https://sourceforge.net/
<13> oh
<15> http://deadbeefbabe.org/paste/543
<15> that error appears immediately
<8> might be windows specific, then.
<8> I can test when I get home.
<15> seems to work ok on debian linux
<20> got a problem with shelve here, i store cl*** instances in a shelve file... but when i shutdown the program and restart it, the cl*** instances still seems to be there but thier datamembers have somehow malfunctioned... i cant use them to print them anymore... i made an experiment in the interactive shell if anyone wants to look and help out: http://pastebin.com/731063
<15> Yhg1s: if you give me a prod later, i'll probably be online
<21> hello
<21> i would like to develop some web applications and i see there are some web frameworks; question is which would "you" prefer?
<15> rokj: depends for what
<15> personally, i'd use nevow, but that's becasue much of my infrastrcture is stuck in twisted, and that's really a big learning curve.
<15> for a asic CMS, I'd look at django
<22> a basic CMS? django isn't a CMS
<15> for something more advanced and wrokflow-based, with good i18n, I'd go for plone.
<15> for something that isn't so content-based maybe turbogears, but I haven't really used it
<15> rocky: no, it isn't


Name:

Comments:

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






Return to #python
or
Go to some related logs:

xorg tr1a
fibbonaci + recursion
error kernel function vmap() necessary x86_64
(standard_in) 1: parse error
firestarter on drapper
kubuntu start-hidden
iptables mac-source
#linux
#ubuntu
reisio.com punkid



Home  |  disclaimer  |  contact  |  submit quotes