| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Comments:
<0> bulio: it's possible to fill a dictionary with functions and use the choice to index into it - but it's messy and, I think, unpythonic <0> chzmgr`: sorry :-) <1> hello there <2> I just want to get a grasp on python <2> do all the functions etc. <2> that way I can move on to GUI stuff <3> np, i need to learn these things :) <1> parker`: i've done it :P, it's not fully implemented nor fully optimized yet, but it works :D <4> BloodyShade: ? <1> parker`: the random drop and options thing ^^ <5> Im building a list and then setting the items, but for some resion the returned list in a for loop, gets to the end and raises an Index error <4> BloodyShade: What are you talking about? lol Are you getting me mixed up with park? <5> This is odd because the list is the right size <2> hrmm <5> and C code knows its the right size.
<2> what would be good to program to learn funcitons? <6> _ideasman42: even taking into account zero indexing? <5> yes <1> parker`: lol, throught it was him, but something like away or such :/ <6> bulio: some functions <6> :) <5> 0-6 7 in length. <1> parker`: sorry <4> BloodyShade: No problem :) <6> _ideasman42: make sure you're not ever trying to access thelist[7] <1> cl***es are so great ^^ <2> but what kind of programs uses functions? <5> dijix: nope. its a for loop <1> bulio: every kind of programs use functions Oo <0> bulio: almost any program in the world <5> thats teh odd thing. The error is on the loop. <5> for a in b: <-- error index out of range. <7> the program not using a function/cl***, is not worth to mention =) <5> Like I might be missing out on setting one of the items. <1> _ideasman42: could you pvt me with the values and the loop? <5> hold on pastebin <1> no need, just pvt to me <0> Noet: there are programming styles/languages/paradigms which don't use functions :-) <1> ./query BloodyShade <5> http://pastebin.com/574278 <2> can someone show me a simple prog with a function? <5> Its a Blender3d API finction <1> _ideasman42: ok let me see it <7> LeedsHK: well, i wouldn't wanna maintain that code =) <1> Oo <5> ahh ****. Commented as python! <7> if it doesn't contain a single function call, and/or creating own cl***es/functions. <5> if its any easier to read- http://pastebin.com/574281 <8> bulio: uhh, raw_input() is a functino <9> Good Night everyone =] <2> I mean functions like def areaSquare <0> bulio: http://rafb.net/paste/results/W0cj4O52.html <1> omg, it's higher than my knowledge about python for now hehe <0> area really is too trivial to be implemented as a function, but that still shows the point <1> btw i see no for loop there <7> area is even to trivial for a lambda =) <10> bulio, http://wiki.python.org/moin/BeginnersGuide <3> can anyone recommend a good book on python to someone who has good programming experience already, and knows a bit about python but wants to learn a lot more? <5> Line 30 <1> it's a while :P <8> chzmgr`: diveintopython.org <5> Just found the bug. somebow index is going up to 14. <5> BloodyShade: I ment a FOR in the python code <3> ooh, thanks <5> the error is in the python code, <5> C compiles fine, <1> .. <5> looks like PyList_SetItem increments the index? <5> hrm... guess not.. just tested that <2> 1.Calculate length/width <2> 2.Exit <2> 1 <2> Invalid choice. Exiting now <1> _ideasman42: i have no idea sorry :( <1> bulio: put the code in pvt <6> raw_input() returns a string
<2> pvt? <5> I thinkl I can worjk it out from here. <1> int(raw_input("Choose: ")) <0> BloodyShade: it's on the pastebin <2> oh, convert it to int <1> LeedsHK: where <0> http://rafb.net/paste/results/e38eJL80.html <1> the bad part when trying to help ppl, is when you don't know much too :/ <2> works now <1> i think converting to int solves the problem <2> but what is the point of def area(x,y): <2> return x*y <1> ahh, learn to use try...except it's easier <8> bulio: have you done a complete python tutorial yet? <2> http://rafb.net/paste/results/3b4SXT90.html <2> Jerub: most of 2 <11> where can I find documentation on BaseRequestHandler's "request" instance variable? <12> google <11> zanella: already searched, all references don't document this. they don't even document the individual functions supplied by BaseRequestHandler <13> bulio: you're asking absolute beginner programmer questions. You need to sit down and read some beginning programming material <1> bulio: look at your pvt <2> what is pvt? <4> bulio: the def like defines the function area that takes two parameters(x and y), and whenever the function is called, the function sends back x * y, which is the basic area formula <4> like = line* <2> see you all tomorrow <1> see you <2> thanks everyone <1> is it possible to list receive cl***es items as values? <14> are there any libs to do ASIO in python? <1> like cl*** item: name = ""; sword.name="Gladius"; list = [sword] <15> someone can give me the way to have a term output in color with python , is there something to do that? <7> christor: that is OS specific. <7> \033[_color_m something on linux <15> Noet: ok <7> on win32 i'm not sure. <1> on bash it's like \e[1;32m something like that <1> I forgot :/, about one year away from my beloved debian :P <7> is on linux like 24/7, but i dont have the urge of changing colors directly ^^ <1> i used a nice .bashrc PS1 and PS2 settings, but lost it >< <7> i have made my own <1> yes, me too, but i've lost it >< <1> it was something like -=(bloody)=-=(~/projects)=-\n $ <1> but with colors <7> PS1='\u\033[36m@\033[m[`pwd`] > ' ^^ <1> hehe <7> its nice to see the path all the time. <1> kinda simple :) <1> yeah, harder to get lost <7> yeah but i dont need anything advanced. I spend most my time either programming or at irc anyhow. <1> i see, i compile lots of stuff, so everytime i was using bash hehe <1> btw, do you know what i've asked? <7> "[04:02] < BloodyShade> | like cl*** item: name = ""; sword.name="Gladius"; list = [sword]"? <1> yes <1> is it possible? <7> Have no idea of what you are trying to accomplish there tbh <1> p*** the list to a for loop, otherway i'll need to p*** item by item, and it will consume lots of cpu time and human time hehe <16> Heh, looks like what I've been doing for fun-- a mud object model. A bit more crude but same basic area. <7> BloodyShade: i dont know to much python, but.. to make a list of something, dont you MyList = list(...) <17> hellow <1> parks: now it's you <1> Noet: it's another thing ^^ <17> BloodyShade ? <1> parks: i've done the random stuff thing, but it's not very optimised <17> BloodyShade oh <1> parks: tought parker` was you <1> hehe <4> BloodyShade: I am! <4> heh jk <1> could i send it for you to take a look? it's crappy btw, but functional <15> what means if __name__ == '__main__': <17> if i have a list that contains None's, why doesnt map(str, el or '') replace the Nones with an empty string? <1> parker`: Oo <17> christor if the python script is being called directly <17> then that if will be true, otherwise false if the script is being imported
Return to
#python or Go to some related
logs:
no WPA/RSN proto match frostwire .bashrc Unable to lock the list directory synaptic ubuntu ubuntu detect wlan0 lspci -ndiswrapper linux kernel 2.6.15 mem leak dpkg –purge mysql-server [Errno -1] Metadata file does not match checksum FC5 hdparm + enabling dma on dvd writer + gentoo what application is listening #gentoo
|
|