#apache #archlinux #asterisk #centos #debian #gentoo #haskell #kde #kubuntu #lisp #math #mysql #perl #python #ruby-lang #rubyonrails #suse #ubuntu #vim #wikipedia 0 1 2 3 4 5 6 7 8 9 10 11 12 
Top Prev 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 Next

#python

<masterdriverz> morpheus74: what error do you get?
<masterdriverz> moldy: ignore me :)
<kbrooks> morpheus74: well, try replacing del x[0:7] with del x[0:6]
<moldy> masterdriverz: np
<moldy> krisp: what kind of application do you want to write?
<kbrooks> esperegu: well, you can write a module. but ...
<kbrooks> esperegu: lets assume that this progrwam is linux-only. so, you update it. it goes along fine (as it should).
<kbrooks> esperegu: not so for windows.
<morpheus74> I don't exactly get an error. The program run fine on my local machine, but when I put the program on the server, it does not execute. I'm using cron jobs to run the program on the server, and I'm not allowed access to the cron jobs log to see what the exact error is.
<kbrooks> esperegu: my definition of "update" is "replace program with new version of program". and replacing a program means replacing its files
<kbrooks> esperegu: it will not work on windows without the program first shutdown
<esperegu> kbrooks: but you could check that right?
<esperegu> that it automaticly replaces the files and then restarts the program?
<kbrooks> esperegu: not on windows. you can't replace a file that is in use.
<kbrooks> i.e. open
<kbrooks> still open i mean
<kbrooks> perhaps python closes the file after it parses it
<esperegu> so the update program that starts the rest could not be updated but the rest could?
<kbrooks> esperegu: maybe python closes the file after it parses it. so it would work with the same code across bo th platforms
<ZenMasterJG> gimme a sec, i'm in windows. i'll write up a quick test case to see if you can replace and reload a module that's already been imported, if ya like
<esperegu> ZenMasterJG: cool
<kbrooks> esperegu: the auto update module is easy, except for that *possible* restriction
<esperegu> kbrooks: is'nt there code available already?
<kbrooks> esperegu: do a Google search to find that out. i'm not a volunteer constulant
<esperegu> =)
<esperegu> I did before I asked here...
<esperegu> but I could not find it. but I do not believe that it is not yet there ;-)
<kbrooks> yeah, seems like theres none
<kbrooks> esperegu: want some help? ;-)
<arkanes> yes, you can reload modules
<arkanes> with the reload() builtin
<arkanes> however, it won't affect any living objects, so it
<arkanes> it's not a "program upgrade"
<arkanes> theres some code in twisted and probably elsewhere that attempts to find any objects affected by a reload and recreate them
<esperegu> arkanes: you could just restart the program right?
<arkanes> of course
<josip> is it good to keep all python instance variables "private" (starting with __) and write getters/setters for each of them ?
<arkanes> no
<kbrooks> josip: no...
<josip> hm, why ?
<kbrooks> josip: clutter
<arkanes> its a waste of time
<kbrooks> josip: looks good at first, but later itlll look bad
<arkanes> the reason you do it in static languages is because properties or getters/setters are part of the interface
<josip> I know
<arkanes> in python, you can replace an attribute with a property tranparently to clients of your class, so there's no reason to do it until you need to
<kbrooks> arkanes: why are they part of the interface/?
<arkanes> kbrooks: because it affects the ABI
<arkanes> .NET for example has different bytecode to call a property than to access an attribute
<esperegu> kbrooks: bout help: why? have nothing to do?

Previous Page  Next Page

Search ircarchive.info