@# 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 20 21



Comments:

<0> Xen0n, is the script small enough to pastebin?
<1> benji, yes
<2> Xen0n: sure: they may not really be commented out, or the script may not really be the one that is executing, or there may be something wrong in a previous line.
<1> http://rafb.net/paste/results/sEpJXA75.html
<1> throwing errors for line 49
<2> and what is the exact error?
<1> TypeError: can't multiply sequence by non-int
<1> also, when i type /np in xchat to execute it, it prints 3 times...
<3> Xen0n: you're running this within xchat
<3> Xen0n: so it's imported the old version of the module, but showing you errors from the source on disk.
<1> Jerub, oh.... any way to stop that happening?
<3> Xen0n: it doesn't keep the source in memory, just the line numbers.
<2> Xen0n: restart xchat.
<3> Xen0n: reload the module correctly.
<1> i did....
<3> and delete any .pyc files if necessery.



<2> make sure it's loading the right module then.
<1> i did /unloadall and then /load rbnp.py
<2> oh, you didn't restart xchat? try that, then.
<1> ok... brb
<3> why part of "reload the module correct" means that "i did...." could possibly be a valid response.
<4> if anyone can help a newbie.. getting a bit confused. I've split off part of my application (a cl***) into a seperate file.... I take it that I include it with > import filename ?
<3> p_masho: yep.
<2> p_masho: 'import modulename', rather. which is the filename minus the '.py' extension.
<1> well, that worked
<3> Yhg1s: gah, that kind of thing is embedded so deep in my subconcious I forgot it.
<1> so the other question is - do i REALLY need to restart xchat EVERY time i change the script???
<3> Xen0n: talk to the xchat team, not us.
<2> Xen0n: you'll have to ask xchat. there's nothing in Python that requires it.
<1> heh
<2> but xchat has to do the right thing.
<1> fair enough
<0> Xen0n, have you tried reload?
<3> twisted.python.reload is pretty good too ;()
<5> oh man
<0> Jerub, do you have a handy reference URL for t.p.reload? (a quick Google didn't turn anything up)
<1> benji, thanks, someone showed me - /py reload filename
<3> http://twistedmatrix.com/documents/current/api/twisted.python.rebuild.html
<3> rebuild, sorry.
<6> If I have a list 'Names' containing 'Alice' and 'Bob,' how could I loop through 'Names' and create a Person object for each name, so that I can use Alice.method(), Bob.method()?
<7> tpamet to map names to objects, a dictionary is handy
<4> thats where me confused... can "import foo" be within a function or does it have to be at "the top" ?
<0> thanks Jerub (I'm interested in how to do "proper" reloads in long-running processes, so I'd like to check out what they're doing)
<3> tpamet: uh, myPersons = [Person(name) for name in names]
<6> ok, thanks Zalamander, I'll try
<6> thanks Jerub
<3> benji: rebuild supports versioning and upgrader methods.
<2> Jerub: that doesn't name them, though.
<3> oh! sorry.
<3> tpamet: uh, myPersons = dict((name, Person(name)) for name in names)
<2> tpamet: to name them, 'namedict = {}; for name in names: namedict[name] = Person(name)
<3> that makes a dict of name:personinstance
<3> :)
<4> anyone ?
<3> benji: if you've ever used 'twistd', there's actually capabilities to stop a process, pickle its state to disk, and start the process again.
<7> p_masho it can be anwhere
<3> benji: which means that 'long running' can be pretty damn long :)
<0> Jerub, right, I'm actually thinking about non-twisted apps
<3> benji: no reason you can't rip off the code
<2> p_masho: it can be in a fucntion if you want it to be, but it's customary to put it at the top of the module.
<7> benji you can do it with Stackless pretty easily
<3> (and twisted.python.* doesn't depend on anything else, so you can use it in isolation)
<0> Jerub, that's a possability :)
<4> was expecting python to throw an error... eg I got a reference to self.gladeFIle as a variable.. which is called in a function.. is there an equiveleant to php's error_reporting(E_ALL) ?
<0> Zalamander, my use case is reloading a module (sanely) without restarting the process
<3> p_masho: normal operation.
<3> p_masho: there's no such thing as error_reporting(E_STUPID) like in php
<8> Jerub == $t0rm?
<2> p_masho: there are, however, tools to check your code for possible errors: pychecker and pylint.
<9> did somehting happen in most recent python that makes _doc_ no longer valid?
<2> p_masho: they don't come with python, and they just check your source without running it.
<2> muk_ibook: _doc_ isn't anything. did you mean __doc__?
<0> Jerub, knowing what I do of PHP, I'd suspect every single line of PHP would generate an error at the E_STUPID level
<9> ohh
<9> there's two _'s?
<2> muk_ibook: depends on what you mean. the __doc__ thing that is used in Python has two underscores on each side (like all special variables)



<9> ah, ok
<9> thx
<2> muk_ibook: _doc_ is a valid identifier, though. nothing stops you from using it ;)
<9> ah, ok
<3> benji: you misunderstand.
<3> benji: E_STUPID decides not to report errors.
<9> I meant the default doc attribute
<2> errors? pfft, we'll do what you possibly wanted.
<2> muk_ibook: yes, that's __doc__.
<3> benji: because in PHP, if you have $foo = bar; if bar isn't a defined constant, php will magically say, "oh, that silly billy, he probably forgot to put quotes around 'bar', let me do that for him"
<3> benji: *silently*
<4> can someone help (been half hour at this and getting nowhere) I get an error >>" 'module' object is not callable line 54 "... http://python.pastebin.com/766354
<3> p_masho: you've imported a module and tried to call it as a function.
<2> p_masho: 'gtk' is the module you imported.
<2> eh,
<3> p_masho: you can't do that. you probably meant to call a function that's a member of that module.
<2> gtk.main is a module, that is.
<4> Jerub: I split the cl*** dialogUsers() off as a seperate file.. so i cant do that ?
<10> Whot should I do if I have some package and I want all modules from that package to be imported on "import package" call? What should I add to __init__.py? Only "from package import *"?
<2> p_masho: it's completely unrelated to that.
<9> Yhg1s: explains why I couldn't get them to work, hehe
<2> p_masho: you can put cl***es wherever you want them, you just have to refer to the cl*** when you want the cl***. If you put cl*** 'X' in module 'Y', you do 'import Y' and refer to 'Y.X' to get at the cl***.
<2> p_masho: line 54 in your paste is 'gtk.main()', though. it doesn't seem to be a problem with your imports or cl***es.
<2> p_masho: (unless it's really another line that's giving the error.)
<3> does anyone remember how to spell "mycolumn is not null" in sqlobject's sqlbuilder syntax?
<5> if that's a snippet of code without the right line numbers, eh
<2> p_masho: seeing the actual exception in the paste, with traceback, would help.
<4> here is full error... http://python.pastebin.com/766364
<11> I'm speaking a bit out of my league here, so bear with me...Is it possible to change the byte-order of a file being written via a python script? in particular a Berkeley DB (hash) created with the bsddb module? My Mac writes as big-endian, but i want the resulting file to be little-endian (for my i386 servers).
<4> Yhg1s: error trace is pasted above .. tia
<12> stickystyle, pack and unpack
<13> hey guys
<12> i believe
<13> hey i'm a bit tire kicking here ... but i was curious about what you guys think
<11> reikon: i will research those, thank you.
<13> i need panel/tray applet of some sort that would work on windows and linux and check on mail and calendar events with imap and calendar servers that we have or plan to use
<13> i've found various projects ... on gnome i found this: http://www.nongnu.org/mailnotify/
<5> python would be suitable for programming your applet, I guess
<13> *nod*
<3> holycow: good lord.
<13> what i'm curious about then would it not be easier to code something similar inpython than c like th email notification programmer? and maintain and extend?
<3> holycow: that's a lot of stuff you want to do.
<3> holycow: have you looked at existing work yet?
<13> i'm trying to sift through all the projects out there yah, most of them have odd pecularities like being coded in cd and such ...
<14> hi! how can I add a tuple to a list...or better how to create a tuple?
<13> Jerub, so its FAR more complicated than i'm imagining the task, correct?
<3> holycow: doing IMAP? iCal?
<15> adac: a = ('woot',)
<3> holycow: yes, probably much more complicated than you think.
<3> holycow: doing things like having a system tray icon that works in windows and linux, that's actually easy.
<13> i was really only thinking of say for imap, logging in, and checking for email periodically, for ical not sure if that would make sense with a periodical update, perhaps via rss if that makes any sense
<3> holycow: it's literally a couple dozen lines of wxPython to have a system tray icon and a little menu and a window that comes up on events.
<13> Jerub, ah, okay that last part was also what i was wondering
<13> right i was thinking wx too
<3> I have something laying around, let me grab it.
<13> Jerub, oh lol no don't toss it just yet
<13> i'm kicking tires a bit, but if i want anything i'll pay to get this done
<13> its for a client
<4> Yhg1s: lovely got it working.. thanks to you do 'import Y' and refer to 'Y.X' to get at the cl***. However also needed to do a import gtk on the imported file.. is it not possible to have "gtk" ina "global" scooe ?
<13> oh forgot about python rulse sorry about that
<13> Jerub, do you do consulting by the way?
<3> holycow: no.
<13> *nod* no problem, thank you for the help by the way, you've answered quite a lot for me
<16> can anyone refer me to a good Vector math library?
<3> cherez: numpy
<10> I have tried to use string.maketrans to some character translations, but this is what it gives me now:
<10> 'ascii' codec can't encode character u'\xe1' in position 2: ordinal not in range(128)
<3> xmikos: what kind of character translations?
<3> xmikos: and why are you trying to print unicode objects?
<2> xmikos: you need to encode the unicode objects into an encoding appropriate for your screen.
<10> Jerub: I have written about it here about one hour ago... it ias custom encoding in some proprietary dictionary and I am trying to translate it to unicode
<13> Jerub, last question, if you were thinking about something similar to what i describe with emphasis on cross platform, py with wx would pretty much be the most portable/manageable way to create that right?
<2> xmikos: note that str.translate doesn't actually translate to unicode, in spite of the name.
<3> xmikos: maybe you don't understand unicode.


Name:

Comments:

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






Return to #python
or
Go to some related logs:

#linux
centos5 ipw2200
update-alternative ubuntu command
+can ping +cannot surf the web linux
sysrage
python prostgress
sudores ubuntu
centos 5 Extra.repo
perldoc SQLite func
#web



Home  |  disclaimer  |  contact  |  submit quotes