python subprocess.call()执行其他目录下.py文件的疑问 1C

python 新手,下载别人的代码自己跑,有一段执行其他目录下的python文件的代码,会报错。

 cmd = './b/b.py'
subprocess.call(cmd, shell=True) 

报错为
'.' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

请问这是怎么解决?
运行环境为win10,python3.6

1个回答

cmd改成python ./b/b.py 用python来执行py脚本

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
在windows下,如何利用subprocess.py执行命令将文件内容作为输入重定向到class文件

我开始的思路是: ``` subprocess.call("javac Test.java") subprocess.call("type test.txt > java Test") ``` 但是并没有成功。 我的问题可能为如下两项: - 如何完成利用subprocess.py执行命令将文件内容作为输入重定向到class文件 - 如何在DOS下执行Linux shell命令

subprocess.Popen('cd', shell=True, stdout=subprocess.PIPE)执行语句报错 ?

import subprocess obj = subprocess.Popen('cd', shell=True, stdout=subprocess.PIPE) 执行语句报错 报错内容: Traceback (most recent call last): File "<pyshell#1>", line 1, in <module> obj = subprocess.Popen('cd', shell=True, stdout=subprocess.PIPE) File "C:\Users\me\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 775, in __init__ restore_signals, start_new_session) File "C:\Users\me\AppData\Local\Programs\Python\Python37\lib\subprocess.py", line 1178, in _execute_child startupinfo) FileNotFoundError: [WinError 2] 系统找不到指定的文件。 ![图片说明](https://img-ask.csdn.net/upload/201908/02/1564719297_349957.png) 求大神解惑

在Python 2.7中运行PHP脚本

<div class="post-text" itemprop="text"> <p>I am wondering how to execute a php code if a python statement is true.As an example I need to do something like this.I am using Python 2.7 because im sending an email using 2.7 libraries.This doesnt work,i've been writing on python for 2 days and i dont know much about it .It also gives me an error:</p> <pre><code>import subprocess import os a=input(" ") if(a&gt;0): subprocess.call(["php", "write.php"]) Traceback (most recent call last): File "D:\PROGRAMS\xamkpp\htdocs\proba.py", line 5, in &lt;module&gt; subprocess.call(["php", "write.php"]) File "C:\Python27\lib\subprocess.py", line 522, in call return Popen(*popenargs, **kwargs).wait() File "C:\Python27\lib\subprocess.py", line 710, in __init__ errread, errwrite) File "C:\Python27\lib\subprocess.py", line 958, in _execute_child startupinfo) WindowsError: [Error 2] The system cannot find the file specified </code></pre> </div>

有关python中subprocess库的一个小问题

今天写了一个脚本,主要目的是想爆破一个需要输入密码的elf文件,但是脚本写好了之后不知道为什么总是报错,错误信息如下 ``` Traceback (most recent call last): File "test.py", line 7, in <module> subprocess.Popen.communicate(input=(i)) TypeError: communicate() missing 1 required positional argument: 'self' /bin/sh: 1: ./root/test/test.elf: not found ``` 以下是我写的脚本 ``` # coding:utf8 import subprocess i=0 for i in range(0,10251):#设定用于爆破的值的范围 subprocess.Popen("./root/test/test.elf", shell=True, stdout=subprocess.PIPE) subprocess.Popen.communicate(input=(i)) p=subprocess.Popen("./root/桌面/test ", shell=True, stdout=subprocess.PIPE) if p=="wrong!": continue print(p) get_str() ``` 求大佬指点

python在拼接字符串时,通过参数连接时就执行报错,写死执行的文件就不报错,为什么会这样?

for item in testfiles: #subprocess.call("python ..\\TestCases\\" + str(item).replace("\\n", ""), shell=True) print "修改前:" + os.getcwd() os.chdir('/Users/yirong/PycharmProjects/CloudResWebTest/TestCases') print "修改后:" + os.getcwd() #这样子报错,我将command打印出来也是python TC_Search_Python.py command="python "+str(item) #这样子执行正常 #command="python TC_Search_Python.py" print command subprocess.call(command,shell=True)

无法在AWS EC2上运行子进程

<div class="post-text" itemprop="text"> <p>We have an ec2 instance running with django rest framework. Now, there I want to be able to run a crontab that initiates a python script that calls a php script. </p> <p><strong>test.py</strong></p> <pre><code>class Command(BaseCommand): def handle(self, *args, **options): p = subprocess.Popen(['php', "/opt/python/current/app/my-app/my_test_file.php", name, caption], stdout=subprocess.PIPE) result = p.communicate()[0] </code></pre> <p>Now on my local machine I get no errors whatsoever. It works fine. And as you can see I use an absolute path there.</p> <p>When uploading to ec2 and running I get this error:</p> <blockquote> <pre><code>&gt; File "/usr/lib64/python2.7/subprocess.py", line 522, in call &gt; return Popen(*popenargs, **kwargs).wait() &gt; File "/usr/lib64/python2.7/subprocess.py", line 710, in __init__ &gt; errread, errwrite) &gt; File "/usr/lib64/python2.7/subprocess.py", line 1335, in _execute_child &gt; raise child_exception &gt; OSError: [Errno 2] No such file or directory </code></pre> </blockquote> <p>What does this have to do with? Is it because of a php file that it can't find? Because I also used this method as well:</p> <pre><code>directory = os.getcwd() p = subprocess.Popen(['php', directory + "/my_test_file.php", name, caption], stdout=subprocess.PIPE) </code></pre> <p>And that worked locally but again on ec2 gave that same error!</p> <p>Please help! Thank You in advance! </p> </div>

