Hi, I'm new to python, and I work on a little program fpr my rapsberry pi.
This scenario here is a little Midi sysex app for my Roland D-50 Synthesizer.
With an usb attached number keypad I can type numbers from 0 to 9 and the referenced Midi sysex file would be send out to my Roland D-50 Synthesizer.
This therefore works as expected. But now I want to improove my little python programm for the processing of 2 digits taken from the usb number keypad.
In theory the behavior should be as follow:
We check for 2 digits first, If one enters 23 we do in a "elif content == "23":" block the magic. But if one has typed only 1 digit we trigger the elif block for 1 digit. Problem for me is, I don't know how to check for 1 or 2 digits in the code.
Hello everyone,
I have just started python, and there is something that escapes me. I don't understand why my little script doesn't work.
When I do, it work:
my_string = "bonjour"
if len(my_string) < "6":
print(my_string + " < 6")
else:
print(my_string + " > 6")
... (2 Replies)
Hi,
I have a python script which is completely interactive. I have almost 10+ raw input statements like below which are collected from user one by one.
req_number = raw_input("Please enter request number or Q to Quit: ")
if (req_number in ):
sys.exit()
Is it possible for a more... (6 Replies)
I have a file full of coordinates of the form:
37.68899917602539 58.07500076293945 57.79100036621094
The numbers don't always have the same number of decimal points. I need to reduce the decimal points of all the numbers (there are 128 rows of 3 numbers) to 2.
I have tried to do this... (2 Replies)
I have a requirement where I collect inputs from entry widget in gui(via variables a,b,c) and then output a string like this: -a a -b b -c c.
Hence if I have given a=1 b=2 c=3, The output string is --> -a 1 -b 2 -c 3
or if I have given a=1 b=2 (c left blank) then the output is --> -a 1... (1 Reply)
Hi,
I am new to shell scripting.
script should accept the user value and then compare that value with the null.
If null then assign the value "*" to the variable else will use the user inputed value.
How to do this ?
With Regards (3 Replies)
i'm calling a python script from shell script. the python needs Y as an input everytime. how can i giv it thru shell script.
I tried below code
for arg in `cat erd_gen_list.lst`
do
generateErdSql.py -S $arg << Y
done
This is giving me err : `<<' unmatched
pls help. (1 Reply)