| shwag | Yhg1s: thanks |
| arkanes | wee someone who learned iteration from javascript ;) |
| hobote | Um, 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? |
| Leeds | the word you're looking for is prepend, and I don't think you can do it |
| Yhg1s | no, 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? |
| arkanes | you cna append |
| qebab | you can append to a file, yes open it in with mode 'a' |
| aurynn | Design question: |
| qebab | then write as you normally would, I think |
| aurynn | I need to bring up an SSH tunnel and pull data across it on a regular basis. |
| hobote | Thanks qebab and arkanes |
| aurynn | Should I go for a long-term connection, or an on-demand connection? |
| arkanes | how often is "regular basis" |
| aurynn | every 10 minutes |
| arkanes | on demand should be fine then |
| thefirstdude | just outa curiosity, wouldn't a python script run just as fast as a c program, after it has been parsed or whatever? |
| aurynn | thefirstdude, parser overhead |
| arkanes | thefirstdude: no |
| DrMax_ | is there a way of controlling rounding for floating points? say, towards 0, towards -inf, etc. ? |
| arkanes | it's far more than parser overhead |
| thefirstdude | what is parser overhead? |
| Yhg1s | DrMax_: sure, by selecting the method to round with. |
| thefirstdude | what makes it sloweR? |
| arkanes | pretty much everything |
| [lambda] | Hi how can i know all methods of an instanciate object ? |
| thefirstdude | for method in object |
| Yhg1s | [lambda]: the inspect module. |
| arkanes | for method in object will not work |
| thefirstdude | I'm jj, hope you didn't take mer seriously ;) |
| DrMax_ | Yhg1s : and how do I do that? round() rounds to a number of digits |
| qhelix7 | What is the best way to swap two arbitrary characters in a string? |
| guigouz | is there any module to help parsing/writing config files ? |
| Yhg1s | DrMax_: math.floor, math.ceil |
| action | DrMax_ slaps himself |
| DrMax_ | slaps himself of course! |