python中的KeyboardInterrupt

``` import subprocess cmd = subprocess.Popen('tracert -d 192.168.1.125', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True) for info in iter(cmd.stdout.readline, 'b'): if info == b'': pass else: print(str(info, encoding='gbk')) ``` python代码如上,保存在test.py中,在Linux中执行python test.py 一直没有反应,直接ctrl后提示错误: ``` ^CTraceback (most recent call last): File "test.py", line 4, in <module> for info in iter(cmd.stdout.readline, 'b'): KeyboardInterrupt ``` 请问是什么原因,如何chu'li

把Python爬虫部署到scrapyinghub上遇到如下问题?

把Python爬虫部署到scrapyinghub上遇到: Traceback (most recent call last): File "e:\paython\python安装\lib\site-packages\shub\utils.py", line 219, in run_cmd return _clean(subprocess.check_output(*args, **kwargs)) File "e:\paython\python安装\lib\subprocess.py", line 376, in check_output **kwargs).stdout File "e:\paython\python安装\lib\subprocess.py", line 468, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '['e:\\paython\\python安装\\python.exe', 'setup.py', 'clean', '-a', 'bdist_egg', '-d', 'C:\\Users\\Lenovo\\AppData\\Local\\Temp\\shub-deploy-81byvzun']' returned non-zero exit status 1. During handling of the above exception, another exception occurred: Traceback (most recent call last): File "e:\paython\python安装\lib\runpy.py", line 193, in _run_module_as_main "__main__", mod_spec) File "e:\paython\python安装\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "E:\paython\python安装\Scripts\shub.exe\__main__.py", line 9, in <module> File "e:\paython\python安装\lib\site-packages\click\core.py", line 722, in __call__ return self.main(*args, **kwargs) File "e:\paython\python安装\lib\site-packages\click\core.py", line 697, in main rv = self.invoke(ctx) File "e:\paython\python安装\lib\site-packages\click\core.py", line 1066, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "e:\paython\python安装\lib\site-packages\click\core.py", line 895, in invoke return ctx.invoke(self.callback, **ctx.params) File "e:\paython\python安装\lib\site-packages\click\core.py", line 535, in invoke return callback(*args, **kwargs) File "e:\paython\python安装\lib\site-packages\shub\deploy.py", line 82, in cli conf=conf) File "e:\paython\python安装\lib\site-packages\shub\deploy.py", line 110, in deploy_cmd egg, tmpdir = _build_egg() File "e:\paython\python安装\lib\site-packages\shub\deploy.py", line 195, in _build_egg run_python(['setup.py', 'clean', '-a', 'bdist_egg', '-d', d]) File "e:\paython\python安装\lib\site-packages\shub\utils.py", line 305, in run_python return run_cmd([sys.executable] + cmd, *args, **kwargs) File "e:\paython\python安装\lib\site-packages\shub\utils.py", line 224, in run_cmd e.stderr = _clean(tmpfile.read()) File "e:\paython\python安装\lib\site-packages\shub\utils.py", line 214, in _clean return s.decode(STDOUT_ENCODING).replace(os.linesep, '\n').strip('\n') UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb0 in position 273: invalid start byte 谢谢!!

OSError: [Errno 2] No such file or directory怎么解决?

