[IronPython] fepy's expat.py with xmpp?
Anyone have any luck using fepy's pyexpat.py managed code replacement with xmpp.py on IronPython? I'm having some trouble getting the xmpp client to talk to the xmppd server, even though the CPython version works fine. About the only difference, I think, is pyexpat.py. In fepy's pyexpat, I don't understand how: def Parse(self, data, isfinal=False): self._data.append(data) if isfinal: data = .join(self._data) self._data = None self._parse(data) will do any parsing until later, but I'm pretty sure that the CPython version starts parsing right away. Am I missing something obvious? Any pointers appreciated! -Doug ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] Importing DLLs: namespaces and classes
I'm attempting to write C# code that behaves like a native Python/Ruby library when imported. However, I can't get the same semantics. In Python: 1) if I put everything in a namespace, then I can issue from library import *, but if I put it in a class, then I can't from ... import 2) if I put everything in a class, then I can have static functions and values, but I can't from ... import But namespaces can't have static functions and values. Here is a sample of what I'm trying, and what I want: namespace myro { public class myro { public class Robot { } public static Robot robot; public static void forward() { robot.forward(); } } } In Python: from myro import * # should have robot, Robot, and forward in scope import myro # should have myro.robot, myro.Robot, myro.forward and scope Is there something I'm doing wrong, or is there a hook that I can add to my importer to get the desired behavior? Thanks for any pointers! -Doug ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] Some Objects not visible in my Shell?
I'm working on a couple of variations of an IronPython Shell, and I have the following issue. When I import some DLLs interactively, I'm not seeing all of the available objects. For example, in my shells I try: import clr clr.AddReference(System) from System.Threading import Thread and I get the error that 'Cannot import name Thread'. In fact, if I: import System.Threading dir(System.Threading) I get: ['Semaphore', 'SemaphoreFullException', 'ThreadExceptionEventArgs', 'ThreadExceptionEventHandler'] However, using the ipy.exe console, I correctly get: import System.Threading dir(System.Threading) ['AbandonedMutexException', 'ApartmentState', 'AsyncFlowControl', 'AutoResetEvent', 'CompressedStack', 'ContextCallback', 'EventResetMode', 'EventWaitHandle', 'ExecutionContext', 'HostExecutionContext', 'HostExecutionContextManager', 'IOCompletionCallback', 'Interlocked', 'LockCookie', 'ManualResetEvent', 'Monitor', 'Mutex', 'NativeOverlapped', 'Overlapped', 'ParameterizedThreadStart', 'ReaderWriterLock', 'RegisteredWaitHandle', 'Semaphore', 'SemaphoreFullException', 'SendOrP ostCallback', 'SynchronizationContext', 'SynchronizationLockException', 'Thread', 'ThreadAbortException', 'ThreadExceptionEventArgs', 'ThreadExceptionEventHandler', 'ThreadInterruptedException', 'ThreadPool', 'ThreadPriority', 'ThreadStart', 'ThreadStartException', 'ThreadState', 'ThreadStateException', 'Timeout', 'Timer', 'TimerCallback', 'WaitCallback', 'WaitHandle', 'WaitHandleCannotBeOpenedException', 'WaitOrTimerCallback'] I feel I must be doing something fundamentally wrong... anyone have a guess as to what that might be? Thanks for any ideas! -Doug ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] IronPython, stack frames and pdb
- Michael Foord fuzzy...@voidspace.org.uk wrote: Hello Dino, Curt et al., If stack frames are implemented as an option in IronPython it would be *really* nice to enable sys.set_trace when they are on. Plus any other APIs not currently implemented that are needed by pdb. Doing CPython development again I've been reminded how insanely useful pdb is. :-) What would be really nice is to enable stack frames on a per engine / runtime basis so that we could allow the setting of break-points and debugging of Resolver One user code. 1++ This would be excellent! I also wonder if there is an trace API that could be shared with other languages, and worked into the DLR? This would be very nice for our educational infrastructure we are building. -Doug Michael ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Newbie: convert string to python expression??
This is just a Python issue (not specific to IronPython). exec is used for statement(s) and eval() for expressions. You might have to: try: eval(root.inputBox.Text) except: exec root.inputBox.Text -Doug - xkrja kristian.jak...@gmail.com wrote: Thanks for the reply. This is what I have: def inputBox_KeyDown(s, e): root.message.Text = '' key = e.Key.value__ if key == 3: result = eval(root.inputBox.Text) root.message.Text = str(result) eval() seems to work sometimes. For example if the text in the textbox is 1+1 . But if the text for example is a=1 i get an error Unexpected token '=' (This is in Ironpython studio). I guess it is because a=1 is not an expression. What should I use then? What if I don't know what the user will type in? Thanks again! -- View this message in context: http://www.nabble.com/Newbie%3A-convert-string-to-python-expression---tp21029759p21031241.html Sent from the IronPython mailing list archive at Nabble.com. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
[IronPython] Latest Hosting API
What sources do you recommended for the latest IronPython RC1 hosting API? As far as I have found most docs still use older API's and I don't think Foord and Muirhead's latest available MEAP e-version is out yet. Thanks! -Doug ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] Roadmap and updates
- Curt Hagenlocher [EMAIL PROTECTED] wrote: The initialization code is so generic and predictable that you don't have to do much more than lop the semicolons off the ends of the lines. Of course, you don't even have to do that as Python allows semicolons on the ends :) Another way to answer your question, Max, is that Mono supports WinForms too. We are working on a similar project, but I think IronPython + WinForms is where we will be for a few years. But, we aren't writing our base libraries in Python anymore, but C#. That way it still looks the same in Python, but the the other DLR languages can use them too. And you can use other alternate operating systems. I predict that there will be a huge number of DLR languages in the next few years, and your uses can switch languages while keeping the base libraries, if you write in C#. -Doug Disclaimer: I am a Microsoft employee, but I have absolutely no inside knowledge on any of the topics I've written on here other than those related directly to IronPython. On Mon, Aug 4, 2008 at 7:06 PM, Max R. Yaffe [EMAIL PROTECTED] wrote: Note: I originally wrote this to Harry Pierson directly who asked that I post it publically. I hope it doesn't come off as too inflamatory. Harry - Thanks for the roadmap and the latest update. It clarifies a particular issue that I'm having with deciding whether to adopt Iron Python and .Net for that matter. My particular application is a scientific instrument control and data analysis package. It runs on Windows now using various older MS technologies (dating back to Windows 2.3!). It will not need to run from a web browser, mainly because of the requirements for instrument control. The application is highly scripted using a dynamic language of my own devising derived from Smalltalk and remarkably similar to Python. I had been looking at Qt 4.x+PyQt+Python 2.5 as an approach to updating my technology. However, I wanted to see what Microsoft had to offer. WinForms + Python seems to be the best fit for my technology because of the need to manipulate data tables and my desire to avoid the web. Silverlight just doesn't offer me any advantage and seems to be directed at pretty pictures and sounds. It also doesn't seem to handle the kinds of user/data interaction I need. XAML also doesn't seem to offer any advantage for my code, or if it does, it certainly isn't clear what it might be other than a YAOUHD (yet another obese, unreadable HTML derivative). Your roadmap, however, seems to deprecate WinForms. I'm worried that IronPython and Microsoft are going to cut WinForms adrift just when I'm about to make a major investment in it. This might be the best approach for Microsoft because it seems the community is mainly interested in pictures, sounds, and the web. But I need something more classical. I'd appreciate your comments and direction. Max Yaffe Gamry Instruments, Inc. ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com ___ Users mailing list Users@lists.ironpython.com http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
Re: [IronPython] [Ironruby-core] DLR IDE
Stefan, Ben, and all, It looks like there may be a few choices to choose from! We are also working on an IDE, but it is part of a larger project. Our goal is to create an educational framework for teaching ideas in computer science. It is also open source, but no doubt differs from your initial ideas---but we could all work together as well. Our main goals: - crossplatform (Mac, Windows, Linux) - multi-programming language (DLR languages: initially Python, Ruby, and Scheme) - i18n support - IDE with color syntax, and emacs-like extensibility/use - designed for ease-of-use, but powerful - easy to install and run - collect of libraries that are fast and easy Our IDE is part of the Pyjama Project. The IDE you can think of it as IDLE for .NET/Mono. One of the specific goals is to allow easy connections to Microsoft Robotics Developer Studio, but it has a much larger scope, too. We are putting together some libraries that will be very useful in interactive environments. Of course, these libraries will be able to be used by any .NET/Mono system. These include: - 2d graphics (see Zelle's Python graphics.py and Guzdial's Media Computation) - 3d graphics and games (like pygame) - artificial intelligence (see http://pyrorobotics.org) We'll be announcing some more details about the Pyjama Project, but would love to collaborate with others in whatever ways possible. Perhaps initially a single mailing list to discuss the details would be useful? Count us in! -Doug - Ben Hall [EMAIL PROTECTED] wrote: Hi Stefan, An interesting approach - you want people to collaborate so you start a new project? When writing the editors, people have lots of different reasons for doing so - not everyone wants to create an IDE, some people just want to create a cool sample to learn Silverlight \ DLR which they then release. Some people don't want to collaborate with others, that is not their aim and you can't blame people for that. Personally, since releasing IronEditor I have had loads of people sending me sample code, feature requests, and some other really really interesting stuff. People are collaborating behind the scenes to improve the application, personally I have a list of other people I want to contact about improving the application and working together. Same with Michael Foord's TryPython, lots of people provided feedback after he went live. Collaboration isn't just code. Good luck with your IDE, but open source projects are not as easy as they sound, I look forward to seeing how it goes. I tried to make this point on your post, however your spam filter wasn't displaying any images - makes it difficult to make a comment then :) On a side note, if people want to help with IronEditor - contact me offline. Thanks for everyone who has already. Thanks Ben Blog.BenHall.me.uk On Fri, Jul 25, 2008 at 7:38 AM, Stefan Dobrev [EMAIL PROTECTED] wrote: Hi all, Wouldn't be nice if we all create a DLR IDE. I have being thinking for this for quite some times recently. As usually happens someone else also has been thinking of this and actually blogged about it here. Saying: --- So what's my point? I think all of these projects are great and kudos to the people that built them. It takes a lot of time and effort above and beyond just regular work hours. I have been there myself, my hats off to you folks! But, there are 8 versions of the interactive console and a few versions of a basic code editor. I know it may be a dream, but it would be great to collaborate with these people and write out a simple set of requirements for what a great DLR console and code editor would be. And then as a virtual team, implement it. After all, to a large degree, it will be how well supported the language is from a tools perspective that will really determine the rate of adoption. And right now, the tools (or IDE) experience for Dynamic Languages on .NET is severely lacking to the point of having several people independently developing their own tooling. In this post I only pointed out a handful of these tools and I know there are others, but I was really targeting web-based IDE's. Maybe that is an opportunity? Or is it a pipe dream? --- So let's come together and build a difference. I have made the first step and created a project on codeplex - http://codeplex.com/dlride. I have also written some basic requirements for the project in the wiki. Let we all collaborate on them. For everyone who want to take a part, please feel free to contact me, so I can give you permissions for the project on codeplex. Regards, Stefan ___ Ironruby-core mailing list [EMAIL PROTECTED] http://rubyforge.org/mailman/listinfo/ironruby-core ___ Users mailing list Users@lists.ironpython.com