Skip to content

Instantly share code, notes, and snippets.

View ironpythonbot's full-sized avatar

ironpythonbot

View GitHub Profile
@ironpythonbot
ironpythonbot / finddeps.py
Created December 9, 2014 17:59
CodePlex Issue #32420 Plain Text Attachments
"""
Find source library files for module dependencies of some set of source files.
Author: Dominique de Waleffe <ddewaleffe@gmail.com>
Copyright 2012 Dominique de Waleffe
For inclusion in IronPython
Licensed under the term of Apache license V2.0 as found in http://www.apache.org/licenses/LICENSE-2.0
"""
#TODO: As this explores all the source files, it does redundant work that the compiler should be able to do.
@ironpythonbot
ironpythonbot / Activity1.cs
Created December 9, 2014 17:59
CodePlex Issue #32393 Plain Text Attachments
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using IronPython;
using IronPython.Hosting;
using IronPython.Modules;
@ironpythonbot
ironpythonbot / CompileToStandalone.py
Created December 9, 2014 17:58
CodePlex Issue #32371 Plain Text Attachments
#!/usr/bin/env python
# CompileToStandalone, a Python to .NET ILR compiler which produces standalone binaries
# (C) 2012 Niall Douglas http://www.nedproductions.biz/
# Created: March 2012
import modulefinder, sys, os, subprocess, _winreg
if len(sys.argv)<2:
print("Usage: CompileEverythingToILR.py <source py> [-outdir=<dest dir>]")
sys.exit(0)
@ironpythonbot
ironpythonbot / out.txt
Created December 9, 2014 17:58
CodePlex Issue #32355 Plain Text Attachments
G:\BEurtle\BEXML>ipy
IronPython 2.7.2rc1 (2.7.0.40) on .NET 4.0.30319.261 (32-bit)
Type "help", "copyright", "credits" or "license" for more information.
>>> import uuid
Unhandled Exception: System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
at IronPython.Modules.NativeFunctions.LoadLibrary(String lpFileName)
at IronPython.Modules.NativeFunctions.LoadDLL(String filename, Int32 flags)
at IronPython.Modules.CTypes.LoadLibrary(String library, Int32 mode)
@ironpythonbot
ironpythonbot / ipy_tb_bug.py
Created December 9, 2014 17:58
CodePlex Issue #32332 Plain Text Attachments
import sys
print 'NameError:'
try:
try:
nonex
except NameError:
print sys.exc_traceback
raise
except:
@ironpythonbot
ironpythonbot / test.py
Created December 9, 2014 17:57
CodePlex Issue #32125 Plain Text Attachments
# Python imports
import traceback
import time
import threading
# .NET imports
from System.Threading.Tasks import Task
# Task method that simply accesses the current thread's name
def task_action():
@ironpythonbot
ironpythonbot / VirtualAccessors.cs
Created December 9, 2014 17:56
CodePlex Issue #31861 Plain Text Attachments
public class Base {
public virtual int Accessor {
get; set;
}
}
public class GetOverride: Base {
public override int Accessor {
get {
return base.Accessor - 1;
@ironpythonbot
ironpythonbot / LineNumbers.py
Created December 9, 2014 17:56
CodePlex Issue #31856 Plain Text Attachments
"""\
Multiline string formatted to left-align
text.
"""
raise Exception
@ironpythonbot
ironpythonbot / IronPythonHeapDump.txt
Created December 9, 2014 17:55
CodePlex Issue #31764 Plain Text Attachments
<root> : 171 MB (100,00%)
Handle <root>->Handle->(System.Object []): 152 MB (89,00%)
Handle, Pinning <root>->Handle, Pinning->(System.Object []): 8,8 MB (5,15%)
Stack <root>->Stack->(IronPython.Runtime.ModuleContext): 4,4 MB (2,55%)
Stack <root>->Stack->(Microsoft.Scripting.Debugging.DebuggableLambdaBuilder): 3,0 MB (1,77%)
System.Object [] Handle->System.Object []->(IronPython.Runtime.Exceptions.TracebackDelegate,System.Collections.Generic.Stack<T>): 148 MB (86,51%) (1 object, 52 bytes (0,00%))
System.Object [] Handle, Pinning->System.Object []->(Microsoft.Scripting.NullErrorSink,Microsoft.Scripting.PlatformAdaptationLayer,System.Security.PermissionSet,...): 8,5 MB (4,95%) (1 object, 16 kB (0,01%))
IronPython.Runtime.ModuleContext Stack->IronPython.Runtime.ModuleContext->(IronPython.Runtime.CodeContext,IronPython.Runtime.ExtensionMethodSet,IronPython.Runtime.PythonContext): 4,4 MB (2,55%) (1 object, 32 bytes (0,00%))
System.Object [] Handle->System.Obje
@ironpythonbot
ironpythonbot / test.py
Created December 9, 2014 17:55
CodePlex Issue #31547 Plain Text Attachments
import sys
def tf(frame, event, arg):
if event == 'exception':
print arg[2].tb_lineno
return tf
sys.settrace(tf)
def f():