Example #1
0
            public void FromFile(PythonFile f, int n)
            {
                int bytesNeeded = n * ItemSize;
                string bytes = f.Read(bytesNeeded);
                if (bytes.Length < bytesNeeded) throw Ops.EofError("file not large enough");

                FromString(bytes);
            }
Example #2
0
 private static PythonModule LoadPythonSource(ICallerContext context, string name, PythonFile file, string filename)
 {
     CompilerContext cc = context.CreateCompilerContext().CopyWithNewSourceFile(filename);
     Parser parser = Parser.FromString(context.SystemState, cc, file.Read());
     return GenerateAndInitializeModule(context, cc, parser, name, filename);
 }