#apache #archlinux #asterisk #centos #debian #gentoo #haskell #kde #kubuntu #lisp #math #mysql #perl #python #ruby-lang #rubyonrails #suse #ubuntu #vim #wikipedia 0 1 2 3 4 5 6 7 8 9 
Top Prev 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 Next

#python

<toma^> VladDrac: I can relate about building the wheel always again. But...
<Juhaz> well, you could always distribute a known-good version along with your app.
<fluxdude> I want to split a line at the spaces to get the second column but this "string".split(" ") gives me a list with loads of "" entries of varying size in between the first and second columns
<fluxdude> how should I be doing this?
<fluxdude> I'm thinking that perhaps regex would be better?
<neil_d> I am using a gtk.CellRendererText with a gtk.TreeViewColumn, when I change the 'wrap-width' of the renderere, the text is redisplayed with the new width untill the mouse passes over the affected cell, can anyone tell me how to get all the cells to rerender auto matically ?
<fluxdude> what's the best way of getting the return code of a command when doing os.popen()
<fluxdude> should I use subprocess and does this return the exit code?
<fluxdude> I know commands.getstatusoutput()
<fluxdude> does but it's also deprecated
<fluxdude> ok never mind I'll just use the new thing
<toma^> can I create global variables dynamically? Or it doesn't have to be global either, just to some specific namespace. So I could execute someClass.someMethod() and it'd create a new variable which would be accessible from everywhere
<toma^> all the examples have introduced the global var before accessing it
<glen_quagmire> def get_global_var(): #some factory code here?
<pjd> fluxdude: subprocess.call returns the exit status
<marienz> perhaps just use setattr on some convenient instance
<pjd> and Popen instances have a returncode attribute
<pjd> toma^: you can assign to the module object directly
<pjd> or get the current module dictionary with globals()
<Ksero> tome, but if you know the name of the global you want to introduce, you can just use the "global" statement
<Ksero> *toma
<epifanio> hi, i'm tring to translate a octave script to python language, every everything works fine but i've an error about a for statment, can anybody help me ?
<Ksero> epifanio, Hmmm... that's not easy to answer...
<toma^> pjd: Great, it seems that globals()[ name ] = stuff works. Thanks :)
<pjd> toma^: what are you doing that needs this? :)
<marienz> epifanio: if you provide more information that is likely
<Ksero> toma^, Personally, I think you should use a global dictionary instead of modifying globals()
<pjd> it's not something you should have to do in general
<epifanio> can i post the two script, octave + python translation?
<toma^> Ksero: so how would I do that?
<marienz> epifanio: on rafb.net/paste or a similar site, certainly.
<pjd> http://deadbeefbabe.org/paste
<toma^> just global[ 'blaa' ] ?
<pjd> toma^: what are you putting in the dictionary?
<Ksero> at the top of the script, mydata = {}; when you want to set the data, mydata[name] = stuff
<toma^> doesn'
<toma^> pjd: new variables :)
<toma^> pjd: I know that this is hacky but I can't figure out any reasonable way to do it ;)
<pjd> you can't put a variable in a dictionary :)
<pjd> you can put an object in a dictionary, though
<pjd> toma^: well, explain what you're doing :)
<toma^> pjd: Well, like you might remember I'm still doing that sql-thingie where it'd be great if the node would know it's references name ( it's convinient like that ). So I thought that when you give the name to the class constuctor it also introduces a new reference to the object which is named after the class name
<toma^> hack hack ;)
<marienz> wait, in globals()
<marienz> ?
<marienz> why is that in globals()? I think I'm not following.
<neil_d> can some one tell me how to get all the cells in a GTK treeview liststore column to re-render ?
<pjd> toma^: there's almost certainly a way to structure that better
<toma^> marienz: if that was directed to me: Yeah, I use interactive prompt my prog, in the similar way that matlab does. You know
<marienz> bleh, nvm.

Previous Page  Next Page

Search ircarchive.info