@# 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:

<Yhg1s> ehm, no, that dun work.
<sapo> wow.. i knew that python would be my solution :D http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/362715
<Yhg1s> 'inst.__cl***__.__mro__' even
<eleusis> where 'inst' is the instance name?
<Yhg1s> yeah.
<Yhg1s> (well, the variable.)
<eleusis> (<type 'tuple'>, <type 'object'>) <cl*** 'Chalyx.spirits.ProxiedSignal'>
<eleusis> for some reason, at that point, it thinks it's a tuple or something
<Yhg1s> it looks lik you aren't subcl***ing from Chalyx.spirits.ProxiedSignal.
<sapo> python rox.. going for a reboot to test this toy :)
<eleusis> :-\
<eleusis> well, i did.. from Chalyx.spirits import ProxiedSignal, where XMMS2Signal is defined
<Yhg1s> eleusis: actually, no, you're right, the instance isn't an instance, it's a tuple.
<eleusis> from Chalyx.spirits import ProxiedSignal
<Yhg1s> perhaps it *contains* the instance you seek.
<eleusis> ...
<eleusis> cl*** XMMS2Signal(ProxiedSignal):
<eleusis> contains, eh
<Yhg1s> eleusis: what does 'repr(inst)' print?
<eleusis> hm
<Yhg1s> (or 'print repr(inst)' rather
<eleusis> doh!
<eleusis> (<Chalyx.services.xmms2.XMMS2Signal object at 0xb6bb01ec>,)
<eleusis> it's in the friggin tupple!
<Yhg1s> there we go.
<eleusis> that's quite odd
<eleusis> HAHAHA
<eleusis> i see what i've done wrong
<eleusis> i used to have a dict containing all those XMMS2Signals
<eleusis> then there was a bug and to get around it, i had to define the dict, then add the signals one by one
<eleusis> i left a comma after each XMMS2Signal(...)
<eleusis> that made them go into tuples :-\
<eleusis> such a serious headache
<eleusis> caused by 2 spurious commas
<Dougie_In_Scun> If anyone wanted the solution to my problem about finding the value stored in a variable in a checkbutton widget when you only know the widget instance name, i used: widget.getvar(name=widget.cget("variable"))
<eleusis> :)
<TimL_> hi, could someone tell me how to loop through a dictionary of objects? I get a "ValueError: too many values to unpack" error when I try...
<Yhg1s> iteration on dicts iterates over keys, not key/value pairs. you can do 'for key, value in d.iteritems():' though.
<donkeyboy> using win32com to start up a session of IE. is there anyway to access a form if it doesn't have a name attribute? can you access it from its action value? if so how?
<HeliosTech> hi
<HeliosTech> can we make a function pointer in python ?
<joedj> donkeyboy: try document.forms[0] etc..., i'm not sure which browsers support that, though
<tic_> HeliosTech, just p*** the name of the functin.
<tic_> function.
<HeliosTech> kul
<donkeyboy> joedj: Thanks, will give that a looks
<TimL_> Yhg1s: thanks for that, I have it working now!
<dut> Hello all! I have problem with curses module: Enter, Home, or other KEY_* isn't working, but when i press "q", my program breaking normal. This is my code: http://deadbeefbabe.org/paste/2912
<[PR]robinl1> hmm..
<[PR]robinl1> i'm making a file manager
<[PR]robinl1> but i have one problem.. how to go up a dir?
<ignacio> Not *another* one...
<[PR]robinl1> it's a special one
<[PR]robinl1> a command-line replacement for the ls and cd combination
<joedj> [PR]robinl1: os.chdir('..'), if that's what you mean
<[PR]robinl1> hmm
<[PR]robinl1> cuz
<sapo> hi, dumb question, how do i check if a var isnt empty?
<dut> "Enter, Home, or other KEY_* isn't working, but when i press "q", my program breaking normal" -- i mean when i try get user input.
<joedj> sapo: if var: ... usually (depending on what empty means)
<[PR]robinl1> http://deadbeefbabe.org/paste/2913
<[PR]robinl1> see that
<HeliosTech> from Tkinter import *
<HeliosTech> ImportError: No module named Tkinter
<HeliosTech> i don't understand
<[PR]robinl1> how to go a directory up that way?
<HeliosTech> does it mean that i don't have Tk ?>
<sapo> joedj, i m converting a string to int, but when this string is empty it gives me an error
<joedj> sapo: variables that exist always refer to an object, they are never 'empty'. the object they reference (e.g. a list/string/dictionary) may be empty, though
<stain> HeliosTech: yes, either it's a separate package you need to install, or if you compiled Python yourself, you will need TCL/TK and appropriate header files first
<stain> it's python-tk or similar
<joedj> sapo: you might be better off just catching the error; other strings can cause that error too, not just empty ones
<sapo> joedj, ok, i ll think about something
<[PR]robinl1> hmm so how to do that?
<joedj> sapo: if theString: theNumber = int(theString) will do what you asked, though
<chaouche> hello
<joedj> [PR]robinl1: when asked for a "File: ", enter ..
<[PR]robinl1> joedj: no its not that simple
<[PR]robinl1> then the path will become:
<[PR]robinl1> /home/robin/media/../.gdesklets/../apps/python/projects/../../important/
<[PR]robinl1> :P
<[PR]robinl1> and it will build up eventually
<joedj> [PR]robinl1: does it matter, in the example you pasted? ;)
<[PR]robinl1> haha :P
<[PR]robinl1> ok
<[PR]robinl1> that works
<[PR]robinl1> now to make it useful :)
<pekdon> Ok, google did not help me on this one, how to get the integer value of a character in a unicode string?
<joedj> >>> os.sep.join('/home/joe/bar/'.rstrip('/').split(os.sep)[:-1])
<joedj> '/home/joe'
<joedj> [PR]robinl1: that doesn't work for the "/foo" and "/" cases, though
<joedj> pekdon: ord(c)
<[PR]robinl1> YES!
<[PR]robinl1> it works :D
<[PR]robinl1> it only has problems with spaces
<[PR]robinl1> File: Cascada - Endless Summer.mp3
<[PR]robinl1> Command: mpg123
<[PR]robinl1> High Performance MPEG 1.0/2.0/2.5 Audio Player for Layer 1, 2, and 3.
<HeliosTech> Tk is Tkinter ?
<HeliosTech> can use local libs ?
<HeliosTech> i mean compile it and set it inside the project directory
<joedj> HeliosTech: Tk is Tkinter
<HeliosTech> guud
<pekdon> joedj: sorry for troubeling, I must be a bad searcher. Thanks for the help!
<joedj> pekdon: no problem =P
<[PR]robinl1> ok
<[PR]robinl1> the file browser works
<[PR]robinl1> anybody wanna test it out?
<HeliosTech> i don't understand Tkinter installl
<HeliosTech> File "/home/mod/devzone/python/106curve/libs/tkinter3000-1.0-20031212/setuplib.py", line 19, in find_tk
<HeliosTech> import Tkinter
<HeliosTech> ImportError: No module named Tkinter
<[PR]robinl1> hurray, the app is done
<luc***> [PR]robinl1: what kind of file browser?
<[PR]robinl1> screenshot: http://deadbeefbabe.org/paste/2914
<[PR]robinl1> wel
<[PR]robinl1> well*
<[PR]robinl1> watch that :)
<[PR]robinl1> THE file manager of the command line
<[PR]robinl1> replacement for ls/cd combination =D
<bodq> hello
<[PR]robinl1> like it, luc***? ^^
<bodq> is it possible to create a msword document in a CGI? (without COM, I'm running linux)
<[PR]robinl1> well i'm gonna go switch to fluxbox, laters
<luc***> [PR]robinl1: not sure what advantages over coreutils it has. but show it. :)
<[PR]robinl1> luc***: view the pastebin link
<[PR]robinl1> luc***: it's a screenshot ;)
<luc***> [PR]robinl1: i did. but give me the code. :)
<[PR]robinl1> ok
<qk> i'm looking for elegant way to sort something like this: [['aaa', 'bbb', 'ccc'], ['ggg', 'ccc', 'www']] and i want sort this list depend ond arg1, arg2, and arg3, any ideas ?
<[PR]robinl1> http://deadbeefbabe.org/paste/2915
<[PR]robinl1> =)
<[PR]robinl1> small file manager, eh?
<[PR]robinl1> but there are some bugs
<[PR]robinl1> the spaces do not work, and sometimes it doesn't grab the good filename, lol
<[PR]robinl1> luc***: and?
<luc***> [PR]robinl1: you don't need to keep current path in variable. just use os.chdir
<[PR]robinl1> hmm
<luc***> then os.listdir(".") and so on.
<[PR]robinl1> thats it?
<[PR]robinl1> you know? the fact is, i'm dumnb
<[PR]robinl1> *slaps himself*
<luc***> and it would be cool if you stored default commands for particular filetypes. :)
<[PR]robinl1> hmm yea i could
<[PR]robinl1> and i will :)
<[PR]robinl1> what do you think, would this be a good default file manager?
<[PR]robinl1> hmm wow your method works
<[PR]robinl1> thank you :D
<eleusis> what file manager?
<[PR]robinl1> mine :p
<eleusis> where?


Name:

Comments:

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






Return to #python
or
Go to some related logs:

delete xserver
kubuntu promise sx4000 install
rxvt-unicode sanity check cpp
bypass_banned_checks_acl
#perl
#perl
+perl +Hex to Char
#gentoo
#bash
can't locate object method buildAccessorsScalar



Home  |  disclaimer  |  contact  |  submit quotes