| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
Comments:
<0> Yhg1s: there's no way to say that in `muirss --cli http://piano.juicemedia.tv/rss/pastebin.php' that it can parse that site into someting? but I also need it to return that it's using --cli... <1> pianoboy3333: of course there is. you parse the options (using optparse or getopt), and that will tell you whether --cli was specified. it will also give you the leftover arguments, and those will contain 'http://piano.juicemedia.tv/rss/pastebin.php'. <0> ok <1> pianoboy3333: for more specific help, show me what you have now (in the pastebin.) <0> Yhg1s: http://python.pastebin.com/743016 <1> pianoboy3333: 'args' will be the leftover args, so in your case, just 'http://piano.juicemedia.tv/rss/pastebin.php'. <0> ok <0> args is a list? <1> yes. <0> Yhg1s: so the best way is to hope args[0] is the site? <2> Which is the formatoption to format a dictionary eg "%?" % {[1:"abc"]} ? <0> Yhg1s: but how do I make sure that the user supplies a site? <2> solved <3> how do u test whether a variable is defined or not? <4> def file2table (table_argv , size , table): <4> algarismo=0 , endl=0
<4> File "<stdin>", line 2 <4> SyntaxError: can't ***ign to literal <4> why can't i do that to the second line? <5> kovan, "try: myvar; except: print 'not defined'" <6> semi-colon, not comma <1> holo: Python parses that as 'algarismo = (0, endl) = 0', and you can't ***ign to that tuple literal. <1> holo: try 'algarismo = endl = 0' or 'algarismo = 0; endl = 0' <3> soyt that's not very pretty, thanks though <1> kovan: well, the obvious solution is to always know that a variable is defined. <7> or algarismo,endl = 0,0 <1> kovan: usually by ***igning None to it at the start of your function. <3> ok <4> Yhg1s, thank you <6> Yhg1s: [ The parser catches it, though, if you the additional paren: a = ( (0,b) = 1 ) #==> SyntaxError: invalid syntax ] <6> (***ignment not being an expression.) <6> a = (b = 9) #==> SyntaxError: invalid syntax # All this lovely special-casing. <0> Wait, this is the coolest? Anyone ever play oblivion or any elder scrolls games? http://www.youtube.com/watch?v=UyHiIeBsc9E&search=oblivion%20book%20dominoes <8> hi <8> does someone use mod_python here? <6> Ygh1s: Have you played with the new AST-generator? <8> i'm having trouble configuring apache <9> Pythy: what special casing are you talking about? <10> does a cl***method always have to take an instance of the cl*** as a first argument?? <10> the interpreter complains <10> unbound method must be called with instance as first argument <11> squirrelpimp: Yes it does. If you don't want to p*** one, use staticmethod <6> >>> cl*** C(object): <6> @cl***method <6> def cm(cls, v): return v*10 <6> <6> >>> C.cm(100) #==> 1000 <12> excuse me people, what's wrong with that ? I __init__() a function and set a value in it : self.index=index; then I try to get it in another function of the same cl*** (having the self argument) : print self.index; it does not work <10> Pythy: why do i need the @cl***method thing? <12> I don't understand why. Did I miss somethig ? <6> "of the same cl***" > or did you mean instance? <11> Jojosan: And what is the error? What is the code? Are we meant to be able to read your mind? <12> Cerulean, thought it was clear enough <11> Jojosan: Not by a long way ;-) <12> hehe okay <12> here's pastebin <6> squirrelpimp: Just another way of writing <6> >>> cl*** C(object): <6> def cm(cls, v): return v*10 <6> cm = cl***method(cm) <12> http://pastebin.com/743089 <11> it's not the self.index bit that's the problem <11> it's the len(playlist) <11> shouldn't that be len(self.playlist)? ;) <12> "exceptions.AttributeError: Player instance has no attribute 'index'" <12> yep, also <12> I changed that recently <11> Is there a way to stop CherryPy from stripping off any character past a '#' in a URL? If I visit localhost/foo?p=bar#bar then CherryPy shows a request for /foo?p=bar in the console <6> squirrelpimp: You omitted deriving your cl*** from a new-style cl***. <12> Cerulean, with that correction, always the same error <11> Jojosan: Paste the whole traceback <11> (in a pastebin) <12> okay <6> squirrelpimp: or, you didn't tell Python that you want a function treated as a cl***method. <10> Pythy: what is a new-style cl***? <12> http://pastebin.com/743094 Cerulean <12> (wouldn't have pasted it on the chan :p)
<6> squirrelpimp: A cl*** derived from object or a new-style cl***. <11> any suggestions on why CherryPy is doing this? I attempted a couple of quick greps but couldn't find anything glaring <10> Pythy: this was indended recursion? <6> squirrelpimp: I refer you to my previous answer ;-) <11> curious. Are you sure Player.__init__ is being called? <6> Without that @cl***method or ... = cl***method(..) conversion, Python has no reason to treat your function as anything other than another method, <12> I'll upload the whole code <10> Pythy: but i still need to include (cls...) as a first argument? <12> on pastebin <12> http://pastebin.com/743105 <6> Python will put the pointer to the cl*** into that first parameter when you call a cl***method. <6> If that's not your intent, look at staticmethod <6> Both may be called off of a pointer to the cl*** or off of any instance of that cl***. <12> (it's based on the example echo server given away by twisted labs) <10> Pythy: kk, thanks... <11> Jojosan: Oh, silly. You're calling self.list_handle() before the constructor gets to work <11> place that call after you've initialised the variables in __init__ <11> and again, you've got an error on line 76 <11> self.playlist, not playlist. You do understand the concept of using self, yes? <12> yep <12> yep yep <12> just something I forgo <12> (before playlist was p***ed as an argument) <12> (to list_handle() <12> Cerulean, can you tell me where you've found that first flaw in the code ? <11> Jojosan: in the first line of your constructor (the __init__ function) you're calling list_handle <12> ah <12> found <12> yep, true <10> decorators look cool, is there a list of all possible? <11> you want to call that after your initialisation <12> that is stupid, indeed <12> yep <6> squirrelpimp: Any function can be used. <10> ic <13> hello <12> what you call a constructor is the __init__ function right ? <13> yeah <6> Cerulean: The part after the # isnt sent to the server. <6> Cerulean: Your browser keeps that, and uses it to position the window over the return page. <11> Pythy: Oh, gosh yes <11> I forgot it's the anchor symbol <6> Cerulean: (I know that feeling.) <13> hey guys, just wondering if anyone has had any experiance with v4l and python. I want to connect directly use /dev/video0 from my python app <11> not a fun feeling, especially when you've been wrestling with the problem for about 20 minutes <6> Cerulean: (Our programmer-intuition is to downplay any intelligence in the browser.) <14> Is there any way of putting a directory structure into a dict ? <15> sure <6> Another dictionary may be used as the value for a key in your dictionary. <15> or you can use pathnames as keys <14> yeah I know <14> just having difficulty writing the walk function to create the resulting dict <6> I think I like deltab's answer better. <15> it depends on how you need to access it <6> If you need to pull-out a sub-tree, you can use a nested structure. <14> I need to pull out sub-trres as well as contents of files <14> stored as a list of lines <6> Nested dictionaries would allow you to model the hierarchy of a disk-drive's directory-structure. <16> alasdair5, what kind of app are you writing ? <13> well i am quite interested in like robotic vision etc. so i want to have my webcam say follow my face, I have done some stuff with python and my webcamera with the VideoCapture module, but i would like it to be under linux <16> alasdair5, you should check out Istanbul (it's a Desktop video recorder) >> http://live.gnome.org/Istanbul <17> is it possible for a generator to have more functions than just .next()? <6> Yi: http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/164044 <12> people, do you have any idea on how using pyao with alsa ? <12> (some example code would be of great help :p) <17> Pythy: i wish activestate's would work :) <6> "pyao with alsa" > Tacobell? <6> Yi: Works here. <17> i just got a proxy error, but reloading seemed to fix it <18> Hello everyone. <6> Hello, Khmar. <18> I don't mean to troll but does anyone have some tips on customising vim to work well with python (especially indentation). We're having a devil of a time in our team. People insist on hitting SPC-SPC-SPC etc to get it right. <19> what is the fastest way to change encoding for whole dict ?
Return to
#python or Go to some related
logs:
/bin/sh: can't acess tty; job control turned off #kernel #css #lisp #kernel #asm can't load font x48 #css centos cyrus-imapd lmtp_luser_relay
#debian
|
|