@# 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 16 17 18 19 20



Comments:

<0> hi all
<0> people, anyone know how do in apache2 for mod_python works with any file.py ? I put this in my apache2 conf :
<0> <Directory /var/www/python>
<0> AddHandler mod_python .py
<0> PythonHandler mod_python.publisher | .py
<0> PythonDebug On
<0> </Directory>
<0> but this not works.. but if i change to PythonHandler test so my file test.py works fine. Anyone know how do for execute many files.py ?
<1> J_P, try just PythonHandler mod_python.publisher, whitout | .py
<0> eugene_beast: I try taht too and not works :-(
<1> J_P, try add that: PythonPath "sys.path + ['/var/www/python']"
<0> eugene_beast: humm ok, moment
<1> J_P, and i have not AddHandler mod_python .py but AddHandler python-program .py
<0> eugene_beast: ok, I will change too
<2> why is try: yield; finally: illegal?
<1> ironfroggy, yield <something>



<3> hi there, I'm looking for a python library that can be generate HTML form with postgresql tables and use integrity with select boxes
<2> eugene_beast: what?
<2> eugene_beast: i dont see how thats relevent.
<4> Hey all
<2> hey
<4> How ya doing?
<4> Started new project today :-)
<2> what would that be?
<4> Damn keyboard shortcuts :(
<2> so whats your bright new idea?
<4> lol hardly bright but ill learn how to use python through cgi and learn some ajax, 2 birds with 1 stone
<4> Ajax/python IRC client
<2> dont make me shoot you
<2> thats my secret project!
<2> shhh
<4> lol, you serious?
<2> yes, but its not like prototypes havent already been written.
<2> i think there's one somewhere in twisted words
<4> Fair enough
<2> have any specific ideas?
<4> Well i doubt youd have much competition from me ;-) lol.
<4> Not really, Keep it functional but simple.
<4> Maybe just a basic irc client with window tabs
<2> have you had thoughts on what benefits you could work in leveraging the fact that its a webapp?
<4> Not really, at the moment its only inteded as a learning excersize
<4> When i get it functional and everything i might start adding things then
<2> so are you actually intending to build this from scratch? writing reliable AJAX code from the bare bones is very difficult.
<5> is there any way to take from popen3 exit code ?
<4> Yep. not much point in me just using frameworks for everything
<4> Wont learn anything by doing that
<2> sure you will.
<2> you dont have to reinvent the wheel to learn, you can build a car instead.
<2> the higher you start, the higher you can go.
<6> I have a sorted list of integers and I would like to find the list entry that is closer to an integer I have at hand
<6> closest* What is the most pythonic way to do so?
<6> the integers are always positive
<7> eleftherios, [abs(x-your_value) for x in your_list] is the easiest way to get the distances (afaik)
<2> define "closer"
<4> Yeah, but, i want it to be portable, run on any webserver with CGI enabled and not expect users to install python modules and ****. if its good enough to release that is
<8> CREATE TABLE `30` (
<8> `id` BIGINT NOT NULL ,
<8> `zapis_pravni_status_zapisa` ENUM( 'F', 'P' ) NOT NULL ,
<8> `zapis_enolicni_identifikator_zapisa` VARCHAR( 255 ) NOT NULL ,
<8> `zapis_mesto_objave` ENUM( 'knjiga', 'CD', 'internet', 'informacije', 'YYYY' ) DEFAULT 'YYYY' NOT NULL ,
<8> `zapis_knjiga_objave` ENUM( 'W', 'Y' ) DEFAULT 'W' NOT NULL ,
<8> `zapis_podrocna_koda` INT NOT NULL ,
<2> STOP FLOODING
<8> `kraj_ime_kraja` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_slovenian_ci NOT NULL ,
<7> then you could go for a .index method there
<8> ****
<8> sorry
<4> And im a big fan in making stuff myself, Add a personal touch
<9> rocky, o, slovenac :)
<2> kieranDOA: pure CGI ajax is a horrible horrible idea.
<2> rokj: language.
<10> hm?
<8> wrong query :)
<6> AKX, this way I get the distances but then I will have to build a corresonding list of distances and find the smallest, ***ociate it with the right entry in the original list... I woul;d like to have something that does it in place
<4> ironfroggy: Whys that?
<4> ironfroggy: how else would i expect to do it?
<7> Well eleftherios, if you do that, then that_list.index(min(that_list))



