| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Comments:
<0> need to find time to configure this vim <0> :) <1> but one tab is easier to type ;) <0> make your editor insert 4 spaces when you press tab <2> one tab is easier to erase :p <3> eleusis, right - which is why I *always* type tabs - but my editor *always* inserts four spaces ;-) <1> set softtabs or something <0> make your editor erase 4 spaces when you press backspace... <1> ah <2> not all editors give that possibility <1> list comprehension <1> i find it cool now :P <4> what I do is when editing python I have my editor set so that tab is indent and backspace is dedent <3> myouko, my editor (and by "my" editor I mean IDLE, Leo, SciTE and everything that uses Scintilla (SPE, Boa Constructor), Eric3, in fact every self-respecting editor) supports taht, too ;-) <4> TFK: everything that uses kate also does it <0> scintilla isn't bad
<0> but I like how vim allows you to delete a line with dd :) <3> If you can't fight them, join them ;-) <0> just that makes it worthwhile <0> no other feature :) <2> i'm using vim or komodo. very happy with both <4> genia4_: in most of the editors you can use ctrl-k to wipe a line <5> what's komodo? other than a dragon <0> dd is more fun :) <2> komodo is an IDE from activestate <5> ah <0> komodo is heavy <0> because of XUL <5> vim is all I need <0> gvim is nicer at times <5> with its python support, anything goes <4> I like kdevelop3 <2> komodo is lightweight compared to eclipse <2> cream is very nice <4> myouko: oracle is lightweight compared to eclipse ;) <3> genia4_, oh, and don't name your variables 'file' or any other built-in name. <0> oh <0> good idea :) <0> for file in files makes sense though :( <5> bah, the vim currently installed is compiled with -python :( <2> can you really compare a database server with an IDE? <6> I have 'Β' how to make it char via python? <2> ah, now i see your point kosh :p <1> no <7> nkour: chr(914) <2> everything is lightweight compared to eclipse :p <1> myouko: what's the point? <1> ... <6> loufoque, thx <3> loufoque, eh? <2> *pats eleusis* <6> TFK, loufoque, another solution? <7> nkour: no it doesn't work <6> ok hit me ;P <1> woo, condescension <3> Err, yeah. there's an htmlentities module somewhere. <7> nkour: unichr(914) <4> myouko: my point is that if you define eclipse as your standard just about everything in creation is lightweight <7> nkour: that looks like some kind of B <7> <6> yea <6> strange I can't just 'full of those'.decode('html') <2> kosh, i understood that :) <6> loufoque, or perhaps I can? as I have a full setence of them <7> well you could replace them with a regex <6> loufoque, ok I'll do that <6> thanks <4> myouko: kind of like when you define IE as your standard for security even tissue paper seems pretty tought stuff ;) <2> haha <8> how can i write the current day on the form "Thursday" with python? <8> i would like to print the current day <7> vali: http://www.python.org/doc/lib/module-datetime.html <8> found it here http://docs.python.org/lib/module-time.html <9> I'm p***ing a list to a 'def' and want to set it to [] there. But it seems to operate on a copy. Is it because the list is mutable? How would I p*** it "by reference" so it gets changed in place in the 'def'? <10> def clear(x): del x[:]
<2> default arguments are only evaluated once <4> ChrisH: can you paste the def line? <3> ChrisH, ***ignment only affects the current scope. <11> gang, ok <12> anyone use pyvnc2swf? i'm getting an error that I don't understand. <9> kosh: Sure... looks a bit like: http://pastebin.com/569054 <9> idj: That worked well. What's the difference between "del x[:]" and "x=[]" then? Do I accidentally create a new list? <3> You can't p*** references to variables/names, like you can in C. So, >>> a = [42]; b = a; b = ["new"]; print a, b <3> [42] ['new'] <3> It's not accidental at all. <4> ChrisH: the problem in that example code is that when mylist = [] is run it just rebinds the name to a new value <10> Chrish: what kosh says <9> TFK: Ah. Okay. But isn't the list mutable and should be able to be changed? I understood if I created a new string since it's immutable. But lists? <3> del x[:] changes the actual object pointed to by x. <12> pyvnc2swf error: http://deadbeefbabe.org/paste/2981 <11> with a compiled regexes .group(n) - is there a way one can get back *all* instances of the group which matched? <9> kosh: So I lose my reference... okay. Takes a bit getting used to. <3> ChrisH, sure - but ***ignment is merely rebinding names/variables to other objects. x = ... rebinds x, but x.append(5) or del x[:] mutates the object pointed to be x. <4> ChrisH: the problem is not mutable vs immutable the problem is in your understanding, in python variables are just names bound to object, whenever you do a = something you bind the name a to something <11> (context: returning a list of all bootables in a grub.conf) <4> ChrisH: so = is not really ***ignment it is name binding <9> kosh: Yes, you are right. I was used to think perlishly where I p*** a variable by reference and never lose that reference. But of course... <9> Thanks for the enlightenment. Sometimes you fall into old traps when you think the "everything is an object" paradigm is still hammered on your forehead. :) <0> how do I convert a set to a list? <9> genia4_: mylist = list(myset) ? <4> list(someset) <0> thanks <3> But everything *is* an object :-O <4> TFK: they are all objects however names for an object are not the same as an object <4> ChrisH I mean <9> TFK: I better don't tell that to my wife. :) Although she programs in Python, too. <9> kosh: Similar to my closet... things are always there... it's just sometimes hard to find the reference. <3> Heh... well, keywords aren't objects as well... <13> how can I set/update a value of a dictionary? <14> anyone use PIL that can help me out? <4> somedict[key] = value <2> mydict["mykey"] = myvalue <10> ...mykey need not be a string... <2> well, the key can be any type, not only string <3> it can't be a list <15> ['lol'] mhm i must remove [''] <15> mhm <13> myouko, double quotes required huh :-) <16> guys, i've registered for PyCon, but i won't be able to attend, and i would like to offer my registration to anyone who would be willing to travel to dallas, tx on short notice. <2> indigoblu, eh? <17> Is it possible to plug a WSGI compliant webapp to a CGIServer ? Why isn't there a BaseWSGIHTTPServer or something along those lines ? <0> how do I force python to check a script before trying to execute it? <13> myouko, just noted that you must enclose key name in double quotes... <15> ['lol'] mhm i must remove [''], who know how? <2> indigoblu: i just tried with single quotes and that worked fine <18> is there a way to switch all stringvars to utf-8 encoding? <15> u'string' <15> python -U <13> myouko, wow okay, ... i was trying w/o qoutes for a bit, thanks :-) <19> !java <18> python -U ... hmm, but there's no python command for that?? <19> oops, sorry (split window mistake :)) <15> u'string' <18> hm <18> or to put it another way - is there an easy way to switch all strings in a dict to utf8? <18> the framework i use uses "normal" strings all over the place and i don't want to fiddle in it's source - so i try to solve the problem on my end, in my code <3> derelm, in what encoding are they now? <20> http://www.geohive.com/charts/charts.php?xml=en_oilprod&xsl=en_res <20> so <20> woops <18> i guess local - that is latin1, i think <20> haha wrong channel sorry <3> derelm, are you using anything outside the ASCII charset? (0-127)? <18> well yes, german umlauts (i think these are somewhere > 127) <3> Well, one way is to open these files in an editor and store the entire file in utf-8 encoding :-) <3> there's also a way to tell python the file encoding, it's in a pep somewhere... lesse... <18> wait <3> http://www.python.org/peps/pep-0263.html <18> well i am retrieving my data from a database - so it's not really about umlauts i use in my python files or in files i open
Return to
#python or Go to some related
logs:
remove sess_ linux
#math #gentoo #php does opengl need to be installed to run compwiz Suse Online Update Configuration does nothing postfix + system-wide sa-learn postix master.cf cleanup_service_name ubuntu glib anjuta #python
|
|