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



Comments:

<0> thanks
<0> where can i find a copy of wx it didnt come with active state 2.4
<0> nvm found a copy
<1> I am trying to accomplish a multi-threaded ftp loop with ftplib and python. I've accomplished the threading part, starting and stopping a timed while loop of an FTP upload sequence. The problem is not there, stopping and starting the threaded ftp sequence loop works fine. The problem is in stopping an ongoing transfer. My question is: does ftplib have a way of checking if there is a connection?, is there a way to do ftp.close()
<1> while a connection is ongoing?
<1> s/connection/transfer in the last lines.. I need to stop a transfer while it is ongoing
<1> I do not know if ftplib is complex/threaded enough for such usage
<0> i'd help but im a newb
<2> sanmarcos, twisted will do what you want, but it will take your dreams in payment
<1> harmlessj: I am already using twisted, it is just that its implementation of ftp is for masochists compared to ftplib's
<0> my script is a mess
<0> i have like 4 libs imported
<2> "those who would trade correctness for convenience deserve neither" ?
<0> wx sure uses alot of script to do a simple task...



<3> I was bent on using wx, until I found gtk, then everything turned around for me. Now that gtk is in my life the sun seems a little brighters, the clouds a little fewer. My cat likes me now, and I no longer get the head aches.
<4> kosh? Do you hang out on Worldforge IRC? There's a guy there with the same handle and the same propensity for humorous violence.
<5> iirc, kosh was the first person to tell me I was an idiot for not using python. :p
<4> Wise man, he.
<4> I think learning Python and Ruby is doing a lot to make me a better programmer. Never knew what an iterator was, or why I'd want to use one until they came along.
<6> What's an iterator?
<3> if a while loop is a movie, and iterator is like pausing the the movie and hitting the forward 1 frame button on the remote for the whole movie.
<3> and=an
<6> Umm... so like, slow mo loops?
<6> Why would you want to do a job slower?
<1> is there a way I could quiet exceptions in threads?
<3> ok, well if you had 60 movies going, you could watch each movie "at the same time".
<2> it's not a like a movie at all :)
<2> in a movie, you've got the whole thing, all on a reel, waiting to be shown
<2> but that reel can be pretty big and heavy for a movie of any length
<2> so instead, you hire an artist who can paint just fast enough to draw each frame as it's needed
<2> and you can throw away frames when you're done with them
<2> now you don't need to have the whole movie in the projection booth
<2> you say, "give me a frame!" and he says here's a frame, until there's no more frames
<2> artist -> iterator, movie-> sequence, frames -> iterations, "give me a frame" -> next()
<7> um
<7> what are generators in the context of something other than a movie?
<6> That sounds like a linked list buffer, or a stack
<2> no, the item in questions doesn't exist until it's needed
<7> pick something?
<2> suppose you needed to print out the numbers from one to one billion
<6> How does the item get created?
<2> you wouldn't make a list of all the numbers, then print that out
<2> you'd look, printing out each number one by one
<7> harmlessj: yeah, its huge.
<6> for i in range(0, 1000000000): print i
<7> ^ bad.
<6> you want to print them out all at once?
<2> i was thinking more along the lines of print [str(n) for n in range(1000000000)]
<2> that creates the whole thing in memory, see?
<6> list = []; for i in range(0, 1000000000): list.append(i); print list
<2> but if you did, for example, i =1; while i <= 1000000000: print str(i); i=i+1
<2> then, only a single item exists
<6> Well yeah, but it's a list.
<7> harmlessj: thats technically a iterator.
<7> _technically_.
<6> so you can do list.pop()
<2> i'm not writing an iterator, i'm showing the difference between precalculatoin and calculating on the fly
<7> I need some ***istance
<6> lol, I get a memory error when I try to make a list with 1 billion numbers.
<2> my point exactly :)
<8> hi! someone knows some information about Google Summer of Code 2006 and Python?
<6> ok I get it, use it, drop it, use another.
<7> heh, i get a MemoryError too wickers
<6> I guess this would be good for large data sets...
<9> I wrote a script and it works fine
<6> wchun, is a bot?
<10> no
<6> ahh you CnP'd that example to me. thanks :D
<6> what does yield do within a function?
<1> is there a way I could handle two different types of exceptions differently?



