如何在Windows上实现RPC客户端(How to implement RPC client on Windows)
通过使用命令rpcgen自动生成客户端存根和服务器存根,方便程序员在Linux上实现rpc客户端和服务器。 现在我想在Windows上实现一个rpc客户端来从Linux上的服务器调用过程。 在Linux中,我们可以使用像gcc -Wall -o test_client test_client.c test_clnt.c这样的命令来生成客户端的可改变的程序,但是我如何在Windows上管理它?
It is convenient for programmers to implement rpc client and server on Linux by using command rpcgen to generate the client stub and the server stub automaticly. Now I want to implement a rpc client on Windows to call procedures from the server on Linux. In Linux, we can use command like gcc -Wall -o test_client test_client.c test_clnt.c to generate excutable program of the client, but how can I manage it on Windows?
原文:https://stackoverflow.com/questions/40851063
最满意答案
while True: name = input('What is your name? ') name = name.split(' ') first_name = name[0] last_name = name[1] if len(last_name) < 4: last_name += 'x'*(4-len(last_name)) together = first_name[0] + last_name[0:4] #You can add your error checks here print(together) cont = input('Would you like to go again? ') if cont == 'y': pass else: break
while True: name = input('What is your name? ') name = name.split(' ') first_name = name[0] last_name = name[1] if len(last_name) < 4: last_name += 'x'*(4-len(last_name)) together = first_name[0] + last_name[0:4] #You can add your error checks here print(together) cont = input('Would you like to go again? ') if cont == 'y': pass else: break
相关问答
更多-
TCP/IP模型是一个________。[2023-10-02]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
因为Python2.7中的string.format方法是Python3 string.format的后端端口。 Python2.7 unicode是Python 3字符串,其中Python2.7字符串是Python3字节。 字符串是在Python3中表达二进制数据的错误类型。 你会使用没有格式方法的字节。 所以你应该问为什么在2.7中字符串的format方法应该只有unicode类型,因为这是Python3中的字符串。 我想这个答案是,它太方便了。 作为一个相关问题,为什么还没有字节format Beca ...
-
我在这里找到了这个解决方案,这对我来说要简单得多: var n = 123 String("00000" + n).slice(-5); // returns 00123 ("00000" + n).slice(-5); // returns 00123 (" " + n).slice(-5); // returns " 123" (with two spaces) 在这里我对字符串对象进行了扩展: String.prototype.paddingLeft = function (paddin ...
-
while True: name = input('What is your name? ') name = name.split(' ') first_name = name[0] last_name = name[1] if len(last_name) < 4: last_name += 'x'*(4-len(last_name)) together = first_name[0] + last_name[0:4] #You ...
-
使用javascript将随机数填充到固定长度的字符串(Pad a string using random numbers to a fixed length using javascript)[2021-10-18]
如果小于想要的长度,您可以检查长度并添加一个随机数字。 function padRandom(string, length) { while (string.length < length) { string += Math.floor(Math.random() * 10); } return string; } console.log(padRandom('HAM', 10)); console.log(padRandom('TURKEY', 1 ... -
从这开始: In [546]: array = ['foo', 'bar', 'baz', 'foobar'] 使用max查找最大字符串的长度: In [547]: max(array, key=len) # ignore this line (it's for demonstrative purposes) Out[547]: 'foobar' In [548]: maxlen = len(max(array, key=len)) 现在,使用列表理解并填充左边: In [551]: [(' ' * ...
-
print(("\n{:-<{}}").format("abc", padded_length)) 另一种方式,你应该这样写 print(("{{:-<{padded_length}}}".format(padded_length=10)).format("abc")) print(("\n{:-<{}}").format("abc", padded_length)) The other way you were trying, should be written this way print(("{ ...
-
您可以使用5.5来组合截断和填充,以便输出的长度始终为5: '{:5.5}'.format('testsdf') # 'tests' '{:5.5}'.format('test') # 'test ' You can use 5.5 to combine truncating and padding so that the output will always be of length of five: '{:5.5}'.format('testsdf') # 'tests' '{:5.5}'.for ...
-
没有这样的方法。 但是,您可以编写自己的扩展方法来执行您想要的操作。 此方法的行为与经典PadLeft完全相同,但如果提供的长度为0,则返回空字符串。 如果填充低于字符串的长度,如果希望返回空字符串,则可以轻松地将条件从padLength == 0更改为padLength < input.Length 。 public static class Extensions { public static string CustomPadLeft(this string input, int padLeng ...