在安装PyMesh时出现问题 ![图片说明](https://img-ask.csdn.net/upload/202002/26/1582721669_581774.png) 就是build.py all这步出现问题。 下面是出错信息 ``` (base) [rzw@VM_0_7_centos third_party]$ ./build.py all Traceback (most recent call last): File "./build.py", line 78, in <module> main(); File "./build.py", line 75, in main build(args.package, args.cleanup); File "./build.py", line 59, in build build(libname, cleanup); File "./build.py", line 63, in build cleanup=cleanup); File "./build.py", line 43, in build_generic subprocess.check_call(cmd.split(), cwd=build_dir); File "/home/rzw/anaconda2/lib/python2.7/subprocess.py", line 185, in check_call retcode = call(*popenargs, **kwargs) File "/home/rzw/anaconda2/lib/python2.7/subprocess.py", line 172, in call return Popen(*popenargs, **kwargs).wait() File "/home/rzw/anaconda2/lib/python2.7/subprocess.py", line 394, in __init__ errread, errwrite) File "/home/rzw/anaconda2/lib/python2.7/subprocess.py", line 1047, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory ``` 求助如何解决

python3.7使用pip安装dlib失败,已使用pip安装cmake和boost

Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting dlib Using cached https://pypi.tuna.tsinghua.edu.cn/packages/63/92/05c3b98636661cb80d190a5a777dd94effcc14c0f6893222e5ca81e74fbc/dlib-19.19.0.tar.gz (3.2 MB) Building wheels for collected packages: dlib Building wheel for dlib (setup.py) ... error ERROR: Command errored out with exit status 1: 以下是错误原因 command: 'd:\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Ray\\AppData\\Local\\Temp\\pip-install-adkry0ue\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Ray\\AppData\\Local\\Temp\\pip-install-adkry0ue\\dlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Ray\AppData\Local\Temp\pip-wheel-s_easgnt' cwd: C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\ Complete output (149 lines): running bdist_wheel running build running build_py package init file 'dlib\__init__.py' not found (or not a regular file) running build_ext Building extension for Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 00:42:30) [MSC v.1916 64 bit (AMD64)] Invoking CMake setup: 'cmake C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=d:\python\python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\build\lib.win-amd64-3.7 -A x64' -- Building for: Visual Studio 15 2017 -- The C compiler identification is MSVC 19.16.27034.0 -- The CXX compiler identification is MSVC 19.16.27034.0 -- Check for working C compiler: D:/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- Check for working C compiler: D:/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: D:/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- Check for working CXX compiler: D:/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PythonInterp: D:/Python/Python37/python.exe (found version "3.7.6") -- Found PythonLibs: D:/Python/Python37/libs/Python37.lib -- pybind11 v2.2.2 -- Using CMake version: 3.16.3 -- Compiling dlib version: 19.19.0 -- SSE4 instructions can be executed by the host processor. -- AVX instructions can be executed by the host processor. -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of void* -- Check size of void* - done -- Enabling AVX instructions -- Searching for BLAS and LAPACK -- Searching for BLAS and LAPACK -- Looking for pthread.h -- Looking for pthread.h - not found -- Found Threads: TRUE CUDA_TOOLKIT_ROOT_DIR not found or specified -- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "7.5") -- DID NOT FIND CUDA -- Disabling CUDA support for dlib. DLIB WILL NOT USE CUDA -- C++11 activated. -- Configuring done -- Generating done -- Build files have been written to: C:/Users/Ray/AppData/Local/Temp/pip-install-adkry0ue/dlib/build/temp.win-amd64-3.7/Release Invoking CMake build: 'cmake --build . --config Release -- /m' 用于 .NET Framework 的 Microsoft (R) 生成引擎版本 15.9.21+g9802d43bc3 版权所有(C) Microsoft Corporation。保留所有权利。 D:\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5): warning MSB8029: 中间目录或输出目录无法驻留在临时目录 下,因为这可能会导致增量生成出现问题。 [C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\build\temp.win-amd64-3.7\Release\ZERO_CHECK.vcxproj] Checking Build System D:\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5): warning MSB8029: 中间目录或输出目录无法驻留在临时目录 下,因为这可能会导致增量生成出现问题。 [C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\build\temp.win-amd64-3.7\Release\dlib_build\dlib.vcxproj] Building Custom Rule C:/Users/Ray/AppData/Local/Temp/pip-install-adkry0ue/dlib/dlib/CMakeLists.txt base64_kernel_1.cpp bigint_kernel_1.cpp bigint_kernel_2.cpp bit_stream_kernel_1.cpp entropy_decoder_kernel_1.cpp entropy_decoder_kernel_2.cpp entropy_encoder_kernel_1.cpp entropy_encoder_kernel_2.cpp md5_kernel_1.cpp tokenizer_kernel_1.cpp unicode.cpp image_dataset_metadata.cpp mnist.cpp global_function_search.cpp kalman_filter.cpp test_for_odr_violations.cpp auto.cpp sockets_kernel_1.cpp c:\users\ray\appdata\local\temp\pip-install-adkry0ue\dlib\dlib\sockets\../dlib_basic_cpp_build_tutorial.txt(1): fatal error C1189: #error: "Don't write #include <dlib/all/source.cpp> in your code." (编译源文件 C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\dlib\sockets\sockets_kernel_1.cpp) [C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\build\temp.win-amd64-3.7\Release\dlib_build\dlib.vcxproj] bsp.cpp dir_nav_kernel_1.cpp dir_nav_kernel_2.cpp dir_nav_extensions.cpp linker_kernel_1.cpp extra_logger_headers.cpp logger_kernel_1.cpp logger_config_file.cpp misc_api_kernel_1.cpp misc_api_kernel_2.cpp sockets_extensions.cpp sockets_kernel_2.cpp sockstreambuf.cpp sockstreambuf_unbuffered.cpp server_kernel.cpp server_iostream.cpp server_http.cpp multithreaded_object_extension.cpp threaded_object_extension.cpp threads_kernel_1.cpp threads_kernel_2.cpp threads_kernel_shared.cpp thread_pool_extension.cpp async.cpp timer.cpp stack_trace.cpp cpu_dlib.cpp tensor_tools.cpp fonts.cpp widgets.cpp drawable.cpp canvas_drawing.cpp style.cpp base_widgets.cpp gui_core_kernel_1.cpp gui_core_kernel_2.cpp png_loader.cpp save_png.cpp jpeg_loader.cpp save_jpeg.cpp Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\setup.py", line 261, in <module> 'Topic :: Software Development', File "d:\python\python37\lib\site-packages\setuptools\__init__.py", line 145, in setup return distutils.core.setup(**attrs) File "d:\python\python37\lib\distutils\core.py", line 148, in setup dist.run_commands() File "d:\python\python37\lib\distutils\dist.py", line 966, in run_commands self.run_command(cmd) File "d:\python\python37\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "d:\python\python37\lib\site-packages\wheel\bdist_wheel.py", line 223, in run self.run_command('build') File "d:\python\python37\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "d:\python\python37\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "d:\python\python37\lib\distutils\command\build.py", line 135, in run self.run_command(cmd_name) File "d:\python\python37\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "d:\python\python37\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\setup.py", line 135, in run self.build_extension(ext) File "C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\setup.py", line 175, in build_extension subprocess.check_call(cmake_build, cwd=build_folder) File "d:\python\python37\lib\subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1. ---------------------------------------- ERROR: Failed building wheel for dlib Running setup.py clean for dlib Failed to build dlib Installing collected packages: dlib Running setup.py install for dlib ... error ERROR: Command errored out with exit status 1: command: 'd:\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Ray\\AppData\\Local\\Temp\\pip-install-adkry0ue\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Ray\\AppData\\Local\\Temp\\pip-install-adkry0ue\\dlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Ray\AppData\Local\Temp\pip-record-70rug5ub\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\python\python37\Include\dlib' cwd: C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\ Complete output (151 lines): running install running build running build_py package init file 'dlib\__init__.py' not found (or not a regular file) running build_ext Building extension for Python 3.7.6 (tags/v3.7.6:43364a7ae0, Dec 19 2019, 00:42:30) [MSC v.1916 64 bit (AMD64)] Invoking CMake setup: 'cmake C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\tools\python -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\build\lib.win-amd64-3.7 -DPYTHON_EXECUTABLE=d:\python\python37\python.exe -DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\build\lib.win-amd64-3.7 -A x64' -- Building for: Visual Studio 15 2017 -- The C compiler identification is MSVC 19.16.27034.0 -- The CXX compiler identification is MSVC 19.16.27034.0 -- Check for working C compiler: D:/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- Check for working C compiler: D:/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: D:/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- Check for working CXX compiler: D:/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.16.27023/bin/Hostx86/x64/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Found PythonInterp: D:/Python/Python37/python.exe (found version "3.7.6") -- Found PythonLibs: D:/Python/Python37/libs/Python37.lib -- pybind11 v2.2.2 -- Using CMake version: 3.16.3 -- Compiling dlib version: 19.19.0 -- SSE4 instructions can be executed by the host processor. -- AVX instructions can be executed by the host processor. -- Looking for sys/types.h -- Looking for sys/types.h - found -- Looking for stdint.h -- Looking for stdint.h - found -- Looking for stddef.h -- Looking for stddef.h - found -- Check size of void* -- Check size of void* - done -- Enabling AVX instructions -- Searching for BLAS and LAPACK -- Searching for BLAS and LAPACK -- Looking for pthread.h -- Looking for pthread.h - not found -- Found Threads: TRUE CUDA_TOOLKIT_ROOT_DIR not found or specified -- Could NOT find CUDA (missing: CUDA_TOOLKIT_ROOT_DIR CUDA_NVCC_EXECUTABLE CUDA_INCLUDE_DIRS CUDA_CUDART_LIBRARY) (Required is at least version "7.5") -- DID NOT FIND CUDA -- Disabling CUDA support for dlib. DLIB WILL NOT USE CUDA -- C++11 activated. -- Configuring done -- Generating done -- Build files have been written to: C:/Users/Ray/AppData/Local/Temp/pip-install-adkry0ue/dlib/build/temp.win-amd64-3.7/Release Invoking CMake build: 'cmake --build . --config Release -- /m' 用于 .NET Framework 的 Microsoft (R) 生成引擎版本 15.9.21+g9802d43bc3 版权所有(C) Microsoft Corporation。保留所有权利。 D:\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5): warning MSB8029: 中间目录或输出目录无法驻留在临时目 录下,因为这可能会导致增量生成出现问题。 [C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\build\temp.win-amd64-3.7\Release\ZERO_CHECK.vcxproj] Checking Build System D:\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(399,5): warning MSB8029: 中间目录或输出目录无法驻留在临时目 录下,因为这可能会导致增量生成出现问题。 [C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\build\temp.win-amd64-3.7\Release\dlib_build\dlib.vcxproj] Building Custom Rule C:/Users/Ray/AppData/Local/Temp/pip-install-adkry0ue/dlib/dlib/CMakeLists.txt base64_kernel_1.cpp bigint_kernel_1.cpp bigint_kernel_2.cpp bit_stream_kernel_1.cpp entropy_decoder_kernel_1.cpp entropy_decoder_kernel_2.cpp entropy_encoder_kernel_1.cpp entropy_encoder_kernel_2.cpp md5_kernel_1.cpp tokenizer_kernel_1.cpp unicode.cpp image_dataset_metadata.cpp mnist.cpp global_function_search.cpp kalman_filter.cpp test_for_odr_violations.cpp auto.cpp sockets_kernel_1.cpp c:\users\ray\appdata\local\temp\pip-install-adkry0ue\dlib\dlib\sockets\../dlib_basic_cpp_build_tutorial.txt(1): fatal error C1189: #error: "Don't write #include <dlib/all/source.cpp> in your code." (编译源文件 C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\dlib\sockets\sockets_kernel_1.cpp) [C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\build\temp.win-amd64-3.7\Release\dlib_build\dlib.vcxproj] bsp.cpp dir_nav_kernel_1.cpp dir_nav_kernel_2.cpp dir_nav_extensions.cpp linker_kernel_1.cpp extra_logger_headers.cpp logger_kernel_1.cpp logger_config_file.cpp misc_api_kernel_1.cpp misc_api_kernel_2.cpp sockets_extensions.cpp sockets_kernel_2.cpp sockstreambuf.cpp sockstreambuf_unbuffered.cpp server_kernel.cpp server_iostream.cpp server_http.cpp multithreaded_object_extension.cpp threaded_object_extension.cpp threads_kernel_1.cpp threads_kernel_2.cpp threads_kernel_shared.cpp thread_pool_extension.cpp async.cpp timer.cpp stack_trace.cpp cpu_dlib.cpp tensor_tools.cpp fonts.cpp widgets.cpp drawable.cpp canvas_drawing.cpp style.cpp base_widgets.cpp gui_core_kernel_1.cpp gui_core_kernel_2.cpp png_loader.cpp save_png.cpp jpeg_loader.cpp save_jpeg.cpp Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\setup.py", line 261, in <module> 'Topic :: Software Development', File "d:\python\python37\lib\site-packages\setuptools\__init__.py", line 145, in setup return distutils.core.setup(**attrs) File "d:\python\python37\lib\distutils\core.py", line 148, in setup dist.run_commands() File "d:\python\python37\lib\distutils\dist.py", line 966, in run_commands self.run_command(cmd) File "d:\python\python37\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "d:\python\python37\lib\site-packages\setuptools\command\install.py", line 61, in run return orig.install.run(self) File "d:\python\python37\lib\distutils\command\install.py", line 545, in run self.run_command('build') File "d:\python\python37\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "d:\python\python37\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "d:\python\python37\lib\distutils\command\build.py", line 135, in run self.run_command(cmd_name) File "d:\python\python37\lib\distutils\cmd.py", line 313, in run_command self.distribution.run_command(command) File "d:\python\python37\lib\distutils\dist.py", line 985, in run_command cmd_obj.run() File "C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\setup.py", line 135, in run self.build_extension(ext) File "C:\Users\Ray\AppData\Local\Temp\pip-install-adkry0ue\dlib\setup.py", line 175, in build_extension subprocess.check_call(cmake_build, cwd=build_folder) File "d:\python\python37\lib\subprocess.py", line 363, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--config', 'Release', '--', '/m']' returned non-zero exit status 1. ---------------------------------------- ERROR: Command errored out with exit status 1: 'd:\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Ray\\AppData\\Local\\Temp\\pip-install-adkry0ue\\dlib\\setup.py'"'"'; __file__='"'"'C:\\Users\\Ray\\AppData\\Local\\Temp\\pip-install-adkry0ue\\dlib\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Ray\AppData\Local\Temp\pip-record-70rug5ub\install-record.txt' --single-version-externally-managed --compile --install-headers 'd:\python\python37\Include\dlib' Check the logs for full command output.

Ubuntu16.04系统plot出现permission denied

``` import numpy as np from keras.models import Sequential from keras.layers.core import Dense, Activation from keras.optimizers import SGD from keras.utils import np_utils from keras.utils.visualize_util import plot def run(): model = Sequential() model.add(Dense(4, input_dim=2, init='uniform')) model.add(Activation('relu')) model.add(Dense(2, init='uniform')) model.add(Activation('sigmoid')) sgd = SGD(lr=0.05, decay=1e-6, momentum=0.9, nesterov=True) model.compile(loss='binary_crossentropy', optimizer=sgd, metrics=['accuracy']) plot(model, to_file='model.png') if __name__ == '__main__': run() ``` 错误提示: Traceback (most recent call last): File "example2.py", line 21, in _**<module>** run() File "example2.py", line 18, in run plot(model, to_file='model.png') File "/home/c249/anaconda2/lib/python2.7/site-packages/keras/utils/visualize_util.py", line 64, in plot dot.write_png(to_file) File "/home/c249/anaconda2/lib/python2.7/site-packages/pydot.py", line 1811, in <lambda> lambda path, f=frmt, prog=self.prog : self.write(path, format=f, prog=prog)) File "/home/c249/anaconda2/lib/python2.7/site-packages/pydot.py", line 1913, in write dot_fd.write(self.create(prog, format)) File "/home/c249/anaconda2/lib/python2.7/site-packages/pydot.py", line 1992, in create stderr=subprocess.PIPE, stdout=subprocess.PIPE) File "/home/c249/anaconda2/lib/python2.7/subprocess.py", line 390, in __init__ errread, errwrite) File "/home/c249/anaconda2/lib/python2.7/subprocess.py", line 1024, in _execute_child raise child_exception OSError: [Errno 13] Permission denied

