| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10
Comments:
<0> hello. anybody in here using the eiphany browser? <0> i need to find how to open a url in a new tab using the python console. <0> i 've spent so many precious hours with this damn thing :( <1> man epiphany and os.exec()? <2> how do people typically make 'interfaces'? just make a cl*** with empty methods that throw an exception or something? <3> is using 'index' a bad choice for an identifier? <4> why woudl it be <2> Cowmoo, I would think his concern would be name clashes <4> ya <4> it's not <0> RandolphCarter, Wouldn't there be a a way to do this from within the python console? dir(window), for example, gives so many attributes that I have a headache. <3> I prefer to use it e.g. for index, item in enumerate(seq): print index, item *but* was told using index as an identifier is a bad idea *but* I didn't get any further explanation... I tried searching on it but no where can I find using 'index' to be a bad identifier <5> charles`: you mean interfaces in GObject ? <5> charles`: uh! wrong channel, nvm <2> ptlo, heh <4> well ***uming you're not from module import *'ing, I think should be ok
<4> *'ing everything, that is <1> DaHood: not entirely sure I get your meaning, but if you're aiming for epiphany only, I'm guessing you're not going for cross-platform (or even cross computer) compatibility? <6> hm is there a lib to sort unique on lists, discarding duplicates? <1> DaHood: I meant there's probably a command line for epiphany that'll tell it to open a tab in an existing window, and you can call it using os.exec() <0> RandolphCarter, yes it has one. I was just wondering about its internal python functions. os.exec does it absolutely fine. Thanks <6> er, not lib, method, ugh <1> DaHood: ahh, okay - in that case, sorry, I've never worked with Epiphany's APIs :) <1> Gambit-: would frozenset() do what you need? (the output list is immutable) <1> hell, do set(list) do get a mutable one :) <6> Uhm, na, I need the output list to be mutable. Basically I'm just trying to remove duplicates, I guess I could do that in process, but I don't see how frozenset does that...? <2> let's say I have a method, x.blah(self), and then I do a = x.blah and then a(). What gets p***ed in for self? And if it is x, where is the reference to x stored in a? <6> man ok the docs for frozenset don't do it a bit of justice <1> Gambit-: this is true, there's set() if you want a mutable set <6> RandolphCarter, list(frozenset(foo)) tosses out a list, that's peachy. <1> that is peachy ^_^ <6> hm interseting, I don't even have to sort it. <1> Gambit-: I'm not sure the sorting is guaraunteed for sets in python <1> by their definition sets aren't.. <6> well a) I'm using a list, b) I don't care about the sorting, it was just an interesting side effect. <1> ahh, okay :) was just a heads-up not to rely on it <6> yeah, no worries :) <0> RandolphCarter, hmm I think I have a problem with os exec... How is the following executed? ' epiphany --new-tab http://www.example.com/ ' <1> DaHood: sorry, execlp should do it os.execlp("epiphany", "--new-tab http://www.example.com") <0> RandolphCarter, I tried execv and execl. It opened just a new browser window. The same happens with the above line of code... <1> I guess that's an epiphany problem :) <2> what's wrong with this: cl*** a{ def b(): print 'a.b()'}; b = a.b; b(); <2> (substitute in proper indentation and newlines for the {'s and ;'s ) <1> charles`: 'unbound instance' error? <7> anyone know where i could find an english dictionary for python? <2> RandolphCarter, yeah <0> RandolphCarter, os.execlp("epiphany", "--new-tab", "http://www.example.com/") loaded the url I put there, but in a new window. Thanks a lot for the help so far, but I'll quit with this. this has been enough for today with the epiphany stuff... <0> bye all <1> charles`: you need a parameter to accept the cl***, and stick @cl***method on the line before def b <8> I need some help, for some reason I can't remove from a list: www.agilman.org/sudoku <8> hmm, anyone here from ALexandria ? <9> Hi! I'm having a problem reading a file. What I'd like is a construct that allows me to read one line at a time from stdin and do something with it. I've set f = sys.stdin, and then I construct a while-loop: "while len(line = f.readline()):", but when the first line is read it says: "TypeError: len() takes no keyword arguments". What gives? Clearly, I'm a newbie. :-) <10> hi <9> Do I really have to do a "while (1):" and the break from inside the loop then len(line) is 0 ? <11> shawarma, you can't do ***ignments in a while test <11> shawarma, specifically, an ***ignment is, unlike C, a statement, and while takes an expression. <11> arguably, there should be a do construction. <11> but what you want is something like <11> for line in f.readlines(): <11> process(line) <9> f.readlines() doesn't return until it has read the entire file, does it? <9> Or is it perhaps some sort of generator? <9> No, it would appear not. <9> the same seems to hold true for the "for line in f:" construct. <10> anyone can tell me a way to check if a executable is within the path, without executing it/knowing what executable extension it has (atm only .exe or "" are possible) ? <9> tic: Anyhow, thanks for your hints. I'll go for the "while (1):" thing and break out of it if the line read has len == 0. <11> shawarma: "while True", you mean? <6> hm I have two lists that I want to iterate over together, something like for i,v in left,right: ... what's the right syntax? <11> shawarma, no parens required, while isn't a function. True and False exists in Python. <12> gambit use zip <9> tic: *G* Yes, of course. <9> tic: I DO come from a C background. It clearly shows. :-) <6> VladDrac, I have to keep them in seperate compartments, though... I thought of zip, and I don't want them into the same object. <10> :( <2> range can only have two arguments right? <6> start and finish, that would maek sense to me :)
<10> it also has step-size - so u can use every n-th number only <13> hi all <13> is anyone here using yapps2? <2> n/m <13> i'm having a problem with it: at some line, it says it's looking for a set of tokens and it's pointing to one that is in that set, but somehow it doesn't see it <12> gambit zip() will of course copy the lists into a new, combined one, it will not change the originals <12> so I don't see what the problem is <6> VladDrac, because my logic deals with only one list, and I'd like to walk the second list -- which may or may not exist -- in parallel. If it doesn't exist, then zip() will blank it all out. I could create an empty list of the right size, I suppose. <14> map(None, L1, L2) will use None when L2 runs out of items <12> I was just gonna say that :) <6> hm well that's not what I was hoping for either, but I'll take a look. <15> Hello, I'm wrapping a C++ library in Python using Boost.Python. The library uses a lot of libsigc++ signal variables where the application programmers can register callbacks. What is the best way to wrap this in Python? <11> don't know, but have you looked at SWIG? I know there's callback support there. <15> I have looked at it, it seemed to require writing interface files in some obscure language. <11> most often you can get away without writing much. <11> definitely less typing than boost.python. <15> I use pyste.py, so for most files it's just "AllFromHeader("myheader.hpp")" <11> aha. <11> basically the same in Swig. <11> in fact, it is, when you give the -include flag. Or you can just do an %import myheader.hpp <16> hi there <16> i have a simple question.. how do i compile a .py application that uses gtk? <16> any help? <1> Pretto: gcc it until it bleeds <16> RandolphCarter: can you be more clear??? i am a beginner <1> Pretto: you probably just need your platforms python bindings for gtk <16> i am using ubuntu linux RandolphCarter <1> Pretto: if you're using debian/ubuntu, that's python-gtk2 <1> Pretto: aptitude install python-gtk2. if it doesn't work, check the programs INSTALL file (you can't have got it from apt, or it would've fetched the gtk lib for you) <16> RandolphCarter: i can run it... i am thinking about compilling it so no one can see my code <17> Pretto: you cannot. <1> Pretto: freenode probably isn't the best place to ask that? <17> doesn't matter where you ask it; it's always fairly trivial to get the source code. <1> you could obfuscate it into hell and back, but you can't compile it all <16> RandolphCarter: ok.... open source stuff :) <18> Pretto: http://twistedmatrix.com/wiki/python/PythonFaq#head-432da7b2959afaef19c6bb05e862fd9fa46ad0be <16> thank you Chairos <19> mm, what about applying pypy's translation process to python modules(unlikely to be trivial by any means).. <19> Also, you could look at pyrex. <16> thank you so much folks <16> i gotta go <20> bye <19> bleh, jython doesn't do __file__, and pypy doesn't do __file__ like cpython. <20> Hello, I searched in Google about downloading files with Python but I don't seem to find anything. Can someone refer me to a good guide/documentation/tutorial of how to do that with Python? <21> try urllib <20> Hello, I am sorry. I was trying something with urllib and my pc crashed (literally crashed). Anyone told me something about my question? <4> nothing beyond trying urllib <4> (there's also its sister urllib2) <20> I can do the same with both? <22> dashinho, urllib2 is much better... <20> I guess I need to google more. I just didn't find anything about how to do that :( <22> dashinho, urllib2.urlopen(url) <23> so is it true that you can change a list inside a function but not a string <23> def f(a,b): a.append('yay'); b = 'boo' <23> c = ['yea']; d = 'foo'; f(c,d); print c; print d <1> strings are immutable <1> lists are mutable :) <23> right. c++ strings are also immutable but you can replace variables <23> and if everything is p***ed by referrence in python... <23> see what i'm saying? <1> but if a string is immutable, and it's p***ed by reference, when you try to change it you make a copy <1> which is local to the function <23> so i could just use a length one list. is that considered evil <1> can you not return the value? <23> i can but it actually seems non-sensical to do so, if i'm not returning some lists and other things i change in the function <23> seems like python couldn't decide if it wanted to be side-effects-less or not :) <19> dancor: nah, it's very "side-effecty" ;) immutable strings and tuples were probably made for different reasons than making the language more side-effects-less. <22> dancor, not exactly p***ed by reference... "p*** by name" fits better <23> jwp: true. i think they have to be to be dictionary keys <19> there's an array module that provides "mutable strings". However, unresizeable, iirc. <23> werneck: yeah, i guess that's the surprising part of python to me <22> c++ you can replace the variables, but in python there are no "variables" in this sense, storing values... just names for objects... <23> i just run into an interesting situation when i have a function that changes a bunch of list variables, and then i want to add a string to it. <23> to the variable list i mean.
Return to
#python or Go to some related
logs:
intel corporation 82801BA/BAM/CA/CAM linux driver ssh strict mode file permissions
ubuntu automount usbdisk ut goty rendering cheat #dns #postfix how to add default route static-routes centos gentoo mscoree ubuntu nohup: appending output to `nohup.out' #xorg
|
|