超出windows最大命令长度 - python subprocess.call()

时间:2017-01-24 18:51:20

标签: windows python-2.7 subprocess

我使用subprocess.call()向第三方程序发出命令字符串,该字符串可能会变得非常长,并且超出了windows cmd.exe的8191字符限制。

Windows帮助似乎建议将字符串放在一个文件中并以某种方式调用它,但我不确定这是否可行。

有什么建议吗?

编辑:

subprocess.call(['gridcoinresearchd', 'sendmany', account_label, call_insert, "2", message], shell=True)

call_insert = {"Rz3dq37BLCKx2ymW3xj5FuUbnxa4sM44jg":0.24164627,"S4TnwL8B96ZYunmfPtZFpEJLaQW2Bsad2g":0.02356050,"RyVtbJ1FT26k7rXRHC7zMrieproGPjEkhH":0.00135926,"SGhCPJ63PkuS4w5J5biMZLSZQWMWUXCP5s":0.00147253,"S8ytydsTx4o1zJgMMs2wAKGUgRq3NB95z1":0.01744383,"S83FdFPoHJ9gAXeknKPL39gyHXdjuPyt3b":0.00849537,"S83S5Lgnymg6Tdy52vzv4MXxuGrvtHfnWS":0.00169907,"SCLCaFDCMxZ82EBx3tzVH7Lz197w6vq8Nn":0.11327165,"SLNis7Fx7ekR831h6AeaoMVNF8nTRxMkzf":0.00033981,"SLndMNvkqQwqArqyhRz4o7N9hKJKq3GR6m":0.02174816,"S1KhrP6htzxpWXQH2GHLDBQFpo2oTo3Sa8":0.00351142,"S4YuP21H5M5nNQkqh6zcdFdRcKzT5FjhG2":0.01653766,"S8bNsUz22qV13eLxA1NhGF5muLKi4VjSdC":0.00002832,"S6jYuNcyNt4st5no8hA3MkKtMExTAefTDE":0.01268643,"SFaChXSwDpw5YFEygLjsQnXvk3tTcR2irY":0.00124599,"SFR6btSGZFBCK9izvkQ5kwngmi2YRqVoNe":0.00487068,"SFrUaVngc2RmwqWAF3zqk4PfdsdgrAkwJk":0.00019823,"SCp9Cy26Rm3j4RW36t7PbN8NdQFkBCqJE6":0.00101944,"SFN2TedrQh6vd5sSdZTHd8uFMZ6zeWQuhC":0.00192562,"RxQ66TQ8iofxJDbPukmP3hyHoPMcxTobnZ":0.00005664,"SE8sfGQXT93W7psRL7rhSR2tjfsBKirBd6":0.01098735,"SGwkAffNGcZsnv2EghmAw1SNntbHwCqT1s":0.01880309,"SFvAWqR5yVBpjezt8MGQpmmeD9DQd9YTeL":0.00042477,"SLLry3ctftuS766Qw7hUJsSQ3jAbqv9opZ":0.00645648,"S6PtTT5WzkjVz6s5zcMi5oDm38KzrAS4KQ":0.00124599,"RyQUMqxVWx7qFHGyyFGdXEbjTzsFMcn8h7":0.00090617,"SBUKTCcgyo6Eedx6URC9kuCLgARvtbS8CJ":0.00067963,"RyC3s94z9MXQEisaWK9WgFzxd7ZwDXuXEB":0.00135926,"SBcmU3rA2AYMwn6TzFzJv21g74YaowDZmp":0.00079290,"SHitBy8XURzqwyqNSyH7z916UEeHeV9im6":0.00036813,"RxoE7LhsVQtfARR7cSeftCqiP8L2dtd13d":0.00008495,"SAw6dAHTe2oZQTkLGCRjakB5pyHBu8hsAy":0.00294506,"SHVHT377ADPh7R8mqCvLVZxDr24YidmyHZ":0.01042099,"SEBWB6fMMUQNMXPqZX62kooSQaZdccUkFg":0.00067963,"SMDNh4thDHrAyN2iTeHNjaM18vvp5RBjVw":0.00249198,"S1CkFaB1XoawP8eUPiheoSQaU35FxhvtNz":0.00067963,"S81uQ4Yf9JMRo2yxkvaRisqCfRrSK8uqy6":0.00002832,"S4DiXna8PscUGyqPfqzmyfHZBwDuZtCWsS":0.00101944,"Rxtzukee1FgGApNgedAyDz2ENxfxv3B5RW":0.00781574,"SBkSgmB23Dr8UMMkZrbHieK2KoR4CjFbzM":0.00014159,"SKAQRKXtxUqpTgCCWyjMqbgPQokkwzmCR1":0.00656976,"SJgm9hDyWTSx9jdk4scXvHhzGGss4MdCSF":0.00226543,"S66KrZu72BaNypoErpSytwyVEGfw9WkhzB":0.00158580,"SAdmk4FvJuLYhvi1dkK88Q1bFaYtA464eH":0.00215216,"SB7emF5H9BoTfn1APVqUGJRpWZxvTUbmoY":0.00555031,"RzUKaVWeJKnQFxYsX6GfaU2PWbfpZuLp6j":0.01042099,"SHe1p1pXRqvJtpgTKznFMLhGUYK6rLfiqQ":0.00019823,"SJ2oQhGYp9TqoR9Z8jGeLmbL8Xqi8Bsg8b":0.00005664,"SAhcEnMejzr3f5RVxMoQ2X3DahjjNHpWeM":0.00011327,"RxZRYv4BsZkKqvKhQk7QTA53G6FU6yX3Mh":0.00158580,"S2PLBEbyVHqkkc8RFAuu2QcLaVHDivknyn":0.08064942,"S3JF7KgD3zfHXs34KR6G5529UQjewKCWfE":0.00339815,"SGq3uiLhKzLWwd2scdHjk6Pd85aPv7RozA":0.00079290,"S1VTjqYCy2oHqtWeeMePHUvBMoonPaWyBW":0.00042477,"S8ogLUgMM2MH6ebWKnfFUWKYJki7Rgy3Jd":0.00215216,"S4ywKvfWP65mu8LwijkiGyhshrZ2N6BNoY":0.00101944,"SD9FUZTihwG6L2xuVDYZkNxPnuupbUXjr7":0.00498395,"SM2Psip62sAMHbrDARtPjvJ6FMwDfhseSm":0.00419105,"RzSEKtYsKHhGRCqhcz49V5ukS6CLgySQ3d":0.00113272,"S7P3Hc8xtk9V5aqpdDhBfYWNYPtLVzQsGi":0.00005664,"S6QFh9Ne9mTyjnhkhcZBbktrktKaGruhki":0.00048140,"RzMjmWjRM8fVqpKjZ272ZW3z3FaKp4nkGY":0.00362469,"SCZE6pX79dCU5eXb5Q5fUMmNKAG9Tsrvmf":0.00203889,"S9wRMS9fcnTWdqcU9bS7nHSBfm57XwDRrS":0.00192562,"S4C4scDdoHN5B49K5EbMA3YsJw9EdDUiAV":0.00351142,"S52mQoDQrBvDyki6XJ39wwchZsazmDFyfw":0.00113272,"SGE1mo6dQd4EZ6qRPHT91UZCwpsAwj2nAu":0.00407778,"SKfrN3gtG1F88G9SozPkQ7fzTsmEaBxQSQ":0.00237870,"SGJaj2HkTSV8dAN7CLHwEwGnbB4K4jVx3n":0.00031150,"SHcaQcDFdtvnL6VR343r7iJLwK9268KSHc":0.00147253,"SL153gHtq8h9crJdriK4NXEBPfRSTPQynp":0.00002832,"RzZrMR5PFJ2Q2a5QWz27PHAMdhw3o6neuA":0.00475741,"SDMxAiNu6cavmMjMEckpL5zMJr6NbM4MR6":0.00589013,"SKHkvMwsGFmVM1eFp6fyH6NeHWLJ9wPjKg":0.00622994,"SGoDEeXzpQdVsNX7EQ7SC64g5pZ9SHveKc":0.00611667,"SJnT5bUUqXyE1hPdqo7CQB7n7HHeeYi6JU":0.00407778,"S8L3z1Nd2mPP9ZFJMg1xcV52HTwsahWVpR":0.00022654,"S8cAn1drdpCseyeRG9buu9QnqMYeQSC7Ub":0.00532377,"SHibFa71LZidokE7oReurfqNzK6m5c89jB":0.01076081,"SDPdpZVkUajdVebZVtGZghk4BgbgqTJcvW":0.00226543,"SBYqe1mZ3G6JDg2M2G6b4kxyjsMmHqJzFr":0.00002832,"SCf7npGZktFXQcrE3KkD9i8PizLdmTGfHz":0.00158580,"RznwCdu43H3g1G6dLb5BuSu8889dJPzP9V":0.00042477,"SCVx49bD7WQBhYcJALkCz1X7Uw3tqxu2o8":0.00690957,"RyYkCJnTCagyQjf3mf1C3ntbT7e9rC6EkD":0.00033981,"SKCsc2yz6EpCqHYsTNNV1cbUjFv9ycw6AG":0.00011327,"SM9EyxNXoNKyv5rMgHGh4r81ibtuxRTsjK":0.00362469,"SK6SjhRGtes5typ2MHJBJCtsF1bNz49rUd":0.00894846,"S8Yqett18J1yBqtMeKB4raJ73A8ZkZEwu7":0.00002832,"SDdb3B8JG9nc2syEtJw7BFzuWHv8ZzNEW5":0.00147253,"S9E7sjMR3w8xM7kkaueeC6mLKa71LnZzb4":0.00283179,"S4eqxnVBAEsaN8JB8QnEgMNbk3uJrYZwU2":0.00158580,"S5Gmj1aWqAjrak2zPKBrHKnFpCvRuGQQbB":0.00192562,"RzeTEYSm85a1okSeQy5eeQaYVdiTRhP5Nk":0.00192562,"SFCAR8c9QL4wKxfQ7PD9ZiW2KoCXPEJsCg":0.00860865,"SJjq5M1QtK7uDkP47fRBhDaBwn6LPyDX8N":0.00396451,"SBTQ3QwKPnDh94TgLdvZTV2ZqJa3Wrwtyq":0.00158580,"SDtfXs9sY98QTk1MR5ox28RTpN8xtbWShP":0.00033981,"SJxS8mrgXLjqN6rKLUDzK8razonnn9ds6i":0.00509722,"S4ChkhqJHyrcbGSFUrC2YNz5GPLFVwLLfA":0.00022654,"SM78h57FuyGRb5bnaFqgf8XgJQmWhxgsuu":0.00090617,"SCWPtAEdq2F2bQ1fqfbh8GemREW5NWdxvr":0.00441759,"SHFNgbkSrimmzcAtM4zf5T84GEzSZ9YYBc":0.00271852,"SKMRpBgk5t35qsC5hrgGiodjoXN2MAfAsX":0.00045309,"SHRJrrycQjktmBajqPx9wfjsxUhdS5NYdy":0.03080989,"SE1QFQecmB17bG2nehPeRrtZxuNvjGuLDP":0.00181235,"SDvwiKRhTUwuNG6YebH35eWKuH88xwX3rY":0.00147253,"Rx9Bqs6dTm17tsiEMyZ9m4j5Yd8N2dpqwD":0.00169907,"SKS8Vxh56BN7GnGoq9pmVTVtMoZoad6d4d":0.00668303,"SA7dAUJwEb9wbFaVwFcWfN21Lgv7tNAsrB":0.00045309,"RyaZB1m8XG7f4r1jYKGrKf6vebLW72qYNo":0.00226543,"S2Ssq9pLeADHinHjcPAdBsfYkjmVEabtSj":0.14136303,"RzNubLWeHwTR3hoTrmjnHX1aPk6jLSk4EK":0.00101944,"S4QEwqDUkugv7BoSg79qJdEKT2n3BeDYuG":0.00022654,"SFfVPwrSuGVKN9gjDC7gC1mXfk12cVfLXA":0.00271852,"S1d4989RJWffAMpcgTW6n3yW2M937Hfjgi":0.00589013,"SFcqDSARz6tUfukyMBLoc6CDWjqAJy7zuK":0.00025486,"SBXxZYuYbJQE1ft5DWqtvbTAmLefMvciZZ":0.00521050,"SKNLgpKfQdCERZCr4WfJ6Pk7ETDdKimGko":0.00067963}

0 个答案:

没有答案