I'm coming in late to the discussion and thought that someone would
explain it succinctly, but there have been so many correct statements
which I feel fail to nail down the problem that I thought I'd chime in.
Here's the important concepts to understand. The pipe is a construct of
the shell,
I want to get a variable name dependent on another variable. I have tried,
'fs' + str(int(round(unblockedFS))) for fs13
and I get an invalid literal. If I code in the fs13, everything works. Is
it possible to do this?
unblockedFS=13.4
for line in file('21Ex6MV_tmr.dat'):
d, fs1, fs2, fs
James wrote:
> Hi. :)
>
> I'm trying to write a loop to simplify my life (and code :)). The
> loop is going to iterate over a list of values that I have to change
> in a file. I think my problem is better described with some code. :)
Use a dictionary instead of a tuple ...
# variables
editVal
Hi,
Not sure if this is necessary, as I sent another email to the list (I
think), but since I'm new to this thing, I thought I'd do the safe thing and
try a second time.
The code almost works now. Although, as soon as the converter gets a number
-8 or lower, it adds a 0 that is not necessary.
CO
Michael Langford wrote:
>
> This signal is not something you care about. All SIGPIPE means is that
> the source of the signal found itself writing to a pipe with no sender.
> Your line "signal.signal(signal.SIGPIPE, signal.SIG_DFL)" means use the
> default signal handler for SIGPIPE. While this w
James wrote:
> Given this explanation, it's probably not a great idea to use
> signal.signal() then. ;)
In this case, it seems to me that setting the SIG_DFL action for SIGPIPE
is precisely what one would want to do.
This is pure speculation, but if you were to re-implement some of the
subproc
"pierre cutellic" <[EMAIL PROTECTED]> wrote
> But i don't really know what are the next steps. I presume that it
> should
> start by:
>
> import win32com.client
> xl = win32com.client.Dispatch("Excel.Application")
Before you try using COM to read the spreadsheet I'd consider
using some of the va
Hi. :)
I'm trying to write a loop to simplify my life (and code :)). The
loop is going to iterate over a list of values that I have to change
in a file. I think my problem is better described with some code. :)
# variables
interface = "eth0"
address = "192.168.1.5"
mask = "255.255.255.0"
Michael Langford wrote:
> A neater way to do it looks like:
>
> dic2 = {}
> countOfVars=40
> for line in file('foo.dat'):
> tokens = line.split()
> dval = tokens[0]
> ls = []
> for i in range(1,countOfVars+1):
> ls.append(float(tokens[i]))
> dic2[dval]=tuple(ls)
> p
Bryan Fodness wrote:
> it doesn't fix the problem, now it says there is a syntax error on the
> equal sign.
Please, post your code and the exact error message and traceback! Don't
make us guess what you are doing!
My guess is you forgot the closing ) but I have no way to know for sure.
Kent
>
Hi,
I'm actually trying to understand how to read data from an excel file but
i'm pretty stuck here:
I have already used makepy to generate the excel modules and its ID, which
looks like :
00020813---C000-0046
But i don't really know what are the next steps. I presume that it sh
Using the attached foo.dat and no linebreaks, what you're doing works
perfectly:
dic2 = {}
for line in file('foo.dat'):
d, fs1, fs2, fs3, fs4, fs5, fs6, fs7, fs8, fs9, fs10, fs11, fs12, fs13,
fs14, fs15, fs16, fs17, fs18, fs19, fs20, fs21, fs22, fs23, fs24, fs25,
fs26, fs27, fs28, fs29, fs30, f
it works well if it is on the same line, but I would like to wrap it for
readability
On 10/21/07, Bryan Fodness <[EMAIL PROTECTED]> wrote:
>
> it doesn't fix the problem, now it says there is a syntax error on the
> equal sign.
>
> On 10/21/07, Alan Gauld <[EMAIL PROTECTED]> wrote:
> >
> >
> > "Br
it doesn't fix the problem, now it says there is a syntax error on the equal
sign.
On 10/21/07, Alan Gauld <[EMAIL PROTECTED]> wrote:
>
>
> "Bryan Fodness" <[EMAIL PROTECTED]> wrote in
>
> >d, fs1, fs2, fs3, fs4, fs5, fs6, fs7, fs8, fs9, fs10,
> >fs11, fs12, fs13, fs14, fs15, fs16, fs17, f
"Bryan Fodness" <[EMAIL PROTECTED]> wrote in
>d, fs1, fs2, fs3, fs4, fs5, fs6, fs7, fs8, fs9, fs10,
>fs11, fs12, fs13, fs14, fs15, fs16, fs17, fs18, fs19,
>fs20, fs21, fs22, fs23, fs24, fs25, fs26, fs27, fs28,
>fs29, fs30, fs31, fs32, fs33, fs34, fs35, fs36, fs37,
>fs38, fs39
Here is my code.
dic2 = {}
for line in file('21Ex6MV_tmr.dat'):
d, fs1, fs2, fs3, fs4, fs5, fs6, fs7, fs8, fs9, fs10,
fs11, fs12, fs13, fs14, fs15, fs16, fs17, fs18, fs19,
fs20, fs21, fs22, fs23, fs24, fs25, fs26, fs27, fs28,
fs29, fs30, fs31, fs32, fs33, fs34, fs35, fs36, fs37,
"Michael Langford" <[EMAIL PROTECTED]> wrote
>I think Alan is exaggerating the danger of signal handlers.
Indeed, thats why I sent the follow up.
They aren't *dangerous* but they can be inconsistent across
OS. Plus some signals are wider in scope that the curent
process (eg ISTR Stop-A on a
I think Alan is exaggerating the danger of signal handlers. They are *not*
dangerous at all, but you should know what each signal means before you
install a handler over its default, so you don't surprise yourself with
behavior. For instance, you can capture ctrl-C which usually send a SIGINT.
Pyth
http://developer.yahoo.com/python/python-rest.html#post
On 10/21/07, SwartMumba snake <[EMAIL PROTECTED]> wrote:
> I have tried to find out the solution my self, and have failed to do so.
> So here is my problem:
>
> I want to submit text into an edit box on a web page. ie the equivalent of
> me
I have tried to find out the solution my self, and have failed to do so. So
here is my problem:
I want to submit text into an edit box on a web page. ie the equivalent of me
typing text into the edit box and clicking the submit button.
__
Do You
If the ease of use is the only answer then the size of the file should not
matter ideally. btw, how large is the file ? is it in MBs or GBs ? For
performance reasons, typically you should not have any problems using either
dictionary, array or list for file size of few KBs.
Like Kent said, if you
21 matches
Mail list logo