| |
| |
| |
|
Comments:
<0> joinky. <1> anyone know of a way to read in a file line by line without including the '\n' character? <1> when i try to write to a file with info on the same line that ive got from different files it will always move down to the next line because readlines() is picking up the '\n' when it reads in an item <2> just remove it <2> if you want to write a line that already contains a newline to a file, use aFile.write <2> if it's a list of lines from .readlines, use .writelines <1> i can't remove it i tried <2> huh? <1> ii've read in seperate lists from seperate files no i'm writing a file using information from each of the lists that i got from the files i read in to write a file but in the file i write every time one of the items is written its skips the next thing down to the next line instead of putting it on the same line <2> how can you not remove newlines from a string that you have access to? <2> that doesn't make any sense <1> i used replace('\n','') <2> if you got the lines from .readlines, use .writelines <2> well, how did you use it?
<1> for x in mystring: <1> x.replace('\n','') <1> i'm using writelines <2> that's why <2> strings are immutable <2> s = 'asdf'; s.replace('asdf', '') <2> does nothing <2> you need to rebind it if you want <1> ? <2> do:: mystring = [x.replace('\n', '') for x in mystring] <2> strings are immutable <2> .replace RETURNS a string with the replacement, it doesn't (can't) do anything to the original string <1> ahh <1> thanks man that worked <1> for some reason it put a ****load of whitespace on the end so i used the same command but used strip() instead of replace and it was perfect <3> how are tuples actually implemented? <2> how do you mean <2> tuples are effectively just immutable lists <3> e.g. a list is basically a contiguous array in memory right? <3> a dictionary is a hash table, etc <2> correct <2> it's a "vector" in computer science lingo <2> it's NOT a linked list <2> so e.g., indexing is O(1) <3> ya I know that much (you're talking about tuples correct?) <2> both tuples and lists <2> as I said, tuples are essentially just immutable lists <3> ok, so a tuple is just a read-only array <3> alright <3> what about sets? <3> (and if you could point me to documentation that discusses all this, that'd be great) <2> sets are basically dictonaries without values <2> so also hash tables <3> ah right, ok <2> it's deep in the language reference, unfortunately this stuff isn't as easily accessible as it could be <3> yea I found a casual mention to dictionaries-as-hash-tables in the FAQ, but no dedicated section to the stuff <3> thanks then <2> the information is (unfortunately) scattered around the language reference <2> best bet is getting a good desktop reference like the Nutshell book for this kind of stuff <3> is that the one you recommend? <2> for a reference, yes <3> alright <3> mm, it's for 2.2 though, I'm sure a new edition will be out soon <2> yeah, I believe the author said he was working on a new version, yes <2> the differences between 2.2 through 2.4 are pretty slight overall, though <3> yeah, I know, just one of those superficial things that'd rest my conscience <4> ImportError: No module named distutils.core how do I fix that? <5> are you on debian or something related? <4> suse <5> then I have no clue <5> maybe they package distutils separately <4> ok I will try :) <4> so I need the python package distutils right? <5> right.. <4> I have python 2.4 according to the documentation I am reading it should already have distutils <2> install distutils]
<2> wait <2> if distutils.core is not present, then your Python installation is broken, reinstall it <6> Congratulations for the /. posting, Ted. <7> Who's Ted? <8> re <2> hey yason <8> hi xihr <2> what's up <8> got an interview on Monday <2> confident about it? <8> more than usually, it was partially their call <2> cool <2> I get several emails a week with only a resume on my web page, not bad being mid-career :-) <8> emailed a lot with the folks already, they seem like-minded <2> what would you be doing <8> a small company full of old demo coders and hackers :-) <2> competitive salary? <2> or do you have any idea yet <8> i'd start with an SVG player they're building for their mobile platforms (this was their initial need) but they said they won't be short of new projects <2> cool <2> I worked on SVG at one point :-) <8> moderately; I'd have cashed in great had I been allowed to continue telecommuting. Now it seems that I have to move to the South which yields an additional living cost <2> ah <2> yeah, I telecommute now and really like it, which is why I'm not really looking hard <8> Heh, they wanted someone with experience in browsers to work on their svg software (which is a viewer/player) <8> Me neither, but my current job is just pretty much consumed out. It's mellow, safe and non-challenging: I work from home and suffer from nearly none of the typical office problems <2> yeah <8> but i'll be nowhere eventually, unless i hop one step up <2> my current job was a startup that had promise and a very, very rocky time for a while there but is now doing relatively well <2> unfortunately the quick payout didn't happen :-( <8> not that i didn't like hacking python, lisp and ocaml on my own, I just need to ensure a steady cashflow into the future to support that :) <2> yes, goes without saying :-) <8> yeah, it never happens. unless you're a founder <2> well there was quite a good chance in this case, they just royally blew the marketing <2> I was employee #4, wrote all the server stuff <8> most startups **** <2> yep <8> if one is a gem, it can be made to **** <2> this one ended up dragging out too long, so I got boned in the end <8> if the founders fail to crash the gem, it will bring the money :) <2> but like I said they're trying a new tack now (licensing) and so it's actually making money and has some promise <8> yeah <2> but it means I have to work :-( <2> heh <8> they do have bonuses and a program for stock options, though <2> stock purchase or stock options? <2> (or both) <8> and they'll pay me some extra on top of my salary request (adjusted to my current location) if i move there <2> yeah, most are open to that, that's nice <8> options, AFAIK <8> http://www.hybrid.fi/ <2> looks pretty cool <8> it is cool <8> the cto is a language enthusiast like me <8> they do internal stuff (web stuff, reports, processing, converting, build software etc.) in ocaml and haskell <2> heh, cool <2> wherever I work now internal tools are done in Python because they don't have a choice :-) <8> hehe <8> same here <2> last three jobs actually all had significant Python components <2> one was pure Python actually <2> and involved the SVG core that I had ported on a previous contract :-) <8> I had plans to convert my employer to releasing our current version in MPL/GPL before leaving; if I got the job I'd be in a hurry :) <8> mmmm <9> Hi, anyone know a library for Python similiar to sparklines for Ruby ? <10> hi <11> Are there any python modules for monitoring the amount of data p***ing through a network device (bandwidth monitoring)?
Return to
#python or Go to some related
logs:
#politics superkaramba fluxbox update bioremidation krouton jpres #hardware mariusz maricz #heroin #delphi #windowsxp bind_inet_socket() 514
|
|