1

I am currently using the input function to capture user inputs in the terminal and copy them to the clipboard where it is then used by another application.

Wierdly it appears that there is a limit to the number of characters that you can enter when using input in the terminal when running the script in batch mode (~ 100). I was hoping someone could let me know what controls this limit and how to adjust it as there doesn't appear to be any limit when I run the code interactively.

Using python 3.4 running in Powershell on windows 7 64bit

Edit: Imagine to help clarify. When running in batch the "d"s were capped I could not add anymore to the input. However when running interactive I had no limit on how many "k"s I could type.

Testing.py is simply

x = input("Enter string:")

Image

Thanks

C

1 Answer 1

1

Just doing it in command prompt I'm not seeing any limits for either the input prompt or the value given in the input, it might be a powershell issue.

Test script I used:

import os

var = ""
for i in range(0,500):
    var += "Input"

var += "?: "

var2 = input(var)

print(var2)

os.system('pause')

Edit: I don't see it on value given side either

Sign up to request clarification or add additional context in comments.

4 Comments

To clarify its not the prompt that is limited but the amount of text that the user can enter onto the command line once the function input() has been called.
They made a bunch of changes to the input() function in 3.4, I just noticed I'm using 3.5.1, maybe they fixed it.
Added an image to the OP to help clarify. I tried running using python 3.5.1 on my machine and get the same limitation. Also ran using CMD instead of powershell and still get the same issue :(
Just tried testing on my desktop (windows 10 python 3.4) and don't get the limitation. Looks like an issue related to windows 7 (or a potential setting on my laptop). Is there some sort of input buffer variable that I need to tweak ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.