@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19



Comments:

<0> TFK: how and if it isn't how do I install it ?
<1> dec0ding, i dont know python... sorry... im beginner..
<0> k
<2> I have no idea. Find it first in google. It may be part of the package system.
<2> das_netz, you have a bunch: http://python.org/doc/2.4.2/ref/strings.html <--- u means unicode
<3> have a question, i have a button with a ICO of GTK and i change the label of button with self.button_name.set_label('example') and the ICO its removed :S i wanna cant remove the icon, only the text... how i can make this ?
<3> PyGTK + GLADE
<2> tark, containers are totally generic in Python, with a few exceptions (but those are made pretty clear). The interactive interpreter is a great place to answer such questions, btw.
<1> TFK, thanks
<4> workaround:
<4> for i in Packages.sqlmeta.columnList:
<4> if i.dbName == 'cache_package_description':
<4> i.dbName = '_cache_package_description'
<4> Jerub: patches require understanding. workarounds require brute force and a violent determination :-)
<5> morning
<3> zz bye



<6> Hello everyone
<6> If i have a cl*** X, and a = x()
<6> what method is called when i do, x=5??
<6> what methos is called when i ***ign something to that object
<6> ?
<7> no method is called at all
<7> the x is a variable name only, and using the = operator on it rebinds it to the value 5
<6> that meand that if x is a some cl*** variable and i set it to 5, for example, the var will become an integher?
<7> for short, yes
<6> weird, i'm new to python
<6> how do i get a float from x/y?
<8> hello guys
<9> dpt: uh, here's a reference. please make sure you follow the instrutions in the introduction
<6> if i do 3/2 I get 1
<9> http://effbot.org/zone/python-objects.htm
<10> dpt (1.0*x)/y maybe?
<7> dpt: int/int -> int, int/float -> float, so x/float(y) -> float
<9> dpt: that's only in python2.3, python2.4 3/2 == 1.5, 3//2 == 1
<6> ok, thanks.
<2> well... ***igning to an instance attribute is trickier.
<9> crap
<6> >>> print 3/2
<9> I'm wrong
<6> 1
<9> python2.5 is 3/2 == 1.5
<6> Python 2.4.2 (#2, Sep 30 2005, 21:19:01)
<9> from __future__ import division ; to get the new behaviour
<7> no need to introduce tricks when learning about basic names :)
<7> Jerub: i wonder when that *is* going to go in? it's been debated for years ..
<9> :(
<2> True.
<6> do i have to write float(int) to get common divisions everytime i make an operation?
<6> is there anyway to change this so that x/y returns decimal like in most programming languages?
<5> x // y
<9> dpt: from __future__ import division
<6> x//y return integer
<6> tlet me try
<9> dpt: and btw, this is the behaviour you'd see in C or Java.
<9> :)
<2> ...and C#.
<9> I wonder what languages actually do give you a float when you divide two ints.
<6> thanks, that worked
<11> must be an Excel user
<5> matlab
<2> Python :-P
<7> schemes and lisps
<2> (well, modded python, but still)
<12> but not in Common Lisp!
<6> yeah, i know java but i'm learning python
<11> lisps give rationals surely
<13> Javascript.
<6> do you know a simple but still good document about creating guis?
<9> http://www.python.org/doc/Humor.html#yeahright
<14> hm
<5> dpt thats a pretty broad subject
<5> dpt anything specific?
<14> x // y is returning an integer
<14> here
<5> Cowmoo yes, im an idiot
<15> how can you test in python if an object is a sequence?
<16> dpt, design or actual implementation? Did you have an API/Library in mind?



