| |
| |
| |
|
Comments:
<0> when opening a file for writing, will subsequent writes be appended or overwritten? <1> opening for write truncates <0> what about a log file type situation <1> if you want to append, then open for append <0> will append create as well? <1> yes <0> since the log file is all text shoult it be 'ta' then? <1> sure <1> t is the default, so just 'a' is fine too <0> so f = file(log.log, 'a') <0> will make a file log.log <0> no '' needed? <1> no <1> 'log.log
<1> 'log.log' <1> it's a filename, it's a string <0> k <0> hm never gets there ... <2> Robi, it will create the file log.log, or if it exists, append to it <2> woops, sorry.. didn't see xihr already said that ;) <0> ya np :P <2> Robi, never gets there? You mean never written to the file? <0> so i have this function that prints msgs, def msg(self, s): <2> well first off, are you closing the file handle after writing? <0> print(s) which prints fine on screen, so i thougt i'd stick the log stff there with <0> f = file('log.log', 'a'), f.write(s), f.close() before the print(s) <2> and s never appears in log.log? <0> no log.log :) <1> we can't see the code you're writing so we can't really help <2> Yea, use a pastebin <1> probably the logic either never gets to that point, or the file is being created somewhere you're not expecting <2> Just tested, file('blah.txt', 'a').write('foobar') and it works *shrugs* <1> "it doesn't work" is not really an effective diagnostic for helping you track things down in a dynamic language like Python <2> could be permissions, but you should see an error unless your catching the exception <0> yeah sec <1> what's up pjs <2> Cooking in my office.. you? <1> drinking coffee at my desk <0> error: addnstr() returned ERR <2> ****ing AC is out or something.. sun sets right on a whole wall of windows.. so it gets HOT in here <0> self.statuswin.addnstr(winpos, 0, s, self.mainwinw) <1> addnstr is in curses <0> yea <1> yeah, so that has nothing to do with your log file <0> sigh <2> xihr, Im not one for coffee lately <2> iced tea is my drink of choice <1> I drink coffee in the morning (just woke up :-) and then if I need more of a boost in the afternoon, especially at work, I drink tea <1> it's more for the morning ritual than the actual caffeine <0> ok http://pastebin.com/494157 <0> there's a chunk <0> message function at bottom <1> well that's clearly a syntax error <0> where? <1> .write(...) is not a legal Python statement <0> oh i had a var in there <0> http://pastebin.com/494164 gah why does it make a new one <1> so what is your question <1> I already pointed out the error you're getting has nothing to do with your log file code <0> no log.log <0> yeah error was something else <1> yes <1> so that code is simply never getting executed <1> as I pointed out <0> ok http://pastebin.com/494179 <0> i dont understand how that doens't get used since everywhere else it's called a bunch <1> well we're not going to debug your whole program for you <1> find out why the exception is getting thrown <0> it's not any more, i had files left over that do that <0> there's just no log <1> so debug your program <0> i dont know how .. really <0> this is far as I know how to get
<0> xihr, ok should I instead put the logging in the main thread? <0> woo got log.log to appear <0> argh <0> nothing ever gets written to it <2> heh, still with this <0> yah i cant figure out how it prints other than directly through <0> every time self.message is called it's not using the def message section! <2> where is the code pasted? <0> well i think there's some global vars here with multi included files so it wont help <2> so try changing the name of message() <2> maybe message_foo() <0> well i dont see how that's going to help <0> i'm trying to find the function that prints all msgs to screen and insert file logging <0> the one i found doesn't actually do anything <2> Oh, I see.. self.message isn't a function you defined? <2> its external <0> no i'm trying to fix code, so none of this is mine <0> hence the trouble <2> Good luck then <0> def message(self, s): <0> print "### "+s <0> what does ### do? date? <1> it, uh, prints ### <2> Umm, it does ### <1> you probably should just start with a basic programming tutorial <2> *nods* <1> then move on to the Python programming tutorial <0> ok so it's not a key symbol <3> wow, I forget how much arrays in php **** <3> forgot* <4> whats this channel all about <3> % Love is a battlefield <3> oh man, this song is so deep <0> anyone around to help trace an exception? <5> xihr: There's a guy, m0fo`, from *.bezeqint.net who wants to join. <5> I don't know if it's he or something else that has led to that ban. <6> hund: IIRC he should remain banned <5> Why? <6> He was trolling, I think <6> Over and over again <5> No, he's just dumb, I think. <6> he hangs out in #shellcode <6> nuff said <6> ircname is "LoLz" <5> SgtUnix: We'll find out. <7> guiys elif stands for elseif <7> ? <7> http://www.rafb.net/paste/results/dFlSGd11.html <7> do this make sense? <7> i am learning i know i am stressing:) <7> couse make sense only to me... <7> not to python! <8> not to me either <8> why do you have 4 if statements that have the same criteria? <8> only the first, or none, will hit <7> http://www.rafb.net/paste/results/OjKj1a87.html <7> i mod <7> in this way... <7> and the print Op...was just a test <7> so ignore it <7> but i get error on + i tried to put in "+" , and '-' too,....but python do not like it... <7> always for the same reason u told me before? <5> If you put in "+", you hardly got the same error. <5> From what I can see, you suddenly indented a region, that's bad. <7> i will try again <7> ah ok <7> i go eating <7> c u lateer:) <5> Later. :) <9> must go today 2 alienware laptops price $500 for both. message me if interested and wanting to buy only on msn at mcsltd2@hotmail.com or mikcomputing on aim or mperkelay on yahoo. hope to hear from you soon! p4 3.0 1gb ram 80gb hard drive, dvdrw/cdrw, built in modem, ethernet, firewire, usb2.0, 802.11b/g wireless, 256mb nvidia geforce go 6800 pcie, 17.1" uwxga display on both
Return to
#python or Go to some related
logs:
#hardware c- scanf vmsnap hung
#firebird #beginner #gentoo #delphi debian-31r0a-i386-binary-1.iso #nhl #politics
|
|