GithubHelp home page GithubHelp logo

ironlanguages / ironpython3 Goto Github PK

View Code? Open in Web Editor NEW
2.4K 144.0 283.0 62.29 MB

Implementation of Python 3.x for .NET Framework that is built on top of the Dynamic Language Runtime.

License: Apache License 2.0

C# 22.81% Makefile 0.01% Python 53.19% PowerShell 0.15% Shell 0.01% CSS 0.01% Batchfile 0.01% PLSQL 0.04% HTML 23.72% Roff 0.04% C 0.03% VBScript 0.01%
ironpython dlr c-sharp python

ironpython3's People

Contributors

aisk avatar alanmbarr avatar alexkubiesa avatar arontsang avatar bcsharp avatar dc366 avatar frawst avatar gfmcknight avatar gpetrou avatar hackf5 avatar in-code-i-trust avatar isaiah avatar ivanbakel avatar jameslan avatar jdhardy avatar komodo472 avatar kuinox avatar lemon73-computing avatar lostbenjamin avatar michaelblyons avatar moto-timo avatar paweljasinski avatar rtzoeller avatar scott-xu avatar shahnerodgers avatar simplicbe avatar slide avatar slozier avatar syn2083 avatar timgates42 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ironpython3's Issues

errors from IronPythonTestConsole should include python exception details

If a test case has a simple syntax error, there is no python stacktrace to track it down.

$ ./IronPythonTestConsole.exe  IronPythonTest -noh -labels -full -test:IronPythonTest.Cases.IronPythonCases.test_bool
Runtime Environment -
    OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
  .NET Version: 4.0.30319.18444

***** IronPythonTest.DLL
***** IronPythonCases
***** IronPythonTests
***** test_bool
Tests run: 1, Passed: 0, Errors: 1, Failures: 0, Inconclusive: 0
  Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0
Elapsed time: 00:00:00.5840000

Errors and Failures:

1) test_bool (IronPythonTest.Cases.IronPythonCases.test_bool)
   Microsoft.Scripting.SyntaxErrorException : invalid syntax
   at Microsoft.Scripting.ErrorSink.Add(SourceUnit source, String message, SourceSpan span, Int32 errorCode, Severity severity)
   at IronPython.Compiler.Parser.ReportSyntaxError(Int32 start, Int32 end, String message, Int32 errorCode) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 375
   at IronPython.Compiler.Parser.ReportSyntaxError(Int32 start, Int32 end, String message) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 367
   at IronPython.Compiler.Parser.ReportSyntaxError(String message) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 363
   at IronPython.Compiler.Parser.AddTrailers(Expression ret, Boolean allowGeneratorExpression) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 2296
   at IronPython.Compiler.Parser.AddTrailers(Expression ret) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 2255
   at IronPython.Compiler.Parser.ParsePower() in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 2141
   at IronPython.Compiler.Parser.ParseFactor() in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 2107
   at IronPython.Compiler.Parser.ParseExpr(Int32 precedence) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 2070
   at IronPython.Compiler.Parser.ParseExpr() in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 2066
   at IronPython.Compiler.Parser.ParseComparison() in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 2024
   at IronPython.Compiler.Parser.ParseNotTest() in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 2018
   at IronPython.Compiler.Parser.ParseAndTest() in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 2001
   at IronPython.Compiler.Parser.ParseOrTest() in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 1983
   at IronPython.Compiler.Parser.ParseExpression() in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 1971
   at IronPython.Compiler.Parser.ParseTestListAsExpr() in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 2635
   at IronPython.Compiler.Parser.ParseExprStmt() in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 708
   at IronPython.Compiler.Parser.ParseSmallStmt() in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 531
   at IronPython.Compiler.Parser.ParseSimpleStmt() in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 453
   at IronPython.Compiler.Parser.ParseStmt() in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 447
   at IronPython.Compiler.Parser.ParseFileWorker(Boolean makeModule, Boolean returnValue) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 3315
   at IronPython.Compiler.Parser.ParseFile(Boolean makeModule, Boolean returnValue) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Compiler\Parser.cs:line 144
   at IronPython.Runtime.PythonContext.ParseAndBindAst(CompilerContext context) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Runtime\PythonContext.cs:line 908
   at IronPython.Runtime.PythonContext.CompilePythonCode(SourceUnit sourceUnit, CompilerOptions options, ErrorSink errorSink) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Runtime\PythonContext.cs:line 947
   at IronPython.Runtime.PythonContext.CompileSourceCode(SourceUnit sourceUnit, CompilerOptions options, ErrorSink errorSink) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPython\Runtime\PythonContext.cs:line 956
   at Microsoft.Scripting.SourceUnit.Execute(Scope scope, ErrorSink errorSink)
   at IronPythonTest.Cases.CaseExecuter.GetResult(ScriptEngine engine, ScriptSource source) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPythonTest\Cases\CaseExecuter.cs:line 75
   at IronPythonTest.Cases.CaseExecuter.GetScopeTest(TestInfo testcase) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPythonTest\Cases\CaseExecuter.cs:line 70
   at IronPythonTest.Cases.CaseExecuter.RunTest(TestInfo testcase) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPythonTest\Cases\CaseExecuter.cs:line 48
   at IronPythonTest.Cases.IronPythonCases.IronPythonTests(TestInfo testcase) in c:\cygwin64\home\rejap\github\ironpython3\Src\IronPythonTest\Cases\IronPythonCases.cs:line 24

