How to customize the 'write' to instrument?
I ran the code:

channel = 3
channel = str(channel)

volts= 22
volts = str(volts)

current = 2.3
current = str(current)

selchannel = 'CH'+ channel
mypass = 'APPL ' + selchannel + ','

mypass = mypass + volts + ','

mypass = mypass + current

print (mypass)


Through:


  Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
  [GCC 4.2.1 (Apple Inc. build 5646)] on darwin


It printed

APPL CH3,22,2.3


Which is what I would have expected (and The Photon raised as an issue in a comment), and is not exactly the same as your Python, which prints APPL CH3, 22, 2.3

Which version of Python are you using? It looks like it might be Python 3.

Would you please do the experiment of running dev.write('APPL CH3,22,2.3') and report back?

My suspicion is Python is interpreting character strings somewhere. However I can't imagine why that should matter to the power supply.