为什么gdal_calc.py只能在终端中工作,但是使用PHP exec或Python脚本什么都没发生?

<div class="post-text" itemprop="text"> <p>I have a simple command using gdal_calc that only works directly in the mac terminal. But, when I run in PHP using exec or in python, nothing happened.</p> <p>I have a simple code like this :</p> <p><code>gdal_calc.py -A input1.tif -B input2.tif --outfile=result.tif --calc="A+B"</code></p> <p>In PHP:</p> <pre><code>exec('gdal_calc.py -A input1.tif -B input2.tif --outfile=result.tif --calc="A+B"', $output, $response); </code></pre> <p>this doesn't do anything so i run it direclty using python script</p> <pre><code>#!/usr/bin/env python import subprocess subprocess.call('gdal_calc.py -A input1.tif -B input2.tif --outfile=result.tif --calc="A+B"', shell=True); </code></pre> <p>no error and no result. When i use <code>gdal_grid</code> or <code>gdalwarp</code> it works well in both languages</p> </div>

如何用 Python 复制文件?

<div class="post-text" itemprop="text"> <p>How do I copy a file in Python?</p> <p>I couldn't find anything under <a href="https://docs.python.org/2/library/os.html" rel="noreferrer"><code>os</code></a>.</p> </div> <p>转载于:https://stackoverflow.com/questions/123198/how-do-i-copy-a-file-in-python</p>