<1> as in try: action; except Ex1: do this; except Ex2: do that ?
<11> of course
<1> like my syntax?
<11> that's pretty much it.
<1> what about getting the exception messages for handling?
<12> Has anyone played with the Py-TOC module? It seems the module is failing when trying to connect to the main server.
<1> for example, ftplib hands raises an "error" execption with a tuple of data, how can I manipulate that tuple?
<11> except Exception, ex: foo
<1> synic: I mean, what is the variable for the tuple the execption returned?
<1> I am misunderstanding you
<11> try:
<11> cur.execute(query)
<11> except Exception, e:
<11> xl.common.error(parent, "Query Error: " + e.args[0])
<11> so it really depends on what ftplib raises
<1> thanks :)
<11> np
<13> Ok, I think I've found a way to actually enforce data hiding
<13> I'm storing the proxied object in a local
<13> there's no way to get at a function's local variables right?
<2> yes, there is
<13> ack, how?
<2> grab it's code block
<2> ... why on earth do you need to enforce data hiding?
<13> security
<5> BWAHAHAHAHHAHAHAHAHA
<5> I mean.
<2> uh ..
<5> freakazoid: you know that data hiding acheves zero security on any OO language you've heard of?
<13> anyway, why is it always "why do you want to do that" when I ask questions
<14> hello
<9> I wrote a server
<13> I just want to do it to show it can be done :)
<2> freakazoid, because we want to save you from spending ten years writing bad code, then waking up one morning and realizing how much suffering you've unleashed on the world
<14> does anyone know of an html text extractor?
<2> freakazoid, so do many m*** murderers
<13> Well, if this doesn't work I'm gonna become a m*** murderer
<6> mariodemon_11, that takes HTML, and stipps it's tags down to just the text?
<7> Can someone gimme ***istance?
<9> and it works the way I want
<6> there you go.
<9> but I want to run it under djb's daemontools
<7> I want to write a plugin system.
<14> wickers: yes
<7> a simple one, for a editor im writing
<9> and when I run it under daemonttols it does it's job but it doesn't return the correct errors
<9> when ther should be an error returned
<15> kbrooks: whatsup
<15> kbrooks: sorry, was not around earlier
<13> harmlessj: I'm not finding a local variable I defined in the code block
<13> I can see it's *name* but not its value
<16> Is debian 1.1 available for download?
<16> buu
<16> wrong channel
<2> freakazoid, they don't have values unless the function is executing
<13> what do you mean they don't have values? I'm using a variable defined in a nested scope
<2> if it's executing, it'll be in the stack frame
<13> hmmm
<13> so if the function throws an exception you could get at the stack frame
<13> and get at the value of the local variable
<2> yup
<2> or they could subcl*** a bytecode interpreter with methods to extract it as it runs, and run the code on that
<2> or, god forbid, they might look at your code and know what it's values can be
<2> 'data hiding' is to enforce interfaces, not secrecy
<13> what? I'm not doing this to prevent people from figuring out the implementation
<13> I'm trying to implement proxies ala Zope's in pure Python
<13> without having to use a C module the way Zope does
<13> I don't want the executing code to have access to a reference to the original object I'm proxying
<2> not likely to be possible
<17> the zope security system was VERY hard to make work right
<17> the odds of you being able to implement something similar is pretty much nil


Name:

Comments:

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






Return to #python
or
Go to some related logs:

serpentine gnomebaker ubuntu
#perl
warning Clock skew detected gentoo
#physics
SAK_SETUP0830.exe
#linux
#kde
#suse
shlomi andy petdance rindolf
#perl



Home  |  disclaimer  |  contact  |  submit quotes