#python - Thu 19 Apr 2007 between 14:45 and 14:59



shwagYhg1s: thanks
arkaneswee someone who learned iteration from javascript ;)
hoboteUm, I assume this is a newbie question, but is there is a file operation for just appending at the beginning of a file? So I dont have to read it all in and then rewrite it?
Can I do some sort of file[0] slice?
Leedsthe word you're looking for is prepend, and I don't think you can do it
Yhg1sno, you cannot.
data in files is fixed in place. you'd have to rewrite the entire file.
hobote;_;
can you just append then, or is it impossible to do that as well?
arkanesyou cna append
qebabyou can append to a file, yes
open it in with mode 'a'
aurynnDesign question:
qebabthen write as you normally would, I think
aurynnI need to bring up an SSH tunnel and pull data across it on a regular basis.
hoboteThanks qebab and arkanes
aurynnShould I go for a long-term connection, or an on-demand connection?
arkaneshow often is "regular basis"
aurynnevery 10 minutes
arkaneson demand should be fine then
thefirstdudejust outa curiosity, wouldn't a python script run just as fast as a c program, after it has been parsed or whatever?
aurynnthefirstdude, parser overhead
arkanesthefirstdude: no
DrMax_is there a way of controlling rounding for floating points? say, towards 0, towards -inf, etc. ?
arkanesit's far more than parser overhead
thefirstdudewhat is parser overhead?
Yhg1sDrMax_: sure, by selecting the method to round with.
thefirstdudewhat makes it sloweR?
arkanespretty much everything
[lambda]Hi how can i know all methods of an instanciate object ?
thefirstdudefor method in object
Yhg1s[lambda]: the inspect module.
arkanesfor method in object will not work
thefirstdudeI'm jj, hope you didn't take mer seriously ;)
DrMax_Yhg1s : and how do I do that? round() rounds to a number of digits
qhelix7What is the best way to swap two arbitrary characters in a string?
guigouzis there any module to help parsing/writing config files ?
Yhg1sDrMax_: math.floor, math.ceil
actionDrMax_ slaps himself
DrMax_slaps himself
of course!

Page: 3 10 17 24 31 38 45 52 59 66 73 80 87 94 101 

IrcArchive