<8> pygi: hi :)
<7> or well ok, elefterios, this... let's see
<2> kieranDOA: CGI is way too much overhead for reliable overhead. using a more pure-python approach, where the session is handled by persistant objects that stay alive after the initial request, is much better.
<9> rokj, near you are :)
<2> kieranDOA: there are systems around that already do this. i make my living with them.
<11> eleftherios, sort it based on the distance
<6> ironfroggy, closest meaning closest in value.
<4> So like mod_python or something? im not to familiar with python on the server side :-)
<2> eleftherios: again, that is vague. is 1 or 3 closer to 2?
<8> pygi: yes, maybe even closer than you think ;)
<2> kieranDOA: mod_python ****s.
<9> rokj, hm?
<7> elefterios: sorted(zip([x-your_value for x in your_list],range(your_list)),None,lambda k:k[1])[0][1]
<2> kieranDOA: my weapon of choice is twisted.web and nevow
<6> ironfroggy, good question, I should have clarified that. The smaller number will take precedence
<7> That _might_ work
<6> ironfroggy, so for for my application 1 is closer to 2 than 3
<8> pygi: just little star trek imagination floating around my head :)
<9> rokj, joy :)
<7> Oops, range(len(your_list))
<4> ironfroggy: it needs to run on apache :(
<7> But well, that doesn't work yet at least :D
<7> *slap* lambda k:k[0]
<2> kieranDOA: no it doesnt! tell me why you think it does.
<6> AKX, not only it does not work, I do not even understand what it does (yet) :-)
<7> Heheh
<11> sorted(ints, key=lambda x:abs(wanted-x))[0]
<7> Juhaz, that's neat
<6> damn that is neat
<7> That's... really neat
<4> ironfroggy: Because my hosting uses it, i use it, and most of the server market uses it?
<2> kieranDOA: any decent server lets you run what you want. python-hosting.com, for example.
<2> kieranDOA: this is just the state of python web development right now. the emphasis is strong on pure-python solutions and avoiding apache and the like.
<6> hm, is sorted in python 2.4 only?
<11> yep
<7> Yes
<2> kieranDOA: and besides, like i said, CGI is horrible for ajax and mod_python is pretty poor.
<6> Juhaz, ah, this must run on python 2.3
<4> ironfroggy: still.
<7> Well, you can emulate sorted
<6> could you please explain the logic of the one liner so I can emulate it?
<7> def sorted(l,cmp=None,key=None,reverse=None): l2=l[:]; l2.sort(cmp,key,reverse); return l2
<11> python 2.3 doesn't have key either
<7> D'oh
<2> kieranDOA: im just telling you like it is.
<6> hm
<2> kieranDOA: but, of course, if you can create a decent python-over-CGI ajax toolkit, im sure some people would be happy for it.
<12> eleftherios: try the bisect module
<4> ironfroggy: Yea, thats fair enough, Its just ive always been a bit of a portability nut. i liek to be be able to run my code where and on what i want
<4> like *
<2> tying yourself to apache isnt portability. dependancies are the antithesis of portability.
<4> ironfroggy: im not tying myself to apache. as i said i want it to run on any web server with CGI.
<2> who uses CGI on anything but apache?
<4> ironfroggy: Just apache was my example why i didnt want to use a different server
<4> ironfroggy: i know a few that use lighthttpd for instance.
<6> ChrisLong, I'll read up on that, thank you
<11> eleftherios, it doesn't have much of a logic, key is the key. key extracts the argument that is used for comparison before sorting
<2> kieranDOA: i dont want to use it, but like i said a python-cgi-ajax toolkit would surely be welcomed by those who would want it.
<4> ironfroggy: You have a valied point and its great to hear other peoples opinions :-)
<2> id like to see what you come up with then.
<6> Juhaz, yes I see
<13> Hello.
<11> def closest(ints): ints2=ints[:]; ints2.sort(lambda x,y:cmp(abs(wanted-x), abs(wanted-y))); return ints2[0]
<13> I wonder. Is there some simple example that can fetch a file by using HTTP?
<4> ironfroggy: Dont expect much, i know 0 ajax and not all that much python :P
<2> good. less competition!
<4> ironfroggy: lol. there wasnt much in the first place, but im always up for a challenge :P
<0> hi all
<14> ehlo
<6> Juhaz, import bisect; print bisect.bisect(l, interger) gives the index of where integer should go. That solves the problem. Thank you for closest() though :-)
<11> ah, so it does.
<15> I would like to prefix each line in text with a space, is there a cleaner way to do it rather than; ' ' + text.replace('\n', '\n ')
<14> how do i check which version of pygtk i have?
<2> cr3: why are you postfixing a space at the end of the string as well?


Name:

Comments:

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






Return to #python
or
Go to some related logs:

failed discrete math course
XMFFMPEG rpm
lowkey site:www.quotesdb.info
ubuntu.avi
asus p5a gparted
.dmrc fc5
xpad cedega ubuntu
#asm
Mail gets rejected postfix Comcast
install fontconfig-config ubuntu



Home  |  disclaimer  |  contact  |  submit quotes