新手--python3.5调用webdriver报错

脚本启动Fiefox报错 代码: # -*- coding:utf-8 -*- from selenium import webdriver browser = webdriver.Firefox() browser.get('http;//www.baidu.com') browser.find_element_by_id('kw').send_keys('selenium') browser.find_element_by_id('su').click() browser.quit() 报错信息: Traceback (most recent call last): File "C:\Users\hxx\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 74, in start stdout=self.log_file, stderr=self.log_file) File "C:\Users\hxx\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 676, in __init__ restore_signals, start_new_session) File "C:\Users\hxx\AppData\Local\Programs\Python\Python35\lib\subprocess.py", line 955, in _execute_child startupinfo) FileNotFoundError: [WinError 2] 系统找不到指定的文件。 During handling of the above exception, another exception occurred: Traceback (most recent call last): File "E:/workspace/baidu.py", line 3, in <module> browser = webdriver.Firefox() File "C:\Users\hxx\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\firefox\webdriver.py", line 145, in __init__ self.service.start() File "C:\Users\hxx\AppData\Local\Programs\Python\Python35\lib\site-packages\selenium\webdriver\common\service.py", line 81, in start os.path.basename(self.path), self.start_error_message) selenium.common.exceptions.WebDriverException: Message: 'geckodriver' executable needs to be in PATH.

