小编Rya*_*yan的帖子

打开Firefox的问题

我正在尝试编写一个Python脚本来打开一个URL,但是当我尝试使用它时我一直遇到错误:

import webbrowser

firefox = webbrowser.get('mozilla')
Run Code Online (Sandbox Code Playgroud)

这是错误:

Traceback (most recent call last):
  File "C:\Users\Gelu\Documents\CSCI\Image URL Generator\src\Generator.py", line 8, in <module>
    firefox = webbrowser.get('mozilla')
  File "C:\Program Files\Python31\lib\webbrowser.py", line 53, in get
    raise Error("could not locate runnable browser")
webbrowser.Error: could not locate runnable browser
Run Code Online (Sandbox Code Playgroud)

任何想法为什么这不起作用?

python browser firefox

8
推荐指数
3
解决办法
1万
查看次数

需要帮助在C中获取TCP端口号和IP地址

我正试图找到一种方法让我的服务器打印其TCP端口号和IP地址,但我现在如何产生错误的IP,我得到0.0.33.32的输出.任何帮助表示赞赏!

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/wait.h>
#include <signal.h>
#include <time.h>

#define PORT "21467"  // the port users will be connecting to

#define BACKLOG 10   // how many pending connections queue will hold

void sigchld_handler(int s)
{
while(waitpid(-1, NULL, WNOHANG) > 0);
}

// get sockaddr, IPv4 or IPv6:
void *get_in_addr(struct sockaddr *sa)
{
if (sa->sa_family == AF_INET) {
    return &(((struct sockaddr_in*)sa)->sin_addr);
}

return …
Run Code Online (Sandbox Code Playgroud)

c sockets ip-address

5
推荐指数
2
解决办法
6276
查看次数

这个语法是什么意思?(序言)

我一直在尝试学习Prolog,并在一些示例代码中遇到了这种语法.

solve(Hs) :- Hs = [_,_,_,_,_],
    member(h(_, _, _, _, dog), Hs).
Run Code Online (Sandbox Code Playgroud)

这只是代码的一部分,但我对它的确困惑h(_,_,_,_,dog).

任何帮助将不胜感激!

prolog

4
推荐指数
1
解决办法
9643
查看次数

标签 统计

browser ×1

c ×1

firefox ×1

ip-address ×1

prolog ×1

python ×1

sockets ×1