| |
| |
| |
|
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
Comments:
<0> anyone 'round familiar with libxslt ? <1> moin <2> what does click wrapping mean? <3> Is there some tutorial on fast fourier transform with scipy? <2> CardinalFang, URL? <4> http://www.gnome.org.nyud.net:8080/~davyd/gnome-2-14/ <4> Several mentions of "{written,extensible} in Python" in there." <5> Is there an easier way to append a value to a tuple than converting it to a list? <6> no <6> that's impossible. <6> but l = list(mytuple); l.append(foo) <6> is okay <5> Okay, so converting a tuple to a list is acceptable? <7> t = t + (x,) <6> that's nto appending to atuple
<7> no, tuples are immutable <5> I just have an argument tuple from *args and need to add a value to it, is all. <3> Is there any other wrapper to libfftw than the one in SciPy? <7> likewise you can't append to a string or add to a number <8> hello <8> are there any good linux IDEs for python <6> vim <8> other than vim <9> Time for some sleep....Goodnight everyone <10> vim? <11> isn't idle a python IDE? <11> *shrug* I use vim. <8> thanks NfNitLoop <12> hello <13> hi. i need a simple parsing solution for several entry fields. whats your preferred solution to test if the entry is (a number) in the range from 0 to 999? --> "if x in range(1000)" ?? <14> 'if 0 <= x < 1000' <13> yeah, more like it. thx :) <11> Hmm, python allows that? <15> lol <15> >>> a = 10 <15> >>> 0 < a < 100 <15> True <15> it looks like working <15> i didn't know that :) <13> and if i ony wanna know if it is an integer? --> 'isinstance()'? <16> are you sure its not just that 0<a returns True, which is repesented as an integer as 1, which is less than 100? <15> >>> a = 101 <15> >>> 0<a<100 <15> False <14> eigenlambda: I am sure. <14> the tutorial is also sure. See section 5.7 of docs.python.org/tut/ <16> >>> a=-51 <16> >>> -100<a<-50 <16> True <11> Yeah, I just tried the expression: -1 < -2 > -1. You can put parenthesis around either side to have it return True. <16> >>> 2 < 3 > 2 <16> True <11> (2<3)>2: false. 2<(3>2): false <11> etc, etc. <16> alright, so x <> y <> z is interpreted as (x <> y) and (y <> z) <14> correct. <11> I guess it's nice Python does that. But I'd never write that, simply because it'd make me nervous every time I re-read that section of code. <14> also ==, <, <=, >, >= <16> ya, thats 'cause we come from less nice languages :) <17> what are thoughts on the x = (choice1, choice2)[bool(condition)] method? is there a way to make it lazily evaluate the choices? <6> dijix: uhh, never do anything like that <6> the correct way of doing it is: <6> def myfunc(condition): <6> if condition: return choice1; <6> return choice2 <6> or similar. <17> but that's boring.. :) <18> what does <> do? <11> Which you could do in a lambda if it absolutely *had* to be on one line. <4> NfNitLoop, you should feel free using it. Eventually, you won't be surprised when the language obeys common sense. <14> Python is extremely boring. <14> chmeee: the same thing as != <13> can i do something like "y = int(x) or y = 0" with the meaning "***ign int(x) if possible, otherwise ***ign 0". would spare me all the "try" clauses. <18> ah, thought so <14> NfNitLoop: nope, 'if' is a statement. <6> yeah, a < b < c is the same as a<b and b<c
<18> Yhg1s: that reminds me of the (Q)Basic form <6> it's part of how the language is defined. <11> CardinalFang: I'll be surprised when I go back to another language. :P <17> it's one of those things I do when showing off to VBers at work.. <19> net <4> NfNitLoop, Oh, well Python can't help with that. <14> biopyte: nope. <2> um. <13> o.k. <14> biopyte: but you can write a function to do it, so you only have one 'try' block. <13> o.k. <13> could do that i perl, i remember, but those days are definitly gone ;) <17> you can also wrap that up in a decorator <14> Perl isn't Python. <20> is it in the spirit of python to write many very small functions? (<5,10 lines) <13> it isnt. definitly. <14> Yango: sure. <13> lets talk about something else ;) <21> Hello <16> i've always thought that the spirit of python was to make everything as easy to understand <16> so if short functions make it easy to understand, then <13> eigenlambda, it does well so, doesnt it? <21> I m new in the developpement and I choice python to begin. Today I had a script to do and my day is resuming in work on python :s . My script need to get a result of a command on a remote machine to insert this result in a file on the locale machine. to do that only ssh is available <22> 2006/02/20 17:41 EST [-] [Failure instance: Traceback: psycopg2._psycopg.ProgrammingError: no results to fetch <22> I'm getting that exception <13> eigenlambda, i'm just a hobby programmer, anyway. but one of my best decisions recently was to switch to python ... <22> INSERT INTO idportal_profile (fullname, user_id) VALUES ('Brian', '9') <21> Currelty I have the result of the command done on the remote machine but I don t know how to put this result in a liste <16> ssh user:p***@computer command >> file <22> After I do a runOperation on that query ^ <13> eigenlambda, coolest language in the world <22> Also the INSERT doesn't work <22> What is happening? <21> eigenlambda: using python this doesn t work :s <16> christor_: do you have the result as a string? <16> christor_: flaming people is generally considered to not be a good way to get them to help you <21> eigenlambda: currently I m trying that : <16> christor_: if it's a string, you put it in a list by putting brackets around it <21> cmd = "ssh root@IP ls" <21> ssh = pexpect....... <16> ok <21> eigenlambda: and the result appears on the screen ( several line) <16> so you have the result in a string. Where are you trying to put it? <21> but this result is not saved in the var ssh or other :s <16> oh <16> hm <20> eigenlambda, popen maybe? <21> I show you the script on pastebin <16> ya, thats what i was thinking <16> (i've actually never heard of pexpect) <16> hehe ya <16> or, answering questions and hearing smarter people's answers <21> http://pastebin.ca/42391 <16> what really made my day though was when somebody on #math asked what an eigenvalue is ^_^ <21> eigenlambda: do you know better solution? <21> eigenlambda: I searched a little on the net (python ssh and the result was often pexpect) <23> ok, I'm trying the struct.pack() to transform the list of [0,255,0,0,255....etc....] into the binary data. But the pack() warns me about format that required argument is not an integer (my argument is taht list) <21> eigenlambda: the print ssh give me that : http://pastebin.ca/42393 <16> how about os.popen(cmd, "r") <16> or rather, ssh = os.popen(cmd, "r").read() <16> then ssh contains the output from cmd, as executed by sh -c <21> eigenlambda: mmh ok <21> I m looking on the net <6> fyi, you can't enter p***words into ssh using python very easily at all. <21> christor_: THX I m goint o read info <21> Jerub: no prob I use key <6> good <6> you probably also want -o StrictHostKeyChecking=no <16> popen() is for shell pipes <16> ya i like os.popen(cmd, "r").read() <16> its nice and elegant and unixy <19> and blocking
Return to
#python or Go to some related
logs:
klauncer dcop #lgp gtk_main hangs #lisp #php #math +sh-s162 +redhat #linux #linux #css
|
|