-2

Ok this is really doing my head in,

pevCommand = commands.getstatusoutput('pev ' + fileName)
pevString = "".join(map(str, pevCommand))

then later:

<hr />
<h3 style="color:blue;">
      <strong>--Pev Output--:  </strong></h3>
        <p>'''+pevString+'''</p>
<hr />

Getting the following error:

TypeError: cannot concatenate 'str' and 'tuple' objects

I want the output of pevCommand to be a single string, I'm not sure that map is correct and have tried a bunch of other approaches such as those listed here:

TypeError: sequence item 0: expected string, int found

Community
  • 1
  • 1
Madison Courto
  • 1,231
  • 13
  • 25
  • We don't either because we don't know what the expected outcome should be, if you get an error or not or what your functions are doing. What do you expect, what does not work according to plan? Out of the blue, are you trying to replace `--Pev Output--` with `prevCommand`? Why are you using `map` on a `str` type and a actual string? – Torxed Jun 03 '14 at 08:22
  • You're getting closer, the error you pasted, is that when trying to do `"".join(...)` or when doing `'''+pevString+'''`? Also what does `print([pevCommand], ["".join(map(str, pevCommand))])` show? Print really is the only debug-tool you'll ever need for these types of issues :P – Torxed Jun 03 '14 at 08:27

1 Answers1

0

Assuming the issue is the .join() call seeing how you linked to something mentioning that there are integers in your list-sequence and that somehow relates to your list.. This would solve the issue:

pevString = "".join((str(x) for x in pevCommand))
Torxed
  • 22,866
  • 14
  • 82
  • 131