如何把Python的.py文件转为DLL文件用于调用呢? 40C

我是一枚Python新手,现在手上有一个python的Test.py文件,一个利用cython生成C的setup.py文件,通过命令行生成Test.c文件。

然后应该就可以使用.def文件生成dll文件了,但运行后,会有关于def文件中我方法名的报错:外部无法解析的外部符号。但方法名和我原py文件的方法名是一致的,为什么会报错呢?

或者有其他转dll的好办法吗?详细一些的,谢谢了。

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
树莓派安装zbar运行setup.py时找不到python.h文件

运行setup.py后显示python.h点文件找不到,我查了下python2.7,确实无python.h文件,而python3.4却有,我通过该网上说安装python-dev的包,但由于原本版本太高,存在依赖关系,出现图中情况,求大神指点![](https://img-ask.csdn.net/upload/201609/13/1473768504_786494.jpg)

调用扩展包的函数的.py文件生成.exe报错

求助大神! 我在用pyinstaller 将调用了psychopy扩展包里的函数的.py文件生成为可执行文件时,生成的.exe文件显示:ImportError: DLL load failed: 找不到指定的模块。 我在Python3.6的环境下,手动安装的psychopy-1.90.1扩展包。 待生成的.py文件如下: ![图片说明](https://img-ask.csdn.net/upload/201805/11/1526047387_84758.png) 在生成exe的时候考虑到了第三方扩展包的问题,在cmd 的D:\AA>路径下输入: pyinstaller -F -p D:\python3\psychopy; AA4.0.py 生成的.exe文件在执行时出现如下报错: D:\AA>dist\AA4.0 [1 2 3 4 5] Hello ward Enter [6 0 5 0 1 3 5 4 8 7] Traceback (most recent call last): File "AA4.0.py", line 24, in <module> from psychopy import visual File "d:\python3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "psychopy\visual\__init__.py", line 22, in <module> File "d:\python3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "psychopy\visual\basevisual.py", line 42, in <module> File "d:\python3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "psychopy\tools\monitorunittools.py", line 15, in <module> File "d:\python3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "psychopy\monitors\__init__.py", line 10, in <module> File "d:\python3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "psychopy\monitors\calibTools.py", line 36, in <module> File "d:\python3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "site-packages\scipy\optimize\__init__.py", line 270, in <module> File "d:\python3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "site-packages\scipy\optimize\optimize.py", line 37, in <module> File "d:\python3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 631, in exec_module exec(bytecode, module.__dict__) File "site-packages\scipy\optimize\linesearch.py", line 18, in <module> File "d:\python3\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 714, in load_module module = loader.load_module(fullname) ImportError: DLL load failed: 找不到指定的模块。 [62380] Failed to execute script AA4.0 感觉是pyinstaller没有把psychopy相关的模块打包进去,因为AA4.0.py中前一半不需要调用psychopy函数的程序能够在.exe中运行,但是后一半需要调用psychopy扩展包里面的函数的程序就无法运行了。 我应该怎么查是哪里出现问题的呢?

pyinstaller如何打包含有dll的.py文件?

命令:pyinstaller test.spec 执行:test.exe 出错:E:\python\project\lbmWebS\lib\testapi.dll could not be extracted! 打包的warn文件 missing module named unicodedata.ucd_3_2_0 - imported by unicodedata, stringprep, encodings.idna missing module named _warnings.warn_explicit - imported by _warnings, warnings missing module named _warnings.filters - imported by _warnings, warnings missing module named _warnings.once_registry - imported by _warnings, warnings missing module named _warnings.default_action - imported by _warnings, warnings missing module named _warnings.warn - imported by _warnings, warnings missing module named _subprocess.STD_OUTPUT_HANDLE - imported by _subprocess, subprocess missing module named _subprocess.CREATE_NEW_PROCESS_GROUP - imported by _subprocess, subprocess missing module named _subprocess.STD_INPUT_HANDLE - imported by _subprocess, subprocess missing module named _subprocess.STARTF_USESHOWWINDOW - imported by _subprocess, subprocess missing module named _subprocess.CREATE_NEW_CONSOLE - imported by _subprocess, subprocess missing module named _subprocess.STD_ERROR_HANDLE - imported by _subprocess, subprocess missing module named _subprocess.STARTF_USESTDHANDLES - imported by _subprocess, subprocess missing module named _subprocess.SW_HIDE - imported by _subprocess, subprocess missing module named cPickle.loads - imported by cPickle, collections missing module named cPickle.dumps - imported by cPickle, collections missing module named thread.get_ident - imported by thread, collections missing module named thread._local - imported by thread, threading missing module named thread.stack_size - imported by thread, threading missing module named thread.allocate_lock - imported by thread, _strptime missing module named itertools.chain - imported by itertools, heapq, collections missing module named itertools.starmap - imported by itertools, collections missing module named itertools.repeat - imported by itertools, heapq, collections missing module named itertools.imap - imported by itertools, heapq missing module named itertools.tee - imported by itertools, heapq missing module named itertools.izip - imported by itertools, heapq missing module named itertools.count - imported by itertools, heapq missing module named itertools.islice - imported by itertools, repr, heapq missing module named operator.itemgetter - imported by operator, collections, heapq missing module named operator.attrgetter - imported by operator, inspect missing module named _collections.deque - imported by _collections, collections missing module named _collections.defaultdict - imported by _collections, collections missing module named _weakref.ref - imported by _weakref, _weakrefset, weakref missing module named _weakref.ReferenceType - imported by _weakref, weakref missing module named _weakref.proxy - imported by _weakref, weakref missing module named _weakref.getweakrefs - imported by _weakref, weakref missing module named _weakref.getweakrefcount - imported by _weakref, weakref missing module named _weakref.ProxyType - imported by _weakref, weakref missing module named _weakref.CallableProxyType - imported by _weakref, weakref missing module named time.time - imported by time, threading missing module named time.sleep - imported by time, threading missing module named datetime.date - imported by datetime, _strptime missing module named errno.ENOENT - imported by errno, gettext missing module named _functools.partial - imported by _functools, functools missing module named _functools.reduce - imported by _functools, functools missing module named copy.deepcopy - imported by copy, weakref missing module named exceptions.ReferenceError - imported by exceptions, weakref missing module named binascii.hexlify - imported by binascii, random missing module named math.sin - imported by math, random missing module named math.sqrt - imported by math, random missing module named math.cos - imported by math, random missing module named math.acos - imported by math, random missing module named math.ceil - imported by math, random missing module named math.exp - imported by math, random missing module named math.log - imported by math, random missing module named math.e - imported by math, random missing module named math.pi - imported by math, random missing module named readline - imported by cmd, pdb missing module named errno.EINVAL - imported by errno, StringIO missing module named cStringIO.StringIO - imported by cStringIO, gettext, pickle, pprint, shlex, tempfile, encodings.uu_codec, quopri, encodings.quopri_codec missing module named binascii.b2a_qp - imported by binascii, quopri missing module named binascii.a2b_qp - imported by binascii, quopri missing module named binascii.a2b_uu - imported by binascii, encodings.uu_codec missing module named binascii.b2a_uu - imported by binascii, encodings.uu_codec missing module named 'org.python'.PyStringMap - imported by 'org.python', pickle missing module named 'org.python' - imported by pickle missing module named struct.calcsize - imported by struct, ctypes missing module named _struct.__doc__ - imported by _struct, struct missing module named _struct._clearcache - imported by _struct, struct missing module named fcntl - imported by subprocess, tempfile missing module named threading.RLock - imported by threading, _threading_local missing module named threading.current_thread - imported by threading, _threading_local missing module named os.urandom - imported by os, random missing module named riscosenviron._Environ - imported by riscosenviron, os missing module named riscosenviron - imported by os missing module named riscospath - imported by os missing module named riscos._exit - imported by riscos, os missing module named riscos - imported by os missing module named ce._exit - imported by ce, os missing module named ce - imported by os missing module named _emx_link.link - imported by _emx_link, os missing module named _emx_link - imported by os missing module named os2._exit - imported by os2, os missing module named os2 - imported by os missing module named nt._isdir - imported by nt, ntpath missing module named nt._getfullpathname - imported by nt, ntpath missing module named nt._exit - imported by nt, os missing module named pwd - imported by posixpath missing module named posix._exit - imported by posix, os missing module named posix - imported by os missing module named resource - imported by posix missing module named strop.whitespace - imported by strop, string missing module named strop.maketrans - imported by strop, string missing module named strop.lowercase - imported by strop, string missing module named strop.uppercase - imported by strop, string missing module named org.PyStringMap - imported by org, copy missing module named org - imported by copy missing module named re._compile - imported by re, sre missing module named re.__all__ - imported by re, sre missing module named codecs.mbcs_encode - imported by codecs, encodings.mbcs missing module named codecs.mbcs_decode - imported by codecs, encodings.mbcs missing module named _ctypes._wstring_at_addr - imported by _ctypes, ctypes missing module named _ctypes._string_at_addr - imported by _ctypes, ctypes missing module named _ctypes._cast_addr - imported by _ctypes, ctypes missing module named _ctypes._memset_addr - imported by _ctypes, ctypes missing module named _ctypes._memmove_addr - imported by _ctypes, ctypes missing module named _ctypes.get_last_error - imported by _ctypes, ctypes missing module named _ctypes.set_last_error - imported by _ctypes, ctypes missing module named _ctypes._check_HRESULT - imported by _ctypes, ctypes missing module named _ctypes.set_conversion_mode - imported by _ctypes, ctypes missing module named _ctypes._pointer_type_cache - imported by _ctypes, ctypes missing module named _ctypes.POINTER - imported by _ctypes, ctypes missing module named _ctypes._SimpleCData - imported by _ctypes, ctypes missing module named _ctypes.get_errno - imported by _ctypes, ctypes missing module named _ctypes.set_errno - imported by _ctypes, ctypes missing module named _ctypes.alignment - imported by _ctypes, ctypes missing module named _ctypes.addressof - imported by _ctypes, ctypes missing module named _ctypes.resize - imported by _ctypes, ctypes missing module named _ctypes.byref - imported by _ctypes, ctypes missing module named _ctypes.sizeof - imported by _ctypes, ctypes missing module named _ctypes.dlopen - imported by _ctypes, ctypes missing module named _ctypes.FUNCFLAG_STDCALL - imported by _ctypes, ctypes missing module named _ctypes.LoadLibrary - imported by _ctypes, ctypes missing module named _ctypes.FUNCFLAG_USE_ERRNO - imported by _ctypes, ctypes missing module named _ctypes.FUNCFLAG_USE_LASTERROR - imported by _ctypes, ctypes missing module named _ctypes.FUNCFLAG_PYTHONAPI - imported by _ctypes, ctypes missing module named _ctypes.FUNCFLAG_CDECL - imported by _ctypes, ctypes missing module named _ctypes.FormatError - imported by _ctypes, ctypes missing module named _ctypes.ArgumentError - imported by _ctypes, ctypes missing module named _ctypes.RTLD_LOCAL - imported by _ctypes, ctypes missing module named _ctypes.RTLD_GLOBAL - imported by _ctypes, ctypes missing module named _ctypes.__version__ - imported by _ctypes, ctypes missing module named _ctypes.CFuncPtr - imported by _ctypes, ctypes missing module named _ctypes._Pointer - imported by _ctypes, ctypes missing module named _ctypes.Structure - imported by _ctypes, ctypes missing module named _ctypes.Array - imported by _ctypes, ctypes missing module named _ctypes.Union - imported by _ctypes, ctypes

我尝试在python中调用DLL,但我找不到函数,请帮助我

正如标题所说,我试图使用python调用一个DLL,但是遇到了问题 ## # 请帮助我,非常感谢**** **python**: ``` dllPath = r"D:\fomas-Com" os.chdir(dllPath) dllName = dllPath + "\Imccor01.dll" dll = cdll.LoadLibrary(name=dllName) dll.RainflowAnalysis.AddResidue() ``` **发生的错误:** ``` Traceback (most recent call last): File "D:/111/Test/dlltest.py", line 17, in <module> dll.DFile.Open() File "D:\111\Anaconda3\envs\env_name\lib\ctypes\__init__.py", line 361, in __getattr__ func = self.__getitem__(name) File "D:\111\Anaconda3\envs\env_name\lib\ctypes\__init__.py", line 366, in __getitem__ func = self._FuncPtr((name_or_ordinal, self)) AttributeError: function 'DFile' not found ``` **在VB中成功调用:** ``` # 工程中加载了Dll Sub ProcessFile(SrcFileName As String) On Error GoTo FinalCleanUp Call ClearAllMsg Dim SrcFile As New DFile, C As DChannel, TotalNum As Integer SrcFile.Open SrcFileName, cdmFileRead For i = 1 To SrcFile.Count Form1.DataName.Text = SrcFile.GetObjectName(i) ```

yolo3 darknet.py问题

我用darknetAB https://github.com/AlexeyAB/darknet 编译gpu版本后生成darknet.py文件 然后我也编译了yolo_cpp_dll.sln文件 生成dll文件 然后运行darknet.py文件 不显示图片 异常退出 ![图片说明](https://img-ask.csdn.net/upload/201911/02/1572688446_628910.png) 百度了这个问题 有人说要换python3.5版本 我也尝试了 但是也是不行 不会显示图片。请问各位大佬到底怎么解决??急!!!谢谢!!! ``` #!python3 """ Python 3 wrapper for identifying objects in images Requires DLL compilation Both the GPU and no-GPU version should be compiled; the no-GPU version should be renamed "yolo_cpp_dll_nogpu.dll". On a GPU system, you can force CPU evaluation by any of: - Set global variable DARKNET_FORCE_CPU to True - Set environment variable CUDA_VISIBLE_DEVICES to -1 - Set environment variable "FORCE_CPU" to "true" To use, either run performDetect() after import, or modify the end of this file. See the docstring of performDetect() for parameters. Directly viewing or returning bounding-boxed images requires scikit-image to be installed (`pip install scikit-image`) Original *nix 2.7: https://github.com/pjreddie/darknet/blob/0f110834f4e18b30d5f101bf8f1724c34b7b83db/python/darknet.py Windows Python 2.7 version: https://github.com/AlexeyAB/darknet/blob/fc496d52bf22a0bb257300d3c79be9cd80e722cb/build/darknet/x64/darknet.py @author: Philip Kahn @date: 20180503 """ #pylint: disable=R, W0401, W0614, W0703 from ctypes import * import math import random import os def sample(probs): s = sum(probs) probs = [a/s for a in probs] r = random.uniform(0, 1) for i in range(len(probs)): r = r - probs[i] if r <= 0: return i return len(probs)-1 def c_array(ctype, values): arr = (ctype*len(values))() arr[:] = values return arr class BOX(Structure): _fields_ = [("x", c_float), ("y", c_float), ("w", c_float), ("h", c_float)] class DETECTION(Structure): _fields_ = [("bbox", BOX), ("classes", c_int), ("prob", POINTER(c_float)), ("mask", POINTER(c_float)), ("objectness", c_float), ("sort_class", c_int)] class IMAGE(Structure): _fields_ = [("w", c_int), ("h", c_int), ("c", c_int), ("data", POINTER(c_float))] class METADATA(Structure): _fields_ = [("classes", c_int), ("names", POINTER(c_char_p))] #lib = CDLL("/home/pjreddie/documents/darknet/libdarknet.so", RTLD_GLOBAL) #lib = CDLL("libdarknet.so", RTLD_GLOBAL) hasGPU = True if os.name == "nt": cwd = os.path.dirname(__file__) os.environ['PATH'] = cwd + ';' + os.environ['PATH'] winGPUdll = os.path.join(cwd, "yolo_cpp_dll.dll") winNoGPUdll = os.path.join(cwd, "yolo_cpp_dll_nogpu.dll") envKeys = list() for k, v in os.environ.items(): envKeys.append(k) try: try: tmp = os.environ["FORCE_CPU"].lower() if tmp in ["1", "true", "yes", "on"]: raise ValueError("ForceCPU") else: print("Flag value '"+tmp+"' not forcing CPU mode") except KeyError: # We never set the flag if 'CUDA_VISIBLE_DEVICES' in envKeys: if int(os.environ['CUDA_VISIBLE_DEVICES']) < 0: raise ValueError("ForceCPU") try: global DARKNET_FORCE_CPU if DARKNET_FORCE_CPU: raise ValueError("ForceCPU") except NameError: pass # print(os.environ.keys()) # print("FORCE_CPU flag undefined, proceeding with GPU") if not os.path.exists(winGPUdll): raise ValueError("NoDLL") lib = CDLL(winGPUdll, RTLD_GLOBAL) except (KeyError, ValueError): hasGPU = False if os.path.exists(winNoGPUdll): lib = CDLL(winNoGPUdll, RTLD_GLOBAL) print("Notice: CPU-only mode") else: # Try the other way, in case no_gpu was # compile but not renamed lib = CDLL(winGPUdll, RTLD_GLOBAL) print("Environment variables indicated a CPU run, but we didn't find `"+winNoGPUdll+"`. Trying a GPU run anyway.") else: lib = CDLL("./libdarknet.so", RTLD_GLOBAL) lib.network_width.argtypes = [c_void_p] lib.network_width.restype = c_int lib.network_height.argtypes = [c_void_p] lib.network_height.restype = c_int copy_image_from_bytes = lib.copy_image_from_bytes copy_image_from_bytes.argtypes = [IMAGE,c_char_p] def network_width(net): return lib.network_width(net) def network_height(net): return lib.network_height(net) predict = lib.network_predict_ptr predict.argtypes = [c_void_p, POINTER(c_float)] predict.restype = POINTER(c_float) if hasGPU: set_gpu = lib.cuda_set_device set_gpu.argtypes = [c_int] make_image = lib.make_image make_image.argtypes = [c_int, c_int, c_int] make_image.restype = IMAGE get_network_boxes = lib.get_network_boxes get_network_boxes.argtypes = [c_void_p, c_int, c_int, c_float, c_float, POINTER(c_int), c_int, POINTER(c_int), c_int] get_network_boxes.restype = POINTER(DETECTION) make_network_boxes = lib.make_network_boxes make_network_boxes.argtypes = [c_void_p] make_network_boxes.restype = POINTER(DETECTION) free_detections = lib.free_detections free_detections.argtypes = [POINTER(DETECTION), c_int] free_ptrs = lib.free_ptrs free_ptrs.argtypes = [POINTER(c_void_p), c_int] network_predict = lib.network_predict_ptr network_predict.argtypes = [c_void_p, POINTER(c_float)] reset_rnn = lib.reset_rnn reset_rnn.argtypes = [c_void_p] load_net = lib.load_network load_net.argtypes = [c_char_p, c_char_p, c_int] load_net.restype = c_void_p load_net_custom = lib.load_network_custom load_net_custom.argtypes = [c_char_p, c_char_p, c_int, c_int] load_net_custom.restype = c_void_p do_nms_obj = lib.do_nms_obj do_nms_obj.argtypes = [POINTER(DETECTION), c_int, c_int, c_float] do_nms_sort = lib.do_nms_sort do_nms_sort.argtypes = [POINTER(DETECTION), c_int, c_int, c_float] free_image = lib.free_image free_image.argtypes = [IMAGE] letterbox_image = lib.letterbox_image letterbox_image.argtypes = [IMAGE, c_int, c_int] letterbox_image.restype = IMAGE load_meta = lib.get_metadata lib.get_metadata.argtypes = [c_char_p] lib.get_metadata.restype = METADATA load_image = lib.load_image_color load_image.argtypes = [c_char_p, c_int, c_int] load_image.restype = IMAGE rgbgr_image = lib.rgbgr_image rgbgr_image.argtypes = [IMAGE] predict_image = lib.network_predict_image predict_image.argtypes = [c_void_p, IMAGE] predict_image.restype = POINTER(c_float) predict_image_letterbox = lib.network_predict_image_letterbox predict_image_letterbox.argtypes = [c_void_p, IMAGE] predict_image_letterbox.restype = POINTER(c_float) def array_to_image(arr): import numpy as np # need to return old values to avoid python freeing memory arr = arr.transpose(2,0,1) c = arr.shape[0] h = arr.shape[1] w = arr.shape[2] arr = np.ascontiguousarray(arr.flat, dtype=np.float32) / 255.0 data = arr.ctypes.data_as(POINTER(c_float)) im = IMAGE(w,h,c,data) return im, arr def classify(net, meta, im): out = predict_image(net, im) res = [] for i in range(meta.classes): if altNames is None: nameTag = meta.names[i] else: nameTag = altNames[i] res.append((nameTag, out[i])) res = sorted(res, key=lambda x: -x[1]) return res def detect(net, meta, image, thresh=.5, hier_thresh=.5, nms=.45, debug= False): """ Performs the meat of the detection """ #pylint: disable= C0321 im = load_image(image, 0, 0) if debug: print("Loaded image") ret = detect_image(net, meta, im, thresh, hier_thresh, nms, debug) free_image(im) if debug: print("freed image") return ret def detect_image(net, meta, im, thresh=.5, hier_thresh=.5, nms=.45, debug= False): #import cv2 #custom_image_bgr = cv2.imread(image) # use: detect(,,imagePath,) #custom_image = cv2.cvtColor(custom_image_bgr, cv2.COLOR_BGR2RGB) #custom_image = cv2.resize(custom_image,(lib.network_width(net), lib.network_height(net)), interpolation = cv2.INTER_LINEAR) #import scipy.misc #custom_image = scipy.misc.imread(image) #im, arr = array_to_image(custom_image) # you should comment line below: free_image(im) num = c_int(0) if debug: print("Assigned num") pnum = pointer(num) if debug: print("Assigned pnum") predict_image(net, im) letter_box = 0 #predict_image_letterbox(net, im) #letter_box = 1 if debug: print("did prediction") # dets = get_network_boxes(net, custom_image_bgr.shape[1], custom_image_bgr.shape[0], thresh, hier_thresh, None, 0, pnum, letter_box) # OpenCV dets = get_network_boxes(net, im.w, im.h, thresh, hier_thresh, None, 0, pnum, letter_box) if debug: print("Got dets") num = pnum[0] if debug: print("got zeroth index of pnum") if nms: do_nms_sort(dets, num, meta.classes, nms) if debug: print("did sort") res = [] if debug: print("about to range") for j in range(num): if debug: print("Ranging on "+str(j)+" of "+str(num)) if debug: print("Classes: "+str(meta), meta.classes, meta.names) for i in range(meta.classes): if debug: print("Class-ranging on "+str(i)+" of "+str(meta.classes)+"= "+str(dets[j].prob[i])) if dets[j].prob[i] > 0: b = dets[j].bbox if altNames is None: nameTag = meta.names[i] else: nameTag = altNames[i] if debug: print("Got bbox", b) print(nameTag) print(dets[j].prob[i]) print((b.x, b.y, b.w, b.h)) res.append((nameTag, dets[j].prob[i], (b.x, b.y, b.w, b.h))) if debug: print("did range") res = sorted(res, key=lambda x: -x[1]) if debug: print("did sort") free_detections(dets, num) if debug: print("freed detections") return res netMain = None metaMain = None altNames = None def performDetect(imagePath="data/dog.jpg", thresh= 0.25, configPath = "./cfg/yolov3.cfg", weightPath = "yolov3.weights", metaPath= "./cfg/coco.data", showImage= True, makeImageOnly = False, initOnly= False): """ Convenience function to handle the detection and returns of objects. Displaying bounding boxes requires libraries scikit-image and numpy Parameters ---------------- imagePath: str Path to the image to evaluate. Raises ValueError if not found thresh: float (default= 0.25) The detection threshold configPath: str Path to the configuration file. Raises ValueError if not found weightPath: str Path to the weights file. Raises ValueError if not found metaPath: str Path to the data file. Raises ValueError if not found showImage: bool (default= True) Compute (and show) bounding boxes. Changes return. makeImageOnly: bool (default= False) If showImage is True, this won't actually *show* the image, but will create the array and return it. initOnly: bool (default= False) Only initialize globals. Don't actually run a prediction. Returns ---------------------- When showImage is False, list of tuples like ('obj_label', confidence, (bounding_box_x_px, bounding_box_y_px, bounding_box_width_px, bounding_box_height_px)) The X and Y coordinates are from the center of the bounding box. Subtract half the width or height to get the lower corner. Otherwise, a dict with { "detections": as above "image": a numpy array representing an image, compatible with scikit-image "caption": an image caption } """ # Import the global variables. This lets us instance Darknet once, then just call performDetect() again without instancing again global metaMain, netMain, altNames #pylint: disable=W0603 assert 0 < thresh < 1, "Threshold should be a float between zero and one (non-inclusive)" if not os.path.exists(configPath): raise ValueError("Invalid config path `"+os.path.abspath(configPath)+"`") if not os.path.exists(weightPath): raise ValueError("Invalid weight path `"+os.path.abspath(weightPath)+"`") if not os.path.exists(metaPath): raise ValueError("Invalid data file path `"+os.path.abspath(metaPath)+"`") if netMain is None: netMain = load_net_custom(configPath.encode("ascii"), weightPath.encode("ascii"), 0, 1) # batch size = 1 if metaMain is None: metaMain = load_meta(metaPath.encode("ascii")) if altNames is None: # In Python 3, the metafile default access craps out on Windows (but not Linux) # Read the names file and create a list to feed to detect try: with open(metaPath) as metaFH: metaContents = metaFH.read() import re match = re.search("names *= *(.*)$", metaContents, re.IGNORECASE | re.MULTILINE) if match: result = match.group(1) else: result = None try: if os.path.exists(result): with open(result) as namesFH: namesList = namesFH.read().strip().split("\n") altNames = [x.strip() for x in namesList] except TypeError: pass except Exception: pass if initOnly: print("Initialized detector") return None if not os.path.exists(imagePath): raise ValueError("Invalid image path `"+os.path.abspath(imagePath)+"`") # Do the detection #detections = detect(netMain, metaMain, imagePath, thresh) # if is used cv2.imread(image) detections = detect(netMain, metaMain, imagePath.encode("ascii"), thresh) if showImage: try: from skimage import io, draw import numpy as np image = io.imread(imagePath) print("*** "+str(len(detections))+" Results, color coded by confidence ***") imcaption = [] for detection in detections: label = detection[0] confidence = detection[1] pstring = label+": "+str(np.rint(100 * confidence))+"%" imcaption.append(pstring) print(pstring) bounds = detection[2] shape = image.shape # x = shape[1] # xExtent = int(x * bounds[2] / 100) # y = shape[0] # yExtent = int(y * bounds[3] / 100) yExtent = int(bounds[3]) xEntent = int(bounds[2]) # Coordinates are around the center xCoord = int(bounds[0] - bounds[2]/2) yCoord = int(bounds[1] - bounds[3]/2) boundingBox = [ [xCoord, yCoord], [xCoord, yCoord + yExtent], [xCoord + xEntent, yCoord + yExtent], [xCoord + xEntent, yCoord] ] # Wiggle it around to make a 3px border rr, cc = draw.polygon_perimeter([x[1] for x in boundingBox], [x[0] for x in boundingBox], shape= shape) rr2, cc2 = draw.polygon_perimeter([x[1] + 1 for x in boundingBox], [x[0] for x in boundingBox], shape= shape) rr3, cc3 = draw.polygon_perimeter([x[1] - 1 for x in boundingBox], [x[0] for x in boundingBox], shape= shape) rr4, cc4 = draw.polygon_perimeter([x[1] for x in boundingBox], [x[0] + 1 for x in boundingBox], shape= shape) rr5, cc5 = draw.polygon_perimeter([x[1] for x in boundingBox], [x[0] - 1 for x in boundingBox], shape= shape) boxColor = (int(255 * (1 - (confidence ** 2))), int(255 * (confidence ** 2)), 0) draw.set_color(image, (rr, cc), boxColor, alpha= 0.8) draw.set_color(image, (rr2, cc2), boxColor, alpha= 0.8) draw.set_color(image, (rr3, cc3), boxColor, alpha= 0.8) draw.set_color(image, (rr4, cc4), boxColor, alpha= 0.8) draw.set_color(image, (rr5, cc5), boxColor, alpha= 0.8) if not makeImageOnly: io.imshow(image) io.show() detections = { "detections": detections, "image": image, "caption": "\n<br/>".join(imcaption) } except Exception as e: print("Unable to show image: "+str(e)) return detections if __name__ == "__main__": print(performDetect()) ```

python怎样调用和注册dll或com组件

我尝试调用大漠插件代码如下 import win32com.client dm = win32com.client.Dispatch('dm.dmsoft') print(dm.Ver()) 报错如下: F:\soft\python\python.exe F:/python_work/test_dir/test.py Traceback (most recent call last): File "F:\soft\python\lib\site-packages\win32com\client\dynamic.py", line 89, in _GetGoodDispatch IDispatch = pythoncom.connect(IDispatch) pywintypes.com_error: (-2147221021, '操作无法使用', None, None) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "F:/python_work/test_dir/test.py", line 9, in <module> dm = win32com.client.Dispatch('dm.dmsoft') File "F:\soft\python\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx) File "F:\soft\python\lib\site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName return (_GetGoodDispatch(IDispatch, clsctx), userName) File "F:\soft\python\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch) pywintypes.com_error: (-2147221164, '没有注册类', None, None) 请大神们详细指点下怎样操作 本人小白一个 跪谢!! QQ:1746476939

用C++写了一个类,封装成dLL,python调用报错,如何解决?

我是一个学c++的学生, 写了个dll给python调用,报错win[1114] (dll的名字是Project3.dll) class.h ``` #ifndef __CLASS_H__ #define __CLASS_H__ class a { public: int fac(int z); void setx(int z); private: int x; }; #endif ``` class.cpp ``` #include "class.h" #include <windows.h> #include <cstdio> int a::fac(int z) { if(z == 1) return 1; return z*fac(z-1); } void a::setx(int z) { x = z; } ``` interface.h ``` #ifndef _DLL_H_ #define _DLL_H_ #define DLLIMPORT __declspec(dllexport) extern"C" { #include "class.h" } extern "C" { DLLIMPORT int fac(a* A,int z); DLLIMPORT void setx(a* A,int z); DLLIMPORT a* makea(); } #endif ``` interface.cpp ``` #include"interface.h" int fac(a* A,int z) { return A->fac(z); } void setx(a* A,int z) { A->setx(z); } a* makea() { return new a(); } ``` 然后用python调用 test.py ``` from ctypes import * c_lib = CDLL('E:/dlltest/Project3.dll') ``` 报错 ``` D:\python\python.exe C:/Users/mcc2018/PycharmProjects/untitled1/test.py Traceback (most recent call last): File "C:/Users/mcc2018/PycharmProjects/untitled1/test.py", line 2, in <module> c_lib = CDLL('E:/dlltest/Project3.dll') File "ctypes\__init__.py", line 369, in __init__ OSError: [WinError 1114] 动态链接库(DLL)初始化例程失败。 Process finished with exit code 1 ``` 请各位前辈大工程师们帮帮我

python编写com组件问题

背景: 我想用python编写一个com组件,然后在vbs中调用. **文件: PyHello.py文件** ``` class PyHello(object): def __init__(self): pass def SayHello(self): return 'Hello Python!' def DoAdd(self, a, b): return a + b class _WrapPyHello(PyHello): import pythoncom # _reg_clsid_ = '{4ae5ed1d-c378-4da1-9816-5a038112dlksdjfasio}' _reg_clsid_ = pythoncom.CreateGuid() _reg_progid_ = "Python.PyHello" _public_methods_ = ['SayHello','DoAdd'] if __name__=='__main__': import win32com.server.register win32com.server.register.UseCommandLine(_WrapPyHello) ``` **setup.py文件** ``` from distutils.core import setup import py2exe setup(com_server=["PyHello"], zipfile = None, options = { 'py2exe' : { "bundle_files": 1, "dll_excludes": ["MSVCP90.dll","w9xpopen.exe"] } } ) ``` **如果直接运行 PyHello.py 之后,其实已经注册好了,已经可以用VBS调用了** **VBS 代码:** ``` Set inst = CreateObject("Python.PyHello") MsgBox "1111" MsgBox inst.SayHello() MsgBox inst.DoAdd(1,3) ``` 现在的问题是,怎么把PyHello.py这个文件编译成dll, 然后在VBS中不依赖python的环境使用. 参考资料: https://zhuanlan.zhihu.com/p/22023698?refer=python-dev 用这个帖子中的方法,我没有成功 其它资料: https://www.oschina.net/code/snippet_91334_19994 https://blog.csdn.net/qiaokelinaicha/article/details/68921470 https://blog.csdn.net/DarkChampion/article/details/4420139 困扰好久了, 哪位大神熟悉python,请帮帮忙.

python调用com接口文件的问题,求助!!!

通过pywin32中的makepy得到了外部程序的开放接口对象及方法,命名为jzt 想引用IIApplication对象的MsgOut方法,但是报错 ![图片说明](https://img-ask.csdn.net/upload/201602/28/1456654777_471978.png) 并且在输入时提示如图所示 import jzt jzt.IIApplication.MsgOut('as') 下面是错误内容: _Traceback (most recent call last): File "<pyshell#40>", line 1, in <module> jzt.IIApplication.MsgOut('as') File "C:\Python34\jzt.py", line 230, in MsgOut return self._oleobj_.InvokeTypes(37, LCID, 1, (24, 0), ((8, 0),),Text AttributeError: 'str' object has no attribute '_oleobj_'_

求大神指点!命令行运行python的调用brian包的SNN网络程序报错

求大神指点!用命令行运行python就一直报这个错,安装vcforpython也不行。。 E:\python\stdp-mnist-master>python "Diehl&Cook_spiking_MNIST.py" C:\Python27\lib\site-packages\brian_no_units.py:4: UserWarning: Turning off units warnings.warn("Turning off units") time needed to load training set: 13.7289998531 time needed to load test set: 1.8220000267 brian.stateupdater: WARNING Using codegen CStateUpdater brian.stateupdater: WARNING Using codegen CStateUpdater create neuron group A create recurrent connections (400L, 3L) ./weights/../random/AeAi.npy (160000L, 3L) ./weights/../random/AiAe.npy create monitors for A create connections between X and A (313600L, 3L) ./weights/XeAe.npy Looking for python27.dll Looking for python27.dll Looking for python27.dll brian.experimental.codegen.stateupdaters: WARNING C compilation failed, falling back on Python. Traceback (most recent call last): File "Diehl&Cook_spiking_MNIST.py", line 455, in <module> b.run(single_example_time, report='text') File "C:\Python27\lib\site-packages\brian\network.py", line 938, in run report=report, report_period=report_period) File "C:\Python27\lib\site-packages\brian\network.py", line 574, in run self.update() File "C:\Python27\lib\site-packages\brian\network.py", line 518, in update f() File "C:\Python27\lib\site-packages\brian\neurongroup.py", line 513, in update self.LS.push(spikes) # Store spikes File "C:\Python27\lib\site-packages\brian\utils\ccircular\ccircular.py", line 128, in push def push(self, *args): return _ccircular.SpikeContainer_push(self, *args) TypeError: Array of type 'long' required. Array of type 'long long' given

python调用com接口问题

请教下各位,用python实现VISSIM(交通仿真软件)的调用。能够打开软件,载入文件。但实现不了对API的调用,关联不到typelibaray(写代码时也没自动补全)。 代码如下:# -*- coding: utf-8 -*- import win32com.client as com Vissim = com.Dispatch("Vissim.Vissim") Filename = r'E:\study\1.inp' Vissim.LoadNet(Filename) Link_number = 1 Name_of_Link = Vissim.Net.Links.ItemByKey(Link_number).AttValue('Name') print 'Name of Link(',Link_number,'):',Name_of_Link #获得道路名称 错误提示: Traceback (most recent call last): File "<string>", line 254, in run_nodebug File "C:\Users\Administrator\Desktop\develop\LOAD3.py", line 19, in <module> Name_of_Link = Vissim.Net.Links.ItemByKey(Link_number).AttValue('Name') File "D:\Python\lib\site-packages\win32com\client\dynamic.py", line 527, in __getattr__ raise AttributeError("%s.%s" % (self._username_, attr)) AttributeError: <unknown>.ItemByKey 这是什么原因呢,请大手子解答下~金币不多,请见谅 也试过用regsvr32 和 regam 去注册dll文件(不清楚是哪个就都试了一遍) ![图片说明](https://img-ask.csdn.net/upload/201705/15/1494819662_358196.png)

python import matplotlib.pyplot 报错 DLL load failed

Anaconda3.5 python3.6 pycharm win7系统 import matplotlib没问题 matplotlib 2.1.0 import matplotlib.pyplot 报错 ![图片说明](https://img-ask.csdn.net/upload/201712/07/1512653783_182335.png) 另外,import matplotlib之前有个错误,更新了numpy之后好了。 在网上没找到类似的问题

Python3.7+Pyside2 运行exe文件提示“ImportError: DLL load failed: 找不到指定的程序。

# Python3.7+Pyside2 运行exe文件提示“ImportError: DLL load failed: 找不到指定的程序 1.问题描述 a.python 3.7 + pyside2 (只用pyside2,没有使用PyQt5) b.使用pyinstaller -F xxx.py 打包,生成xxx.exe c.使用cmd运行exe文件 2.报错 Traceback (most recent call last): File "PyInstaller\loader\rthooks\pyi_rth_qt5plugins.py", line 47, in <module> ModuleNotFoundError: No module named 'PyQt5' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "PyInstaller\loader\rthooks\pyi_rth_qt5plugins.py", line 49, in <module> ImportError: DLL load failed: 找不到指定的程序。 [16072] Failed to execute script pyi_rth_qt5plugins 不知道为啥提示No module named 'PyQt5',在安装的lib中也只有pyside2; 多谢大神指点。 20190730,更新: 经过多次尝试和修改,发现lib库的安装的问题。代码中没有调用QT5的,在lib安装的时候,如果是使用pycharm setting中安装,安装的路径是在项目的文件夹,如果使用python的终端命令pip进行安装,安装在python的lib目录下,两个路径有时候不能完全的调用。 后来重新都是统一使用python 终端 pip命令安装,问题解决。

DLL文件初始化例程失败问题

工作原因,需要在windows系统上手动加载dll文件 windows提供了一个 rundll32.exe可以调用dll文件 我的启动方式是: rundll32.exe+dll文件+dllmain ![图片说明](https://img-ask.csdn.net/upload/201909/19/1568875913_207172.jpg) 但是会出现初始化例程失败的问题 ![图片说明](https://img-ask.csdn.net/upload/201909/19/1568876022_486795.jpg) 该dll经查询是使用Delphi编写的文件,用depends查询也补齐了所需的依赖项 好久都没解决这问题,难受。 前来请教各位大佬们 无尽感谢!

pycharm使用时,出现模块调用失败,怎么解决?

Traceback (most recent call last): File "C:/Temp/lassos/first.py", line 4, in <module> from sklearn.preprocessing import Imputer File "C:\Users\Dell\Anaconda3\lib\site-packages\sklearn\__init__.py", line 134, in <module> from .base import clone File "C:\Users\Dell\Anaconda3\lib\site-packages\sklearn\base.py", line 13, in <module> from .utils.fixes import signature File "C:\Users\Dell\Anaconda3\lib\site-packages\sklearn\utils\__init__.py", line 10, in <module> from .validation import (as_float_array, File "C:\Users\Dell\Anaconda3\lib\site-packages\sklearn\utils\validation.py", line 18, in <module> from ..utils.fixes import signature File "C:\Users\Dell\Anaconda3\lib\site-packages\sklearn\utils\fixes.py", line 144, in <module> from scipy.sparse.linalg import lsqr as sparse_lsqr # noqa File "C:\Users\Dell\Anaconda3\lib\site-packages\scipy\sparse\linalg\__init__.py", line 114, in <module> from .isolve import * File "C:\Users\Dell\Anaconda3\lib\site-packages\scipy\sparse\linalg\isolve\__init__.py", line 8, in <module> from .lgmres import lgmres File "C:\Users\Dell\Anaconda3\lib\site-packages\scipy\sparse\linalg\isolve\lgmres.py", line 10, in <module> from scipy.linalg import get_blas_funcs, get_lapack_funcs File "C:\Users\Dell\Anaconda3\lib\site-packages\scipy\linalg\__init__.py", line 190, in <module> from .misc import * File "C:\Users\Dell\Anaconda3\lib\site-packages\scipy\linalg\misc.py", line 5, in <module> from .blas import get_blas_funcs File "C:\Users\Dell\Anaconda3\lib\site-packages\scipy\linalg\blas.py", line 214, in <module> from scipy.linalg import _fblas ImportError: DLL load failed: The specified module could not be found.

用C#调用python程序(含第三方库)

本人使python小白,但是最近要做一个界面,开始我用C#,但是调用含第三方库(TensorFlow)的python程序时会报错,而且必须安装有python的编译环境,在网上查了一些资料可以先用C++调用Python,再打包成dll文件给C#调用,可是这样一来就很麻烦。所以我在想直接用Python+QT做界面会不会好一点。有没有大佬给点建议。

YOLO在python中调用设置darknet.set_gpu(1)无效

我的操作系统是macos,显卡为GT750M,已经成功安装了cuda,在终端调用yolo官网的示例代码可以实现gpu运算,但在python中按照作者封装好的darknet.py调用yolo时设置darknet.set_gpu(1)却无法使用gpu运算,仍是cpu运算。 我在/src/cuda.c中把cuda_set_device函数的gpu_index直接设置为1,仍无法使用gpu运算,我对c++了解的不是很多,希望大神可以帮我解决这个问题。

运行python批处理文件,报了一个缺少属性“key”错误,找到源码但是看不懂,求大佬们解答

在使用自己的数据集做训练时,用到一个retrain.py的文件,之后通过批处理文件运行 以下是批处理文件代码: ``` python D:\python\Anaconda\envs\tensorflow\tensorflow-master\tensorflow\examples\image_retraining\retrain.py ^ --bottleneck_dir bottleneck ^ --how_many_training_steps 200 ^ --model_dir D:\python\Anaconda\envs\tensorflow\inception_model ^ --output_graph output_graph.pb ^ --output_labels output_labels.txt ^ --image_dir data/train/ pause ``` 调用时,报了 File "D:\python\Anaconda\envs\tensorflow\tensorflow-master\tensorflow\examples\image_retraining\retrain.py", line 1313, in <module> tf.app.run(main=main, argv=[sys.argv[0]] + unparsed) File "D:\python\Anaconda\envs\tensorflow\lib\site-packages\tensorflow\python\platform\app.py", line 125, in run _sys.exit(main(argv)) File "D:\python\Anaconda\envs\tensorflow\tensorflow-master\tensorflow\examples\image_retraining\retrain.py", line 982, in main class_count = len(image_lists.keys()) AttributeError: 'NoneType' object has no attribute 'keys' 错误最后是说982行缺少keys属性,但不知如何修改 retrain代码太长,只能把链接发上来

fastdfs python客户端fdfs_client_py上传从文件问题

有人用过fdfs的python 客户端fdfs_client_py上传文件吗?我的代码如下: ``` def upload_file(self,filePath=None,slaveFilePath=None): #upload the apk and the apk details html file into fastdfs storage #apk file as master file while html file as slave file if filePath is None: return None ret={} client=Fdfs_client(self.m_clientConf) result=client.upload_by_filename(filePath) #upload master file master_fileId='' if result is not None: #success self.m_logger.info(" save %s into fdfs success"%filePath) print " save %s into fdfs success"%filePath print result ret['storageIp']=result['Storage IP'] ret['groupName']=result['Group name'] ret['masterFileId']=result['Remote file_id'] master_fileId=result['Remote file_id'] print slaveFilePath,master_fileId if(slaveFilePath is not None): #upload slave file slave_res=client.upload_slave_by_filename(slaveFilePath,master_fileId,'-html') if slave_res is not None: #success self.m_logger.info(" save slave %s into fdfs success"%slaveFilePath) ret['slaveFileId']=slave_res['Remote file_id'] return ret #return the storage info ``` 但是老是报下面的错: ![图片说明](https://img-ask.csdn.net/upload/201511/18/1447835320_129196.jpg) 从文件老是上传不成功,但是主文件却上传成功了,当我直接指定主文件id来上传从文件时,从文件却可以上传成功,有人知道怎么解决么?

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

String s = new String(" a ") 到底产生几个对象?

老生常谈的一个梗,到2020了还在争论,你们一天天的,哎哎哎,我不是针对你一个,我是说在座的各位都是人才! 上图红色的这3个箭头,对于通过new产生一个字符串(”宜春”)时,会先去常量池中查找是否已经有了”宜春”对象,如果没有则在常量池中创建一个此字符串对象,然后堆中再创建一个常量池中此”宜春”对象的拷贝对象。 也就是说准确答案是产生了一个或两个对象,如果常量池中原来没有 ”宜春” ,就是两个。...

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

Linux面试题(2020最新版)

文章目录Linux 概述什么是LinuxUnix和Linux有什么区别?什么是 Linux 内核?Linux的基本组件是什么?Linux 的体系结构BASH和DOS之间的基本区别是什么?Linux 开机启动过程?Linux系统缺省的运行级别?Linux 使用的进程间通信方式?Linux 有哪些系统日志文件?Linux系统安装多个桌面环境有帮助吗?什么是交换空间?什么是root帐户什么是LILO?什...

Linux命令学习神器!命令看不懂直接给你解释!

大家都知道,Linux 系统有非常多的命令,而且每个命令又有非常多的用法,想要全部记住所有命令的所有用法,恐怕是一件不可能完成的任务。 一般情况下,我们学习一个命令时,要么直接百度去搜索它的用法,要么就直接用 man 命令去查看守冗长的帮助手册。这两个都可以实现我们的目标,但有没有更简便的方式呢? 答案是必须有的!今天给大家推荐一款有趣而实用学习神器 — kmdr,让你解锁 Linux 学习新姿势...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

史上最全的 python 基础知识汇总篇,没有比这再全面的了,建议收藏

网友们有福了,小编终于把基础篇的内容全部涉略了一遍,这是一篇关于基础知识的汇总的文章,请朋友们收下,不用客气,不过文章篇幅肯能会有点长,耐心阅读吧爬虫(七十)多进程multiproces...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

85后蒋凡:28岁实现财务自由、34岁成为阿里万亿电商帝国双掌门,他的人生底层逻辑是什么?...

蒋凡是何许人也? 2017年12月27日,在入职4年时间里,蒋凡开挂般坐上了淘宝总裁位置。 为此,时任阿里CEO张勇在任命书中力赞: 蒋凡加入阿里,始终保持创业者的冲劲,有敏锐的...

总结了 150 余个神奇网站,你不来瞅瞅吗?

原博客再更新,可能就没了,之后将持续更新本篇博客。

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

新一代神器STM32CubeMonitor介绍、下载、安装和使用教程

关注、星标公众号,不错过精彩内容作者:黄工公众号:strongerHuang最近ST官网悄悄新上线了一款比较强大的工具:STM32CubeMonitor V1.0.0。经过我研究和使用之...

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

大学一路走来,学习互联网全靠这几个网站,最终拿下了一把offer

大佬原来都是这样炼成的

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

什么时候跳槽,为什么离职,你想好了么?

都是出来打工的,多为自己着想

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

当HR压你价,说你只值7K,你该怎么回答?

当HR压你价,说你只值7K时,你可以流畅地回答,记住,是流畅,不能犹豫。 礼貌地说:“7K是吗?了解了。嗯~其实我对贵司的面试官印象很好。只不过,现在我的手头上已经有一份11K的offer。来面试,主要也是自己对贵司挺有兴趣的,所以过来看看……”(未完) 这段话主要是陪HR互诈的同时,从公司兴趣,公司职员印象上,都给予对方正面的肯定,既能提升HR的好感度,又能让谈判气氛融洽,为后面的发挥留足空间。...

面试阿里p7,被按在地上摩擦,鬼知道我经历了什么?

面试阿里p7被问到的问题(当时我只知道第一个):@Conditional是做什么的?@Conditional多个条件是什么逻辑关系?条件判断在什么时候执...

你期望月薪4万,出门右拐,不送,这几个点,你也就是个初级的水平

先来看几个问题通过注解的方式注入依赖对象,介绍一下你知道的几种方式@Autowired和@Resource有何区别说一下@Autowired查找候选者的...

面试了一个 31 岁程序员,让我有所触动,30岁以上的程序员该何去何从?

最近面试了一个31岁8年经验的程序猿,让我有点感慨,大龄程序猿该何去何从。

大三实习生,字节跳动面经分享,已拿Offer

说实话,自己的算法,我一个不会,太难了吧

程序员垃圾简历长什么样?

已经连续五年参加大厂校招、社招的技术面试工作,简历看的不下于万份 这篇文章会用实例告诉你,什么是差的程序员简历! 疫情快要结束了,各个公司也都开始春招了,作为即将红遍大江南北的新晋UP主,那当然要为小伙伴们做点事(手动狗头)。 就在公众号里公开征简历,义务帮大家看,并一一点评。《启舰:春招在即,义务帮大家看看简历吧》 一石激起千层浪,三天收到两百多封简历。 花光了两个星期的所有空闲时...

立即提问
相关内容推荐