<14> parks: it was in response to dpt's "thanks, it worked" :)
<5> danderson type(x) == type([])
<15> something like, isinstance(o, sequence) ?
<15> ah.
<15> thanks
<6> i want to make simple desktop apps
<14> dpt: are you sure that worked? x // y?
<6> that's what i want the document for
<16> dpt, I quite like Gtk, though Tk might be easier for you to learn.
<6> x//y returns integer, afet import.... x/y returns float
<6> give the easy first and i'll other on other stuff later
<6> gtk y gnome native widgets set, isn't it?
<14> right
<14> k
<5> dpt i used a designed for qt to make apps under windows
<5> trying to remember what it was called
<16> dpt, yes. It's cross-platform so you can use it in windows too.
<6> do you have a link for that?
<16> dpt, for Gtk?
<16> dpt, www.pygtk.org - It actually has a pretty good tutorial, a Python rewrite from the original Gtk tutorial.
<5> pythoncard thats it
<5> wx
<5> http://pythoncard.sourceforge.net/
<6> ok, thanks
<6> i'll read it
<6> python creates native guis?
<16> Gtk is native for me :)
<5> dpt, wx is a cross platform wrapper around native gui's i believe
<17> hello
<6> i do not see any tutorial in pygtk
<16> dpt, http://www.pygtk.org/pygtk2tutorial/
<6> i found it in spanish, my mothe tonge, thanks
<16> It's under the documentation.
<17> does anyone know anything about the decimal module
<11> don't ask meta-questions ;)
<13> shanenova: Someone definitely does.
<6> genre(%s), word(%s) % ( orword.split(" ") ) is the same as, y = orword.split(" ") , genre(y[0]), word(y[1]), or am i wrong?
<17> i am trying to square number plus a square of another number, then take the square root of the sum
<17> the decimal module always returns - InvalidOperation: x ** (non-integer)
<16> shanenova, you mean pythagoras?
<17> something similar to a pythagorean theorem
<6> i can call method of the same cl*** without self, can''t i??
<16> dpt, no
<16> shanenova, then how about 'math.sqrt (n * n + f * f)' ?
<6> thanks, i'll edit my cl***
<6> self.genre(%s), self.word(%s) % ( orword.split("") )
<6> anyone knows what the sintax mistake is?
<11> shanenova: use x * x for the square and the decimal.sqrt method
<17> I need it Decimal(context) so I can test if another variable == Decimal(context)
<17> the float() is inaccurate
<17> I was using Decimal(str(a**2+b**2)**0.5)
<18> is there a module/method for doing colored text in the console that is portable? (at least for *nix and Windows)
<18> I'm looking for something that is hopefully less "bossy" than ncurses, which manages the whole console real estate..
<17> thanks pythonologist and Alterego I will try it.
<19> TFK would I be able to use a dictionary to store buttons and a string from a list on the other?
<20> ENOPARSE
<20> You can store anything in a dict's value, but some limits on what you use for a key.
<20> mydict['mystring'] = myobject
<20> mydict[myinteger] = [ my, list, of, stuff ]
<19> thanks!
<20> mydict[(my,tuple)] = { my: dict }
<20> etc.
<21> Hey folks
<22> hari`: really? I thought Python would use id() on the keys, so it works for almost anything
<20> kjetilho, the key itself must not be mutable. Else id() would change its value over time.
<15> hmm, I have a list of items, and I need to remove all duplicates from that list. What is the most efficient way to do so in python?
<21> I'm here using mod_python and im not very happy with it. I am getting rnadom data corrupting my web page. Someones I get the complete output of the page (including headers!!)
<22> ah, right
<15> I can think of a few ways to do it, but none that use list comprehension or something similar
<22> danderson: if you can require Python 2.4, use a set
<20> danderson, when the words "unique" or "no duplicates" come out of your math, think 'dict' or 'set'.
<21> I was looking to port my application to scgi, but I want to see what others have doe
<15> kjetilho, hari`: thanks.


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #python
or
Go to some related logs:

subfont.ttf fedora
errror loading shared libraries ubuntu
#egghelp
#suse
#linux
#math
xwine + apt-get
argument list too lng rm
update whitelist_clients
ext2 recovery



Home  |  disclaimer  |  contact  |  submit quotes