This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def f(j): | |
raise Exception("test") | |
for j in range(1000): | |
try: | |
f(j) | |
except: | |
continue | |
print "finished" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StackTrace DropBox API: | |
CProgram Files (x86)IronPython 2.7ipy.exe CUsersEddiePycharmProjectsdropbox_connetcor_ipyauth.py | |
Traceback (most recent call last) | |
File CUsersEddiePycharmProjectsdropbox_connetcor_ipyauth.py, line 13, in module | |
File CUsersEddiePycharmProjectsdropbox_connetcor_ipydropbox_apisession.py, line 176, in obtain_request_token | |
File CUsersEddiePycharmProjectsdropbox_connetcor_ipydropbox_apirest.py, line 267, in POST | |
File CUsersEddiePycharmProjectsdropbox_connetcor_ipydropbox_apirest.py, line 213, in POST | |
File CUsersEddiePycharmProjectsdropbox_connetcor_ipydropbox_apirest.py, line 184, in request | |
dropbox_api.rest.RESTSocketError Error connecting to api.dropbox.com [Errno errors while validating certificate chain ] RemoteCertificateNameMismatch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
csharp = ''' | |
using System; | |
using System.Collections.Generic; | |
using System.ComponentModel; | |
using System.Dynamic; | |
using System.Linq; | |
namespace TrySetMember { | |
public class MyDynamicObject : DynamicObject, INotifyPropertyChanged { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I've found a problem that only seems to happen when importing from a pyc compiled assembly, but does not show when importing the script directly. Attached is as far as I have managed to reduce a simple test case to (I first came across this in SQLAlchemy). | |
Running directly (or, opening the repl and then importing manually): | |
$ ipy testipy.py | |
Works fine, but compiling with pyc (assuming you have an alias): | |
$ pyc /out:TestIPy testily.py | |
And then running the script: | |
import clr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Security; | |
using System.Security.Permissions; | |
using System.Security.Policy; | |
using IronPython.Compiler; | |
using IronPython.Hosting; | |
using IronPython.Runtime; | |
using Microsoft.Scripting.Hosting; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class OldStyle: | |
def __init__(self, arg): | |
print "OldStyle" | |
class NewStyleWithInit1(OldStyle,object): | |
def __init__(self,arg): | |
print "NewStyleWithInit1" | |
class NewStyleWithInit2(object,OldStyle): | |
def __init__(self,arg): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ftplib | |
import os | |
import sys | |
import traceback | |
import socket | |
socket.settimeout(20.0) | |
print "Logging in..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> from ctypes import * | |
>>> message = c_buffer(20) | |
>>> print message | |
<ctypes.c_char_Array_20 object at 0x01880120> | |
>>> byref(message) | |
<cparam 'P' (013AEAE8)> | |
>>> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using IronPython.Hosting; | |
using Microsoft.Scripting.Hosting; | |
class Program | |
{ | |
static void Main() | |
{ | |
ScriptEngine engine = Python.CreateEngine(); | |
ScriptScope scope = engine.CreateScope(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Check up on IronPython work items. | |
Use: | |
ipy -m unittest testipy [or other fully qualified test names] | |
ipy -m testipy [optional test names relative to this module] | |
""" | |
import copy | |
from datetime import date, time | |
import unittest |