From stephen.baugh1 at ntlworld.com Fri Jul 1 02:49:31 2011 From: stephen.baugh1 at ntlworld.com (Steve Baugh) Date: Fri, 01 Jul 2011 01:49:31 +0100 Subject: [Ironpython-users] SQLite3 In-Reply-To: References: <1309209989.2017.9.camel@steve-EP35C-DS3R> <1309402834.2765.3.camel@steve-EP35C-DS3R> Message-ID: <1309481371.11089.2.camel@steve-EP35C-DS3R> Thanks Jeff, I will try it soon, Steve On Wed, 2011-06-29 at 21:00 -0700, Jeff Hardy wrote: > Hi Steve, > Please download a new copy of the file. The old one was built against > a beta version of IronPython 2.7. It works in my quick testing. > > - Jeff > > On Wed, Jun 29, 2011 at 8:00 PM, Steve Baugh > wrote: > > > > Jeff, > > > > Thank you for your reply. > > > > I have downloaded > > > > IronPython.SQLite-2.7.0_ipy-2.7_clr-v4.0.zip > > > > but can't make it work. > > > > I have put the IronPython.SQLite.dll in the DLLs folder and put the > > sqlite3 folder under Lib. > > > > When I try: > > > > import sqlite3 > > > > in either ipy or ipy64 I get: > > > > ImportError: No module named _sqlite3 > > > > I have put copies of sqlite.dll in both the IronPython 2.7 folder and > > the DLLs folder. > > > > When I import clr and try clr.AddReference("IronPython.SQLite") it seems > > to add the refrence (when the default path is right) but I still get the > > No module named _sqlite3 error with an import statement. > > > > The IronPython 2.7 installed to Program Files (x86) as it is a 64 bit > > system. I have also tried with with a Win XP 32 bit system. > > > > I am encouraged that you said it should work, but I seem to be doing > > something wrong.... > > > > Steve > > On Wed, 2011-06-29 at 09:33 -0700, Jeff Hardy wrote: > >> You should be able to use IronPython.SQLite > >> (https://bitbucket.org/jdhardy/ironpython.sqlite/). There's a > >> 2.7-compatible build on the downloads page. It's not 100% compatible > >> with CPython sqlite, but it's pretty darn close. > >> > >> - Jeff > >> > >> On Mon, Jun 27, 2011 at 2:26 PM, Steve Baugh > >> wrote: > >> > I am trying to port a Linux Python program to IronPython and WPF. This > >> > program makes use of sqlite3. I am not trying to use data aware contols, > >> > I just want to issue SQL commands and get the results from SELECT > >> > statements. > >> > > >> > I have been getting conflicting, and in some cases contradictory, > >> > information from my web searches. > >> > > >> > Has anyone done this with IronPython 2.7 on .NET 4? I am am using > >> > SharpStudio in Windows 7 64 bit (but I am not trying to build a 64 bit > >> > application). > >> > > >> > Thanks, > >> > > >> > Steve > >> > > >> > _______________________________________________ > >> > Ironpython-users mailing list > >> > Ironpython-users at python.org > >> > http://mail.python.org/mailman/listinfo/ironpython-users > >> > > > > > > > From no_reply at codeplex.com Fri Jul 1 14:26:09 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 1 Jul 2011 05:26:09 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 6/30/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [Status update] compile('#foo\n', '', 'single') throws null ref exception 2. [Status update] compile('#foo\n', '', 'single') throws null ref exception ---------------------------------------------- ISSUES 1. [Status update] compile('#foo\n', '', 'single') throws null ref exception http://ironpython.codeplex.com/workitem/30942 User jdhardy has updated the issue: Status has changed from Proposed to Closed with the following comment, "Duplicate of #30940."----------------- 2. [Status update] compile('#foo\n', '', 'single') throws null ref exception http://ironpython.codeplex.com/workitem/30941 User jdhardy has updated the issue: Status has changed from Proposed to Closed with the following comment, "Duplicate of #30940." ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From stephen.baugh1 at ntlworld.com Fri Jul 1 23:24:08 2011 From: stephen.baugh1 at ntlworld.com (Steve Baugh) Date: Fri, 01 Jul 2011 22:24:08 +0100 Subject: [Ironpython-users] SQLite3 In-Reply-To: <1309481371.11089.2.camel@steve-EP35C-DS3R> References: <1309209989.2017.9.camel@steve-EP35C-DS3R> <1309402834.2765.3.camel@steve-EP35C-DS3R> <1309481371.11089.2.camel@steve-EP35C-DS3R> Message-ID: <1309555448.1775.23.camel@steve-EP35C-DS3R> Jeff, Thank you for doing the updated file. I have downloaded it. I have got it working but the plot thickens! I put the new IronPython.SQLite.dll + sqlite3.dll into the DLLs directory. Doing import sqlite3 gave the _sqlite3 not found error. I then put a copy of the dll in the same directory as ipy64.exe so it was on the path, then started ipy64.exe by double clicking the file (if you start it through the Start Menu the path isn't right). after import clr and clr.AddReference("IronPython.SQLite") I could then import sqlite3 correctly. So this seems OK except that it did not automatically add the reference by putting it in the DLLs directory. I then tried to get things going under SharpDevelop, after a lot of experiment I found that I had to put the dll and the sqlite3 directory in \Program Files (x86)\SharpDevelop\4.0\AddIns\BackendBindings \PythonBinding I could then add the reference but got _sqlite3 not found again. I found eventually that the version ID of the SharpDevelop IronPython.dll is 2.6.1008.2 whilst the IronPython 2.7 distribution is 2.7.0.40 So I then put the OLD dll in THIS directory (I still had a copy) and things then started to work through the IDE! Hope all this makes sense. I have only checked that I can import sqlite3, I havn't tested the functionality yet. BTW do I need sqlite3.dll as well? Thanks Steve On Fri, 2011-07-01 at 01:49 +0100, Steve Baugh wrote: > Thanks Jeff, > > I will try it soon, > > Steve > > On Wed, 2011-06-29 at 21:00 -0700, Jeff Hardy wrote: > > Hi Steve, > > Please download a new copy of the file. The old one was built against > > a beta version of IronPython 2.7. It works in my quick testing. > > > > - Jeff > > > > On Wed, Jun 29, 2011 at 8:00 PM, Steve Baugh > > wrote: > > > > > > Jeff, > > > > > > Thank you for your reply. > > > > > > I have downloaded > > > > > > IronPython.SQLite-2.7.0_ipy-2.7_clr-v4.0.zip > > > > > > but can't make it work. > > > > > > I have put the IronPython.SQLite.dll in the DLLs folder and put the > > > sqlite3 folder under Lib. > > > > > > When I try: > > > > > > import sqlite3 > > > > > > in either ipy or ipy64 I get: > > > > > > ImportError: No module named _sqlite3 > > > > > > I have put copies of sqlite.dll in both the IronPython 2.7 folder and > > > the DLLs folder. > > > > > > When I import clr and try clr.AddReference("IronPython.SQLite") it seems > > > to add the refrence (when the default path is right) but I still get the > > > No module named _sqlite3 error with an import statement. > > > > > > The IronPython 2.7 installed to Program Files (x86) as it is a 64 bit > > > system. I have also tried with with a Win XP 32 bit system. > > > > > > I am encouraged that you said it should work, but I seem to be doing > > > something wrong.... > > > > > > Steve > > > On Wed, 2011-06-29 at 09:33 -0700, Jeff Hardy wrote: > > >> You should be able to use IronPython.SQLite > > >> (https://bitbucket.org/jdhardy/ironpython.sqlite/). There's a > > >> 2.7-compatible build on the downloads page. It's not 100% compatible > > >> with CPython sqlite, but it's pretty darn close. > > >> > > >> - Jeff > > >> > > >> On Mon, Jun 27, 2011 at 2:26 PM, Steve Baugh > > >> wrote: > > >> > I am trying to port a Linux Python program to IronPython and WPF. This > > >> > program makes use of sqlite3. I am not trying to use data aware contols, > > >> > I just want to issue SQL commands and get the results from SELECT > > >> > statements. > > >> > > > >> > I have been getting conflicting, and in some cases contradictory, > > >> > information from my web searches. > > >> > > > >> > Has anyone done this with IronPython 2.7 on .NET 4? I am am using > > >> > SharpStudio in Windows 7 64 bit (but I am not trying to build a 64 bit > > >> > application). > > >> > > > >> > Thanks, > > >> > > > >> > Steve > > >> > > > >> > _______________________________________________ > > >> > Ironpython-users mailing list > > >> > Ironpython-users at python.org > > >> > http://mail.python.org/mailman/listinfo/ironpython-users > > >> > > > > > > > > > > > > From no_reply at codeplex.com Sat Jul 2 16:53:25 2011 From: no_reply at codeplex.com (no_reply at codeplex.com) Date: 2 Jul 2011 07:53:25 -0700 Subject: [Ironpython-users] IronPython, Daily Digest 7/1/2011 Message-ID: Hi ironpython, Here's your Daily Digest of new issues for project "IronPython". In today's digest:ISSUES 1. [New issue] Scope is not remembered after an import 2. [New comment] Scope is not remembered after an import ---------------------------------------------- ISSUES 1. [New issue] Scope is not remembered after an import http://ironpython.codeplex.com/workitem/30955 User WimVanLoocke has proposed the issue: "When using ironpython to run py scripts, one creates in c# as scope for the engine, and sets a variable. When running the .py file is executed and the scope is know. When running a .py file that imports an other .py file( can contains ref to variable in the scope ) the variable is no longer know. When looking into the code { snipped } internal PythonModule/*!*/ CompileModule(string fileName, string moduleName, SourceUnit sourceCode, ModuleOptions options, out ScriptCode scriptCode) { ContractUtils.RequiresNotNull(fileName, "fileName"); ContractUtils.RequiresNotNull(moduleName, "moduleName"); ContractUtils.RequiresNotNull(sourceCode, "sourceCode"); scriptCode = GetScriptCode(sourceCode, moduleName, options); Scope scope = scriptCode.CreateScope(); return InitializeModule(fileName, ((PythonScopeExtension)scope.GetExtension(ContextId)).ModuleContext, scriptCode, options); } { end snipped } you can see that a new scope is created, and not the initial scope is used. Init : _Engine = Python.CreateEngine(); scope = _Engine.CreateScope(); scope.SetVariable("I2C", localEngine); scope.SetVariable("UART", Poderosa); scope.SetVariable("dbg", _txtOut); _txtBox.InteractiveObj.Add("I2C", localEngine); _txtBox.InteractiveObj.Add("UART", Poderosa); _txtBox.InteractiveObj.Add("dbg", _txtOut); Execute _Engine.ExecuteFile(_PathToScript, scope);"----------------- 2. [New comment] Scope is not remembered after an import http://ironpython.codeplex.com/workitem/30955 User slide_o_mix has commented on the issue: "This doesn't work in CPython either. Each module has it's own scope: foo.py: print "x = %d" % x def foo(): x = globals()['x'] print "x = %d" % x script.py: x = 5 import foo foo.doit() OUTPUT: Traceback (most recent call last): File "C:\Python27\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript exec codeObject in __main__.__dict__ File "script.py", line 3, in import foo File "foo.py", line 3, in print "x = %d" % x NameError: name 'x' is not defined " ---------------------------------------------- ---------------------------------------------- You are receiving this email because you subscribed to notifications on CodePlex. To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: From w.schmoller at gmx.de Sun Jul 3 12:30:17 2011 From: w.schmoller at gmx.de (Wolfgang Schmoller) Date: Sun, 03 Jul 2011 12:30:17 +0200 Subject: [Ironpython-users] importing third-party modules Message-ID: Hello, I'm working on a site, where I need to work with python. I have managed to configure that, so that I can use python instead of Javascript. Now, I need to import a third-party module (nltk - http://www.nltk.org/). I installed it in the commandline-version of IronPython and am able to import it with ipy. But I can't import it in the web application. I have tried to work with sys.path.append("path\to\nltk"), but the module can't be found. I use python via the The logs just say, that no favicon was found and I tend to doubt, that this is the problem...;-) Best regards Wolfgang Am 03.07.2011, 17:19 Uhr, schrieb Jimmy Schementi : > On Jul 3, 2011, at 9:32 AM, Dave Wald wrote: >> On 7/3/2011 5:30 AM, Wolfgang Schmoller wrote: >>> Hello, >>> >>> I'm working on a site, where I need to work with python. I have >>> managed to configure that, so that I can use python instead of >>> Javascript. Now, I need to import a third-party module (nltk - >>> http://www.nltk.org/). I installed it in the commandline-version of >>> IronPython and am able to import it with ipy. But I can't import it in >>> the web application. I have tried to work with >>> sys.path.append("path\to\nltk"), but the module can't be found. >>> >>> I use python via the > > > > > > The logs just say, that no favicon was found and I tend to doubt, that > this is the problem...;-) > > Best regards > Wolfgang > > Am 03.07.2011, 17:19 Uhr, schrieb Jimmy Schementi : > >> On Jul 3, 2011, at 9:32 AM, Dave Wald wrote: >>> On 7/3/2011 5:30 AM, Wolfgang Schmoller wrote: >>>> Hello, >>>> >>>> I'm working on a site, where I need to work with python. I have >>>> managed to configure that, so that I can use python instead of >>>> Javascript. Now, I need to import a third-party module (nltk - >>>> http://www.nltk.org/). I installed it in the commandline-version of >>>> IronPython and am able to import it with ipy. But I can't import it >>>> in the web application. I have tried to work with >>>> sys.path.append("path\to\nltk"), but the module can't be found. >>>> >>>> I use python via the