PEP 237 -- int/long Unification

Python 3 gets rid of the distinction between int and long, with int now behaving as long. One way would be to switch everything to BigInteger, but it might be more efficient to try and use Int32 as much as possible behind the scenes, and switch to BigInteger if we have to while keeping the visible type int at all times.

Probably worth doing some benchmarks to see if it's worthwhile first.

Clean up setting prefix/exec_prefix during startup

prefix (Lib location) and exec_prefix (Include location, not used in IronPython) get set multiple times in multiple places, using inconsistent locations, during interpreter startup. Arguably the DLLs shouldn't even try to set the prefix and instead rely on getting it from the host, which will know where it's stdlib is stored.

IronPython DataGridView: Get Value from One Key Press But Without Pressing 'Enter' and Move to the Next Cell

I've been struggling with the difficulty for a few days. I've read on http://www.ironpython.info/ and book 'IronPython In Action' by Michael and Christian, and DataGridView class on https://msdn.microsoft.com/en-us/library/system.windows.forms.datagridview(v=vs.110).aspx, but I'm still lack of some knowledge and skills.
My question is how to get value from one key press but without pressing 'Enter' and Move to the next cell, which means when I press one number on keyboard but without pressing 'Enter', the number is passed into the first cell such as 3, and then the next cell is active. The sequence is meander, like row 1 col 1 -> row 1 col 2 -> ... -> row 1 col 12 -> row 2 col 12 -> row 2 col 11. I tried many events of DataGridView such as 'CellEnter' and 'KeyPress', but failed.
If you could give some hints about it, I'll appreciate it very much.
The following is my code up to now:

import clr

clr.AddReference('System.Windows.Forms')
clr.AddReference('System.Drawing')

from System.Windows.Forms import Form
from System.Windows.Forms import DataGridView
from System.Windows.Forms import DataGridViewContentAlignment
from System.Windows.Forms import Application
from System.Windows.Forms import Control
from System.Windows.Forms import Clipboard
from System.Windows.Forms import DataFormats
from System.Windows.Forms import DataObject

from System.Drawing import Point
from System.Drawing import Size
from System.Drawing import Font
from System.Drawing import FontStyle
from System.Drawing import Color

from System import Text

from System.IO import MemoryStream

NUMROWS = 6
NUMCOLS = 12

data = [[-1 for x in range(NUMCOLS)] for x in range(NUMROWS)]

class DataGridForm(Form):
def init(self, numcols, numrows):
self.Text = 'DataGridView Cell Format Test'
self.ClientSize = Size(98 * (numcols + 1), 25 * (numrows + 1))
self.dgv = DataGridView()
self.numcols = numcols
self.numrows = numrows
self.setupdatagridview()
self.adddata()
self.formatheaders()

def setupdatagridview(self):
    self.dgv.Location = Point(0, 0)
    self.dgv.Size = Size(98 * (NUMCOLS + 1), 25 * (NUMROWS + 1))
    self.Controls.Add(self.dgv)
    # have to have columns defined before inserting rows
    self.dgv.ColumnCount = self.numcols
    # center all text in all data cells by default
    self.dgv.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
    #self.dgv.CellEnter += self.move
    #self.dgv.CellValueChanged +=self.move
    #self.dgv.Enter += self.move
    #self.dgv.CellStateChanged += self.move
    #self.dgv.ChangeUICues += self.move
    #self.dgv.EditingControlShowing += self.move
    #self.dgv.EditModeChanged += self.move
    #self.dgv.GotFocus += self.move
    #self.dgv.HandleCreated += self.move
    #self.dgv.KeyPress += self.move
    #self.dgv.KeyDown += self.move
    #self.dgv.KeyUp += self.move
    #self.dgv.MouseEnter += self.move
    #self.dgv.Move += self.move
    #self.dgv.TextChanged += self.move

    # add empty rows first
    for num in xrange(self.numrows):
        self.dgv.Rows.Add()
    # format empty cells
    self.dgv.AllowUserToAddRows = False
    self.dgv.AllowUserToDeleteRows = False
    self.dgv.ReadOnly = False
    self.dgv.ClearSelection()