来自Python“print(”“)”的SSH2流输出未显示在输出中

<div class="post-text" itemprop="text"> <p>I use SSH2 library for my web application and I am trying to get python "print()" results from the code. The problem is when, I connect to SSH2 and do stream_get_contents to get the output into a variable, it doesn't show the python print("") output. There is no output from the python. When I run the script via ssh I get the python print. I need to get the python output into a PHP variable. I've found when I do bash echo "test", it outputs on ssh2. That is what I need but from a python script. Could someone please help as I've been trying to fix this all night.</p> <p>Executing any bash script with echo works. But when using python output, it doesn't go into the same echo type or whatever.</p> <p>// PHP API Script, should return with the code from python script</p> <pre><code>$stream = ssh2_exec($connection, "python -u fetch.py 0000 test"); </code></pre> <p>// Stripped Python Script, I've tried all the possible outputs. It should output like bash "echo test"</p> <pre><code>#subprocess.call('echo 0',shell=True) if elems[0].is_displayed(): print("Game PIN not valid!") subprocess.call('echo invalid',shell=True) sys.stdout.write("invalid") sys.stdout.flush() else: print ("Game PIN is valid!") subprocess.call('echo valid',shell=True) sys.stdout.write("valid") sys.stdout.flush() </code></pre> <p>I get nothing for output because python or SSH2 isn't keeping the connection alive because the python script is separate from the stream. The SSH2 just executes the script but doesn't return any outputs. Using "echo" returns the result because that is the command to return. I need to get the python output into a PHP variable so I can execute it elsewhere.</p> </div>

python unittest执行程序在pycharm可以成功运行但使用cmd会报错

如题,在pycharm中执行主程序运行成功: 已连接主机 登录成功 正在发送...... 邮件发送完成~ Process finished with exit code 0 在cmd执行主程序报错: Traceback (most recent call last): File"all_test.py",line 32,in<module> alltestnames = creatsuite() File"all_test.py",line 27,in creatsuite testunit.addTests(test_case) File "C:\Python37\lib\unittest\suite.py",line57,in addTests for test in tests: TypeError:'_FailedTest'object is not iterable 报错的程序代码是这部分: def creatsuite(): testunit = unittest.TestSuite() test_dir = test_suite_dir package_tests = unittest.defaultTestLoader.discover(test_dir, pattern='*.py', top_level_dir=None) for test_suite in package_tests: for test_case in test_suite: testunit.addTests(test_case) print(testunit) return testunit 刚接触接口测试,请问是哪里出了问题呢?因为正在jenkins构建项目执行,把源码放在github后使用windows批处理命令执行,这样进程是停滞的,也结束不了。

