从 Visual Studio 开始调试时,需要 2 分钟才能命中第一行 python 代码。显然 Visual Studio 正忙于加载 python 模块。
python.exe' (Win32):加载'C:\ProgramData\Anaconda3\python.exe'。符号加载。
“python.exe”(Win32):加载“xxxxx”。无法找到或打开 PDB 文件。... 还有很多 ...
我在下面尝试过,没有喜悦:
工具\选项\调试
a) 选中仅启用我的代码
b) 即时调试 - 仅选定的托管和脚本
c) 符号
https://devblogs.microsoft.com/devops/make-debugging-faster-with-visual-studio/
另外两个观察:
在今天之前我从来没有遇到过这个问题
Python 交互式调试器今天停止工作 - 它拒绝打印任何内容!
myDataFrame.head()
打印(“你好”)
如何从 SQL Server 中的连接字符串进行配置CommandTimeout(不是Connect Timeout)?
我以为很容易找到,但显然不是。下面我添加了CommandTimeout=60。它似乎没有破坏任何东西,但我不知道它是否真的有效(而且我找不到这方面的文档)
Data Source=someplace.com;Initial Catalog=MyDB;CommandTimeout=60;User Id=someID;Password=secret;
Run Code Online (Sandbox Code Playgroud) LINQ从右到左评估子句?这就是为什么看起来有太多文章最后使用Take操作解释“惰性评估”的原因?下面的示例代码段2比代码段1快得多,因为它没有执行“ ToList”
代码段1(约13000毫秒)
var lotsOfNums = Enumerable.Range(0, 10000000).ToList();
Stopwatch sw = new Stopwatch();
sw.Start();
// Get all the even numbers
var a = lotsOfNums.Where(num => num % 2 == 0).ToList();
// Multiply each even number by 100.
var b = a.Select(num => num * 100).ToList();
var c = b.Select(num => new Random(num).NextDouble()).ToList();
// Get the top 10
var d = c.Take(10);
// a, b, c and d have executed on each step.
foreach (var num in d)
{
Console.WriteLine(num); …Run Code Online (Sandbox Code Playgroud)