def formatheaders(self):
    for num in xrange(self.numcols):
        col = self.dgv.Columns[num]
        col.HeaderCell.Value = str(num + 1)
        # slightly left of center on headers
        col.HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
        # sets font and font style
        col.HeaderCell.Style.Font = Font(Control.DefaultFont, FontStyle.Bold) 
        col.HeaderCell.Style.ForeColor = Color.MidnightBlue
    # put numbers on rows
    for num in xrange(self.numrows):
        row = self.dgv.Rows[num]
        # get sequential numeric label on side of row
        row.HeaderCell.Value = str(num + 1)
        # sets font and font style
        row.HeaderCell.Style.Font = Font(Control.DefaultFont, FontStyle.Bold)
        row.HeaderCell.Style.ForeColor = Color.Blue
    self.dgv.TopLeftHeaderCell.Value = 'Score'
    self.dgv.TopLeftHeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
    self.dgv.TopLeftHeaderCell.Style.Font = Font(Control.DefaultFont, FontStyle.Bold)
    self.dgv.TopLeftHeaderCell.Style.ForeColor = Color.Blue
    self.dgv.RowHeadersWidth = 60

def adddata(self):
    for num in xrange(self.numrows):
        row = self.dgv.Rows[num]
        dat = (datax for datax in data[num]) 
        for cell in row.Cells:
            cell.Value = dat.next()
"""            
def move(self, sender, event):
    print 'move'
"""

dataGridForm = DataGridForm(NUMCOLS, NUMROWS)
Application.Run(dataGridForm)

Can't get make.cmd to work.

Hi.

I've followed the instructions to run make.cmd and failed to build the project:

Runtime\PythonDynamicStackFrame.cs(51,51): error CS1061: "System.Delegate"???"GetMethodInfo"???,???????????"System.Delegate"???????????"GetMethodInfo"(???? using ?????????) [D:\Dev2\iron\ironpython3\Src\IronPython\IronPython.csproj]
Runtime\PythonDynamicStackFrame.cs(53,52): error CS1061: "System.Delegate"???"GetMethodInfo"???,???????????"System.Delegate"???????????"GetMethodInfo"(???? using ?????????) [D:\Dev2\iron\ironpython3\Src\IronPython\IronPython.csproj]
Runtime\FunctionCode.cs(583,43): error CS1061: "System.Delegate"???"GetMethodInfo"???,???????????"System.Delegate"???????????"GetMethodInfo"(???? using ?????????) [D:\Dev2\iron\ironpython3\Src\IronPython\IronPython.csproj]
Runtime\FunctionCode.cs(583,77): error CS1061: "System.Delegate"???"GetMethodInfo"???,???????????"System.Delegate"???????????"GetMethodInfo"(???? using ?????????) [D:\Dev2\iron\ironpython3\Src\IronPython\IronPython.csproj]
Runtime\Types\PythonType.cs(797,32): error CS0117: "Microsoft.Scripting.Actions.TypeTracker"????"GetTypeTracker"??? [D:\Dev2\iron\ironpython3\Src\IronPython\IronPython.csproj]
Runtime\Types\ReflectedEvent.cs(177,49): error CS1061: "Microsoft.Scripting.Actions.EventTracker"???"GetAddMethod"???,???????????"Microsoft.Scripting.Actions.EventTracker"???????????"GetAddMethod"(???? using ?????????) [D:\Dev2\iron\ironpy thon3\Src\IronPython\IronPython.csproj]
Runtime\Types\ReflectedEvent.cs(207,52): error CS1061: "Microsoft.Scripting.Actions.EventTracker"???"GetRemoveMethod"???,???????????"Microsoft.Scripting.Actions.EventTracker"???????????"GetRemoveMethod"(???? using ?????????) [D:\Dev2\iron\ ironpython3\Src\IronPython\IronPython.csproj]
  IronPythonTestConsole -> D:\Dev2\iron\ironpython3\bin\v2Debug\IronPythonTestConsole.exe

Sorry for the mysterious error messages. I'm on a localized Windows box :(
Any idea how can I get it to work? I've installed VS2013 Community Edition and I can build just IronPython 2.x fine.

Thanks in advance!

missing _have_funtions in module _nt causes exception

$ ./ipy.exe -c 'print(1)'
Traceback (most recent call last):
  File "C:\cygwin64\home\rejap\github\ironpython3\Src\StdLib\Lib\site.py", line 72, in <module>
  File "C:\cygwin64\home\rejap\github\ironpython3\Src\StdLib\Lib\os.py", line 403, in <module>
NameError: global name 'supports_dir_fd' is not defined1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.