python virtualenv 创建python虚拟环境时报错

windows10 + python2.7.9 在桌面创建虚拟环境的时候出现: ``` C:\Users\我们都是小怪兽\Desktop>virtualenv myenv New python executable in C:\Users\我们都是小怪兽\Desktop\myenv\Scripts\python.exe Traceback (most recent call last): File "<string>", line 1, in <module> UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 9: ordinal not in range(128) ERROR: The executable C:\Users\我们都是小怪兽\Desktop\myenv\Scripts\python.exe is not functioning ERROR: It thinks sys.prefix is u'c:\\users\\\u6211\u4eec\u90fd\u662f\u5c0f\u602a\u517d\\desktop' (should be u'c:\\users\\\u6211\u4eec\u90fd\u662f\u5c0f\u602a\u517d\\desktop\\myenv') ERROR: virtualenv is not compatible with this system or executable Note: some Windows users have reported this error when they installed Python for "Only this user" or have multiple versions of Python installed. Copying the appropriate PythonXX.dll to the virtualenv Scripts/ directory may fix this problem. ``` 除了桌面的其他目录出现这个: ``` PS C:\> cd D:\Coding\python PS D:\Coding\python> virtualenv env New python executable in D:\Coding\python\env\Scripts\python.exe Installing setuptools, pip, wheel... Complete output from command D:\Coding\python\env\Scripts\python.exe - setuptools pip wheel: Collecting setuptools Exception: Traceback (most recent call last): File "c:\python27\lib\site-packages\virtualenv_support\pip-8.0.2-py2.py3-none-any.whl\pip\basecommand.py", line 209, in main status = self.run(options, args) File "c:\python27\lib\site-packages\virtualenv_support\pip-8.0.2-py2.py3-none-any.whl\pip\commands\install.py", line 299, in run requirement_set.prepare_files(finder) File "c:\python27\lib\site-packages\virtualenv_support\pip-8.0.2-py2.py3-none-any.whl\pip\req\req_set.py", line 359, in prepare_files ignore_dependencies=self.ignore_dependencies)) File "c:\python27\lib\site-packages\virtualenv_support\pip-8.0.2-py2.py3-none-any.whl\pip\req\req_set.py", line 576, in _prepare_file session=self.session, hashes=hashes) File "c:\python27\lib\site-packages\virtualenv_support\pip-8.0.2-py2.py3-none-any.whl\pip\download.py", line 809, in unpack_url hashes=hashes File "c:\python27\lib\site-packages\virtualenv_support\pip-8.0.2-py2.py3-none-any.whl\pip\download.py", line 648, in unpack_http_url hashes) File "c:\python27\lib\site-packages\virtualenv_support\pip-8.0.2-py2.py3-none-any.whl\pip\download.py", line 868, in _download_http_url file_path = os.path.join(temp_dir, filename) File "D:\Coding\python\env\lib\ntpath.py", line 85, in join result_path = result_path + p_path UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 7: ordinal not in range(128) ---------------------------------------- ...Installing setuptools, pip, wheel...done. Traceback (most recent call last): File "c:\python27\lib\runpy.py", line 162, in _run_module_as_main "__main__", fname, loader, pkg_name) File "c:\python27\lib\runpy.py", line 72, in _run_code exec code in run_globals File "C:\Python27\Scripts\virtualenv.exe\__main__.py", line 9, in <module> File "c:\python27\lib\site-packages\virtualenv.py", line 711, in main symlink=options.symlink) File "c:\python27\lib\site-packages\virtualenv.py", line 944, in create_environment download=download, File "c:\python27\lib\site-packages\virtualenv.py", line 900, in install_wheel call_subprocess(cmd, show_stdout=False, extra_env=env, stdin=SCRIPT) File "c:\python27\lib\site-packages\virtualenv.py", line 795, in call_subprocess % (cmd_desc, proc.returncode)) OSError: Command D:\Coding\python\env\Scripts\python.exe - setuptools pip wheel failed with error code 2 ``` 想不通是什么问题,求解。 补充:如果加上 --no setuptools就可以了 ``` PS D:\Coding\python> virtualenv myenv --no-setuptools New python executable in D:\Coding\python\myenv\Scripts\python.exe Installing pip, wheel...done. ```

我无法从php调用重定向python文件的输出

<div class="post-text" itemprop="text"> <p>I'm trying to execute a python file from php, in python file I have this:</p> <pre><code>import sys from subprocess import PIPE, Popen nom = sys.argv[1]; print nom def cmdline(command): process = Popen( args=command, stdout=PIPE, shell=True ) return process.communicate()[0] cmdline("nmap x.x.x.x -oX sortida.xml") </code></pre> <p>When I execute <code>python pythonfile.py</code> works, creates the sortida.xml file, but when y call it from php don't create sortida.xml file, only shows me the print</p> <p>PHP:</p> <pre><code> system('python /var/www/core/un.py q'); </code></pre> <p>Thanks in advance</p> </div>

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

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

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

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

程序员请照顾好自己,周末病魔差点一套带走我。

程序员在一个周末的时间,得了重病,差点当场去世,还好及时挽救回来了。

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

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

和黑客斗争的 6 天!

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

点沙成金:英特尔芯片制造全过程揭密

“亚马逊丛林里的蝴蝶扇动几下翅膀就可能引起两周后美国德州的一次飓风……” 这句人人皆知的话最初用来描述非线性系统中微小参数的变化所引起的系统极大变化。 而在更长的时间尺度内,我们所生活的这个世界就是这样一个异常复杂的非线性系统…… 水泥、穹顶、透视——关于时间与技艺的蝴蝶效应 公元前3000年,古埃及人将尼罗河中挖出的泥浆与纳特龙盐湖中的矿物盐混合,再掺入煅烧石灰石制成的石灰,由此得来了人...

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

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

上班一个月,后悔当初着急入职的选择了

最近有个老铁,告诉我说,上班一个月,后悔当初着急入职现在公司了。他之前在美图做手机研发,今年美图那边今年也有一波组织优化调整,他是其中一个,在协商离职后,当时捉急找工作上班,因为有房贷供着,不能没有收入来源。所以匆忙选了一家公司,实际上是一个大型外包公司,主要派遣给其他手机厂商做外包项目。**当时承诺待遇还不错,所以就立马入职去上班了。但是后面入职后,发现薪酬待遇这块并不是HR所说那样,那个HR自...

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

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

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

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

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

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

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

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

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

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

我说我不会算法,阿里把我挂了。

不说了,字节跳动也反手把我挂了。

优雅的替换if-else语句

场景 日常开发,if-else语句写的不少吧??当逻辑分支非常多的时候,if-else套了一层又一层,虽然业务功能倒是实现了,但是看起来是真的很不优雅,尤其是对于我这种有强迫症的程序"猿",看到这么多if-else,脑袋瓜子就嗡嗡的,总想着解锁新姿势:干掉过多的if-else!!!本文将介绍三板斧手段: 优先判断条件,条件不满足的,逻辑及时中断返回; 采用策略模式+工厂模式; 结合注解,锦...

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

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

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

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

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

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

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

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

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

面试:第十六章:Java中级开发(16k)

HashMap底层实现原理,红黑树,B+树,B树的结构原理 Spring的AOP和IOC是什么?它们常见的使用场景有哪些?Spring事务,事务的属性,传播行为,数据库隔离级别 Spring和SpringMVC,MyBatis以及SpringBoot的注解分别有哪些?SpringMVC的工作原理,SpringBoot框架的优点,MyBatis框架的优点 SpringCould组件有哪些,他们...

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

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

你打算用Java 8一辈子都不打算升级到Java 14,真香

我们程序员应该抱着尝鲜、猎奇的心态,否则就容易固步自封,技术停滞不前。

无代码时代来临,程序员如何保住饭碗?

编程语言层出不穷,从最初的机器语言到如今2500种以上的高级语言,程序员们大呼“学到头秃”。程序员一边面临编程语言不断推陈出新,一边面临由于许多代码已存在,程序员编写新应用程序时存在重复“搬砖”的现象。 无代码/低代码编程应运而生。无代码/低代码是一种创建应用的方法,它可以让开发者使用最少的编码知识来快速开发应用程序。开发者通过图形界面中,可视化建模来组装和配置应用程序。这样一来,开发者直...

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

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

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

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

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

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

《经典算法案例》01-08:如何使用质数设计扫雷(Minesweeper)游戏

我们都玩过Windows操作系统中的经典游戏扫雷(Minesweeper),如果把质数当作一颗雷,那么,表格中红色的数字哪些是雷(质数)?您能找出多少个呢?文中用列表的方式罗列了10000以内的自然数、质数(素数),6的倍数等,方便大家观察质数的分布规律及特性,以便对算法求解有指导意义。另外,判断质数是初学算法,理解算法重要性的一个非常好的案例。

《Oracle Java SE编程自学与面试指南》最佳学习路线图(2020最新版)

正确选择比瞎努力更重要!

一文带你入门Java Stream流,太强了

两个星期以前,就有读者强烈要求我写一篇 Java Stream 流的文章,我说市面上不是已经有很多了吗,结果你猜他怎么说:“就想看你写的啊!”你看你看,多么苍白的喜欢啊。那就“勉为其难”写一篇吧,嘻嘻。 单从“Stream”这个单词上来看,它似乎和 java.io 包下的 InputStream 和 OutputStream 有些关系。实际上呢,没毛关系。Java 8 新增的 Stream 是为...

都前后端分离了,咱就别做页面跳转了!统统 JSON 交互

文章目录1. 无状态登录1.1 什么是有状态1.2 什么是无状态1.3 如何实现无状态1.4 各自优缺点2. 登录交互2.1 前后端分离的数据交互2.2 登录成功2.3 登录失败3. 未认证处理方案4. 注销登录 这是本系列的第四篇,有小伙伴找不到之前文章,松哥给大家列一个索引出来: 挖一个大坑,Spring Security 开搞! 松哥手把手带你入门 Spring Security,别再问密...

立即提问
相关内容推荐