[ANN]VTD-XML 2.10
VTD-XML 2.10 is now released. It can be downloaded at https://sourceforge.net/projects/vtd-xml/files/vtd-xml/ximpleware_2.10/. This release includes a number of new features and enhancement. * The core API of VTD-XML has been expanded. Users can now perform cut/paste/insert on an empty element. * This release also adds the support of deeper location cache support for parsing and indexing. This feature is useful for application performance tuning for processing various XML documents. * The java version also added support for processing zip and gzip files. Direct processing of httpURL based XML is enhanced. * Extended Java version now support Iso-8859-10~16 encoding. * A full featured C++ port is released. * C version of VTD-XML now make use of thread local storage to achieve thread safety for multi-threaded application. * There are also a number of bugs fixed. Special thanks to Jozef Aerts, John Sillers, Chris Tornau and a number of other users for input and suggestions -- http://mail.python.org/mailman/listinfo/python-list
wxpython:how to minimize to taskbar
I'm kinda newbie to python and wxPython. Now I'm confronting a thorny problem: how can I make my program minimize to the taskbar represented as an ico, and when there is some message from network coming, it will pop out? -- http://mail.python.org/mailman/listinfo/python-list
wxPython unexpected exit
Hi, wxPython is cool and easy to use, But I ran into a problem recently when I try to write a GUI. The thing is I want to periodically update the content of StatixText object, so after create them, I pack them into a list...the problem comes when I later try to extract them from the list! I don't know why? my code is as following: import wx, socket import thread class MyFrame(wx.Frame): firstrun = 0 def __init__(self): wx.Frame.__init__(self, None, -1, 'Notifier') self.panel = wx.Panel(self, -1) self.length = 50 self.scale = 0.6 self.count = 5 self.size = wx.Frame.GetSize(self) self.distance = self.size[1] / self.count self.labellist = [] self.gaugelist = [] def ParseAndDisplay(self, data): print "Successful access to main Frame class" print 'And receive data: ', data if MyFrame.firstrun == 0: print 'First time run' items = 3 for i in range(items): self.labellist.append(wx.StaticText(self.panel, -1, data+str(i), (150, 50+i*20), (300,30))) MyFrame.firstrun = 1 else: self.labellist[0].SetLabel('AAA')//PROGRAM WILL ABORT HERE!!! self.labellist[1].SetLabel("Guo") self.labellist[2].SetLabel("Qiang") class NetUdp: def __init__(self): self.port = 8081 self.s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) self.s.bind(("", self.port)) print "Listening on port", self.port def recvdata(self): data, addr = self.s.recvfrom(1024) return data def netThread(): netudp = NetUdp() while True: data = netudp.recvdata() frame.ParseAndDisplay(data) if __name__ == '__main__': firstrun = 0 app = wx.PySimpleApp() frame = MyFrame() frame.Show() # start network thread first id = thread.start_new_thread(netThread, ()) # main wxpython loop begins app.MainLoop() I know the code is ugly, but can anyone really save me here! -- http://mail.python.org/mailman/listinfo/python-list
Re: wxPython unexpected exit
On Sep 7, 9:42 pm, [EMAIL PROTECTED] wrote: > On Sep 7, 3:10 am, Jimmy <[EMAIL PROTECTED]> wrote: > > > > > Hi, wxPython is cool and easy to use, But I ran into a problem > > recently when I try to write a GUI. > > The thing is I want to periodically update the content of StatixText > > object, so after create them, I pack them into a list...the problem > > comes when I later try to extract them from the list! I don't know > > why? > > my code is as following: > > > import wx, socket > > import thread > > > class MyFrame(wx.Frame): > > > firstrun = 0 > > def __init__(self): > > wx.Frame.__init__(self, None, -1, 'Notifier') > > self.panel = wx.Panel(self, -1) > > self.length = 50 > > self.scale = 0.6 > > self.count = 5 > > self.size = wx.Frame.GetSize(self) > > self.distance = self.size[1] / self.count > > self.labellist = [] > > self.gaugelist = [] > > > def ParseAndDisplay(self, data): > > print "Successful access to main Frame class" > > print 'And receive data: ', data > > if MyFrame.firstrun == 0: > > print 'First time run' > > items = 3 > > for i in range(items): > > > > self.labellist.append(wx.StaticText(self.panel, -1, data+str(i), > > (150, 50+i*20), (300,30))) > > MyFrame.firstrun = 1 > > else: > > self.labellist[0].SetLabel('AAA')//PROGRAM WILL > > ABORT HERE!!! > > self.labellist[1].SetLabel("Guo") > > self.labellist[2].SetLabel("Qiang") > > > class NetUdp: > > > def __init__(self): > > self.port = 8081 > > self.s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) > > self.s.bind(("", self.port)) > > print "Listening on port", self.port > > > def recvdata(self): > > data, addr = self.s.recvfrom(1024) > > return data > > > def netThread(): > > netudp = NetUdp() > > while True: > > data = netudp.recvdata() > > frame.ParseAndDisplay(data) > > > if __name__ == '__main__': > > firstrun = 0 > > app = wx.PySimpleApp() > > frame = MyFrame() > > frame.Show() > > # start network thread first > > id = thread.start_new_thread(netThread, ()) > > # main wxpython loop begins > > app.MainLoop() > > > I know the code is ugly, but can anyone really save me here! > > If you use threads that update the GUI, you need to take a look at the > following wiki page:http://wiki.wxpython.org/LongRunningTasks > > I've used the techniques therein and they *just work*. I'm not sure if > you can set values on items in a list or not. I've tried that sort of > thing and sometimes it works and sometimes it doesn't. > > The wxPython group is probably the best place to ask these questions > anyway:http://www.wxpython.org/maillist.php > > Mike Thanks for your help! It seems work! Another question: I create a progress bar, and on creation, it will be displayed, How can I invisualize it when later I no longer need it? -- http://mail.python.org/mailman/listinfo/python-list
wxpython automate progress bar
Hi, I want a progress bar to increase automatically, so I wrote code like this: current = 0 while True: if current == 100: current = 0 self._gauge.SetValue(current) time.sleep(0.1) current = current + 1 I put this in the __init__ section, however, the window will never show! and there are error message like this: ** (python:28543): CRITICAL **: clearlooks_style_draw_handle: assertion `width >= -1' failed can anyone tell me why this happen?Thanks :) -- http://mail.python.org/mailman/listinfo/python-list
(wxPython) icon on panel
hi,all! have you used 'dictionary' of linux, the program that rests on the panel as an icon, and when you click on the icon, it will display a window and do something. So i'm wondering how to achieve this. I guess it's a dialog window, right? but the crucial part is how to minimize the program to an icon on the panel and make it responsive to the click event. thanks in advance! -- http://mail.python.org/mailman/listinfo/python-list
(curses) issue about inch()
hi, all I attempt to use the function inch() to get the character at the current position, and compare it with a particular character like : if screen.inch(x,y) == 'F' but this method doesn't seem work, can anyone tell me the reason and how to corrent it thanks -- http://mail.python.org/mailman/listinfo/python-list
Re: (curses) issue about inch()
On Sep 17, 12:07 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Jimmy wrote: > > hi, all > > I attempt to use the function inch() to get the character at the > > current position, and compare it with a particular character like : > > if screen.inch(x,y) == 'F' > > but this method doesn't seem work, can anyone tell me the reason and > > how to corrent it > > thanks > > The reason is because something is wrong, and yo fix it by correcting > that issue. > > In other words, if you could be a bit more specific about *how* it > doesn't work (like, show us the code you are running,a nd any error > messages or evidence of incorrect results) you will be able to get some > help that actually helps you. > > Would you go to a car repair shop with faulty brakes and just tell them > "my car isn't working"? > > regards > Steve > -- > Steve Holden+1 571 484 6266 +1 800 494 3119 > Holden Web LLC/Ltd http://www.holdenweb.com > Skype: holdenweb http://del.icio.us/steve.holden > > Sorry, the dog ate my .sigline thanks, actually i'm writing a game like mine,the pertainign code is: def mark(): """mark the bomb""" (row, col) = gb.scrn.getyx() x = gb.scrn.inch(row,col) if x == 'F': gb.scrn.addch(row,col, 'X',curses.color_pair(3)) else: gb.scrn.addch(row,col, 'F',curses.color_pair(3)) gb.scrn.move(row,col) gb.scrn.refresh() the situation is x never equals 'F', even when it really is! I checked the mannual and found the return value of inch() consists the actual character(low 8bits) and the attributes, so I tried the following: (x<<24)>>24,cause I guess the int is 32bits long. but it still doesn't work :( -- http://mail.python.org/mailman/listinfo/python-list
Re: (curses) issue about inch()
On Sep 17, 2:25 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Jimmy wrote: > > On Sep 17, 12:07 am, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Jimmy wrote: > >>> hi, all > >>> I attempt to use the function inch() to get the character at the > >>> current position, and compare it with a particular character like : > >>> if screen.inch(x,y) == 'F' > >>> but this method doesn't seem work, can anyone tell me the reason and > >>> how to corrent it > >>> thanks > >> The reason is because something is wrong, and yo fix it by correcting > >> that issue. > > >> In other words, if you could be a bit more specific about *how* it > >> doesn't work (like, show us the code you are running,a nd any error > >> messages or evidence of incorrect results) you will be able to get some > >> help that actually helps you. > > >> Would you go to a car repair shop with faulty brakes and just tell them > >> "my car isn't working"? > > >> regards > >> Steve > >> -- > >> Steve Holden+1 571 484 6266 +1 800 494 3119 > >> Holden Web LLC/Ltd http://www.holdenweb.com > >> Skype: holdenweb http://del.icio.us/steve.holden > > >> Sorry, the dog ate my .sigline > > > thanks, > > actually i'm writing a game like mine,the pertainign code is: > > > def mark(): > >"""mark the bomb""" > >(row, col) = gb.scrn.getyx() > >x = gb.scrn.inch(row,col) > >if x == 'F': > >gb.scrn.addch(row,col, 'X',curses.color_pair(3)) > >else: > >gb.scrn.addch(row,col, 'F',curses.color_pair(3)) > > >gb.scrn.move(row,col) > >gb.scrn.refresh() > > > the situation is x never equals 'F', even when it really is! > > I checked the mannual and found the return value of inch() consists > > the actual character(low 8bits) > > and the attributes, so I tried the following: (x<<24)>>24,cause I > > guess the int is 32bits long. > > but it still doesn't work :( > > Well first of all, thanks for reading the manual. > > Let's suppose the value you are receiving is 1234 (clearly more than 8 > bits). Unfortunately for you, recent versions of Python don't just use > 32-bit integers, but extend the values into Python's long values where > necessary. See: > > >>> (1234<<24)>>24 > 1234L > >>> > > What you really need is a logical and with 255: > > >>> 1234 & 255 > 210 > >>> > > Hope this helps. > > regards > Steve > -- > Steve Holden+1 571 484 6266 +1 800 494 3119 > Holden Web LLC/Ltd http://www.holdenweb.com > Skype: holdenweb http://del.icio.us/steve.holden > > Sorry, the dog ate my .sigline thanks, it works! python is cool, however, the python community is even cooler :) -- http://mail.python.org/mailman/listinfo/python-list
Re: Problem with custom events in wxpython
On May 11, 11:27 pm, "Frank Niessink" <[EMAIL PROTECTED]> wrote: > Hi Jimmy, > > 2008/5/11 Jimmy <[EMAIL PROTECTED]>: > > > hi, all > > > I'm having a problem with creating custom events in wxpython. > > > I have a class A handling some data processing work and another class > > B of GUI matter. I need GUI to display information when data in A is > > updated. > > I know cutom events in wxpython may work. > > You may want to look at the pubsub module. Available as wx.lib.pubsub > in wxPython:http://www.wxpython.org/docs/api/wx.lib.pubsub-module.html, > and also available separately on PyPI:http://pypi.python.org/pypi/PyPubSub/ > > Cheers, Frank hi, thanks it works! however, it seems the message can not be exchanged between processes :( actually what I want to do is let a running process send data to GUI process and display it -- http://mail.python.org/mailman/listinfo/python-list
how to get information of a running prog in python
Well, i know it may be a little non-python thing, however, I can think of no place better to post this question :) can anyone tell me, in python, how to obtain some information of a running program? paticularly, if i am playing some music in audacious or other media player, how can i get the the name and some other info of current playing song? It seems that audicious doesn't output on run-time -- http://mail.python.org/mailman/listinfo/python-list
Re: how to get information of a running prog in python
On May 13, 10:36 am, "Dan Upton" <[EMAIL PROTECTED]> wrote: > On Mon, May 12, 2008 at 10:19 PM, Jimmy <[EMAIL PROTECTED]> wrote: > > Well, i know it may be a little non-python thing, however, I can think > > of no place better to post this question :) > > > can anyone tell me, in python, how to obtain some information of a > > running program? > > paticularly, if i am playing some music in audacious or other media > > player, how can i get the the name and some other info of current > > playing song? It seems that audicious doesn't output on run-time > > -- > > http://mail.python.org/mailman/listinfo/python-list > > In most cases, you'll probably need some sort of API, either in the > program itself or through some sort of plugin, that lets external > programs query it. For instance, there are some plugins to WinAmp > that allow external programs (like Last.FM or Mog-O-Matic) to see what > track is currently playing. You may also be able to do something like > get the window title (again, WinAmp's title bar usually includes the > artist and title) and parse it out. I don't really know that there's > anything specific to Python for accessing these though, and it may > vary depending on media player. > > Just my two cents... > > -dan thanks! In linux, I am always obfuscated by sort of APIs. Like how to get title information of a running program? where am I supposed to find these APIs -- http://mail.python.org/mailman/listinfo/python-list
Re: how to get information of a running prog in python
On May 13, 11:18 am, Ivan Illarionov <[EMAIL PROTECTED]> wrote: > On Mon, 12 May 2008 19:19:05 -0700, Jimmy wrote: > > Well, i know it may be a little non-python thing, however, I can think > > of no place better to post this question :) > > > can anyone tell me, in python, how to obtain some information of a > > running program? > > paticularly, if i am playing some music in audacious or other media > > player, how can i get the the name and some other info of current > > playing song? It seems that audicious doesn't output on run-time > > In case of Audatious running on X11 all you need is Python X > libraryhttp://python-xlib.sourceforge.net/ > > And something like: > > from Xlib import display > > dpy = display.Display() > root = dpy.screen().root > > NET_WM_NAME = dpy.intern_atom('_NET_WM_NAME') > UTF8_STRING = dpy.intern_atom('UTF8_STRING') > > for win in root.query_tree().children: > try: > window_title = win.get_full_property(NET_WM_NAME, > UTF8_STRING).value > except AttributeError: > continue > if window_title.endswith('Audacious'): > song = window_title.split(' - ')[:-1] > if song: > print song > > -- Ivan Thanks! I also found a thing called 'audacious announcer' which can output detail information of the playing track. actually I'm working on a small program to display lyrics while playing music in media player. -- http://mail.python.org/mailman/listinfo/python-list
Re: how to get information of a running prog in python
On May 13, 4:41 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote: > En Tue, 13 May 2008 01:22:52 -0300, Ivan Illarionov > <[EMAIL PROTECTED]> escribió: > > > > > On Mon, 12 May 2008 20:29:46 -0700, George Sakkis wrote: > >>> > On Mon, May 12, 2008 at 10:19 PM, Jimmy <[EMAIL PROTECTED]> > >>> > wrote: > > >>> > > can anyone tell me, in python, how to obtain some information of > >>> > > a running program? > >>> > > paticularly, if i am playing some music in audacious or other > >>> > > media player, how can i get the the name and some other info of > >>> > > current playing song? It seems that audicious doesn't output on > >>> > > run-time -- > > >> Your best bet is if the *specific* program you're interested in (e.g. > >> audacious) exposes this information programmatically in some way. It's > >> up to the developers of this application if and how they choose to do > >> it. Even if they do it, there's no requirement that the same API will > >> work for any other program of the same category, unless there is some > >> popular industry standard that most applications implement. > > > George, have you read my post in this thread? What OP wants is actually > > possible and it's quite easy. X server is the "superprogram" that knows > > the names of all GUI window titles. > > That relies on the fact that audacious (or whatever player used) actually > includes the song name as part of its window title. As G. Sakkis said, > this depends on the specific program used. And what about "some other info > of current playing song"? > > -- > Gabriel Genellina since it's for lyrics displaying. you have to know time of where it is playing, the control of user, etc. -- http://mail.python.org/mailman/listinfo/python-list
create window on panel
Hi, all I have been trying to use wxPython to design a GUI that will be displayed on the panel on the top of desktop. that is when the program starts, it will dwell on the panel to display some dynamic information. can anyone tell me in wxPython how to do this? thanks! -- http://mail.python.org/mailman/listinfo/python-list
Re: create window on panel
On May 15, 5:54 pm, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > Jimmy wrote: > > Hi, all > > > I have been trying to use wxPython to design a GUI that will be > > displayed on the panel on the top of desktop. that is when the > > program starts, it will dwell on the panel to display some dynamic > > information. > > > can anyone tell me in wxPython how to do this? thanks! > > AFAIK it cannot be done in pure wxPython. The reason is that your > "panel" is part of the window manager. What kind of "panel" are you > talking about anyway? Under Microsoft Windows it is called "the tray". > In Gnome it is "panel" indeed. In KDE it might also be panel, there is > OS X etc. They are quite different. For example, under MS Windows you > cannot embed an application into the tray (other than an icon). > > They are all different window managers, based on different client libs > (MS gui, GTK, Qt etc.). wxPython is designed to be platform independent, > and it does not support special, platform dependent features. (Well it > does a few...) > > You need to tell us what kind of system are you using? Then we can tell > you where to start. For example, there are extension modules for writing > Gnome panel applications. (Well, it is not wxPython but GTK.) > > BTW the idea is good: we could have "panel" support in wxPython, but > since the interface of these panels (and how they should be programmed) > is very different on different platforms, it would not be easy to implement. > >Laszlo Thanks for your reply! I am using Linux+gnome. Actually, what I want is simply a text-region on the panel and display some dynamic information on it. Is it hard to do it ? -- http://mail.python.org/mailman/listinfo/python-list
Re: create window on panel
On May 15, 7:45 pm, Laszlo Nagy <[EMAIL PROTECTED]> wrote: > > Thanks for your reply! > > > I am using Linux+gnome. Actually, what I want is simply a text-region > > on the panel > > and display some dynamic information on it. Is it hard to do it ? > > Google is your friend! I searched for "gnome python panel" and the first > hit was: > > http://www.onlamp.com/pub/a/python/2000/07/25/gnome_applet.html > > :-) > > Of course it is out of date but you can see that there is something > called "/PyGNOME". > / > The package names on my Linux: > > python-gnome2 python-gnome2-desktop python-gnome2-extras python-gnomecanvas > > Description: > > Python bindings for the GNOME desktop environment > This archive contains modules that allow you to write GNOME programs > in Python. This package contains the bindings for the new version 2.0 > of that desktop environment. > > URL:http://www.daa.com.au/~james/software/pygtk/ > / > /It should be easy to read the docs, view the demo programs and create > your own program. > > L thanks~ it seems attractive, however, I did not find much useful information :( -- http://mail.python.org/mailman/listinfo/python-list
can python do some kernel stuff?
Hi to all python now has grown to a versatile language that can accomplish tasks for many different purposes. However, AFAIK, little is known about its ability of kernel coding. So I am wondering if python can do some kernel coding that used to be the private garden of C/C++. For example, can python intercept the input of keyboard on a system level? someone told me it's a kernel thing, isn't it? -- http://mail.python.org/mailman/listinfo/python-list
Re: can python do some kernel stuff?
On May 23, 3:05 pm, Andrew Lee <[EMAIL PROTECTED]> wrote: > Jimmy wrote: > > Hi to all > > > python now has grown to a versatile language that can > > accomplish tasks for many different purposes. However, > > AFAIK, little is known about its ability of kernel coding. > > > So I am wondering if python can do some kernel coding that > > used to be the private garden of C/C++. For example, can python > > intercept the input of keyboard on a system level? someone told me > > it's a kernel thing, isn't it? > > http://wiki.python.org/moin/elmer well, straightly speaking, how can I know a key is pressed on a system- level if using python? -- http://mail.python.org/mailman/listinfo/python-list
Re: can python do some kernel stuff?
On May 23, 5:53 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Jimmy schrieb: > > > On May 23, 3:05 pm, Andrew Lee <[EMAIL PROTECTED]> wrote: > >> Jimmy wrote: > >>> Hi to all > >>> python now has grown to a versatile language that can > >>> accomplish tasks for many different purposes. However, > >>> AFAIK, little is known about its ability of kernel coding. > >>> So I am wondering if python can do some kernel coding that > >>> used to be the private garden of C/C++. For example, can python > >>> intercept the input of keyboard on a system level? someone told me > >>> it's a kernel thing, isn't it? > >>http://wiki.python.org/moin/elmer > > > well, straightly speaking, how can I know a key is pressed on a system- > > level if > > using python? > > What has that todo with kernel programming? You can use e.g. pygame to > get keystrokes. Or under linux, read (if you are root) the keyboard > input file - I've done that to support several keyboards attached to a > machine. > > And the original question: no, python can't be used as kernel > programming language. Amongst other reasons, performance & the GIL > prevent that. > > Diez sorry, my aim is not limited to one particular program. Yes, many library can permit you to respond to keyboard event, however, what I want is a universal function. as long as a key is pressed, no matter where, my program can repond. I am quite strange with this topic. But according to my understanding, any event, keyboard event for example, once triggered, will be dilivered by keyboard driver to X system, and then any running program can either choose to respond or ignore. So my question can be translated to: how to make my program respond ? -- http://mail.python.org/mailman/listinfo/python-list
Re: can python do some kernel stuff?
On May 23, 11:14 pm, Jimmy <[EMAIL PROTECTED]> wrote: > On May 23, 5:53 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > > > > Jimmy schrieb: > > > > On May 23, 3:05 pm, Andrew Lee <[EMAIL PROTECTED]> wrote: > > >> Jimmy wrote: > > >>> Hi to all > > >>> python now has grown to a versatile language that can > > >>> accomplish tasks for many different purposes. However, > > >>> AFAIK, little is known about its ability of kernel coding. > > >>> So I am wondering if python can do some kernel coding that > > >>> used to be the private garden of C/C++. For example, can python > > >>> intercept the input of keyboard on a system level? someone told me > > >>> it's a kernel thing, isn't it? > > >>http://wiki.python.org/moin/elmer > > > > well, straightly speaking, how can I know a key is pressed on a system- > > > level if > > > using python? > > > What has that todo with kernel programming? You can use e.g. pygame to > > get keystrokes. Or under linux, read (if you are root) the keyboard > > input file - I've done that to support several keyboards attached to a > > machine. > > > And the original question: no, python can't be used as kernel > > programming language. Amongst other reasons, performance & the GIL > > prevent that. > > > Diez > > sorry, my aim is not limited to one particular program. Yes, many > library can > permit you to respond to keyboard event, however, what I want is a > universal > function. as long as a key is pressed, no matter where, my program can > repond. > > I am quite strange with this topic. But according to my understanding, > any event, keyboard event > for example, once triggered, will be dilivered by keyboard driver to X > system, and then > any running program can either choose to respond or ignore. So my > question can be translated to: > how to make my program respond ? maybe I'd better elaborate on my question. Back to my original question: intercept keyboard event on a system level. If you are writing program in emacs, of course, the keyboard inputs are meant for emacs only. What I want is no matter what program you're running, keyboard events can be anyway caught by my program. Am I clear with myself? :) -- http://mail.python.org/mailman/listinfo/python-list
Re: can python do some kernel stuff?
On May 24, 12:34 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Jimmy schrieb: > > > > > On May 23, 11:14 pm, Jimmy <[EMAIL PROTECTED]> wrote: > >> On May 23, 5:53 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > >>> Jimmy schrieb: > >>>> On May 23, 3:05 pm, Andrew Lee <[EMAIL PROTECTED]> wrote: > >>>>> Jimmy wrote: > >>>>>> Hi to all > >>>>>> python now has grown to a versatile language that can > >>>>>> accomplish tasks for many different purposes. However, > >>>>>> AFAIK, little is known about its ability of kernel coding. > >>>>>> So I am wondering if python can do some kernel coding that > >>>>>> used to be the private garden of C/C++. For example, can python > >>>>>> intercept the input of keyboard on a system level? someone told me > >>>>>> it's a kernel thing, isn't it? > >>>>>http://wiki.python.org/moin/elmer > >>>> well, straightly speaking, how can I know a key is pressed on a system- > >>>> level if > >>>> using python? > >>> What has that todo with kernel programming? You can use e.g. pygame to > >>> get keystrokes. Or under linux, read (if you are root) the keyboard > >>> input file - I've done that to support several keyboards attached to a > >>> machine. > >>> And the original question: no, python can't be used as kernel > >>> programming language. Amongst other reasons, performance & the GIL > >>> prevent that. > >>> Diez > >> sorry, my aim is not limited to one particular program. Yes, many > >> library can > >> permit you to respond to keyboard event, however, what I want is a > >> universal > >> function. as long as a key is pressed, no matter where, my program can > >> repond. > > >> I am quite strange with this topic. But according to my understanding, > >> any event, keyboard event > >> for example, once triggered, will be dilivered by keyboard driver to X > >> system, and then > >> any running program can either choose to respond or ignore. So my > >> question can be translated to: > >> how to make my program respond ? > > > maybe I'd better elaborate on my question. Back to my original > > question: > > intercept keyboard event on a system level. If you are writing program > > in > > emacs, of course, the keyboard inputs are meant for emacs only. What > > I > > want is no matter what program you're running, keyboard events can be > > anyway caught by my program. > > > Am I clear with myself? :) > > Do you want to intercept the call (prevent that it is passed through to > e.g. emacs), or are you merely interested in getting it? If the latter, > you can (as root) access the /dev/input keyboard device and get the > scan-codes. > > The former is more complicated - without research I don't know out of my > head how to accomplish that. But it must be possible, as e.g. KDE > observes global key-shortcuts. Most probably a X-server thing. > > Diez thanks, right now I am content with just knowing a key is pressed. as you said, I checked /etc/input/event1 which seems the input of keyboard. Then I got some extremely strange code. however, how can I just simply know a key is pressed? -- http://mail.python.org/mailman/listinfo/python-list
the scaling of pics in pygame
Hi, everyone I am using Pygame to write a small program. I tried to load a .jpg picture into the screen, however, the size of the pic doesn't fit into the window properly. Can anyone tell me how to scale the picture into the window? thanks! -- http://mail.python.org/mailman/listinfo/python-list
Problem with custom events in wxpython
hi, all I'm having a problem with creating custom events in wxpython. I have a class A handling some data processing work and another class B of GUI matter. I need GUI to display information when data in A is updated. I know cutom events in wxpython may work. But I found no material paricularly helpful :( can anyone write me some demo code to show how to do this or ant reference to materials? thanks -- http://mail.python.org/mailman/listinfo/python-list
Wrong reference
Add references to: "PresentationCore" and "PresentationFramework" for the System.Windows and System.Windows.Controls etc namespace. Ian Hobson wrote: Where is StackPanel in IronPython / .Net 4? 27-Jun-10 Hi All, According to this page http://msdn.microsoft.com/en-us/library/system.windows.controls.stackpanel.aspx StackPanel is in the System.Windows.Controls Namespace When I try and set up a reference to that Namespace I get a "Could not add reference to assembly System.Windows.Controls" error on the line that reads clr.AddReference('System.Windows.Controls') Can anyone shed light on what is going wrong? Many thanks Ian Previous Posts In This Thread: Submitted via EggHeadCafe - Software Developer Portal of Choice XAML Organizer http://www.eggheadcafe.com/tutorials/aspnet/ac373a5d-e497-4e07-9186-12166e83a024/xaml-organizer.aspx -- http://mail.python.org/mailman/listinfo/python-list
Correction
It should be "PresentationCore" and "PresentationFramework." For some reason, that first part got deleted in my reply. Jimmy Cao wrote: Wrong reference 27-Jun-10 Add references to: "PresentationCore" and "PresentationFramework" for the System.Windows and System.Windows.Controls etc namespace. Previous Posts In This Thread: Submitted via EggHeadCafe - Software Developer Portal of Choice Store ASP.NET Site Visitor Stats in MongoDb http://www.eggheadcafe.com/tutorials/aspnet/3a73c6de-82a1-4690-a7aa-d0eda58203f7/store-aspnet-site-visitor-stats-in-mongodb.aspx -- http://mail.python.org/mailman/listinfo/python-list
PresentationCore got deleted again
For some reason, "PresentationCore" doesn't show up... PresentationCore PresentationCore PresentationCore PresentationCore PresentationCore Jimmy Cao wrote: Wrong reference 27-Jun-10 Add references to: "PresentationCore" and "PresentationFramework" for the System.Windows and System.Windows.Controls etc namespace. Previous Posts In This Thread: Submitted via EggHeadCafe - Software Developer Portal of Choice Store ASP.NET Site Visitor Stats in MongoDb http://www.eggheadcafe.com/tutorials/aspnet/3a73c6de-82a1-4690-a7aa-d0eda58203f7/store-aspnet-site-visitor-stats-in-mongodb.aspx -- http://mail.python.org/mailman/listinfo/python-list
[ANN]VTD-XML 2.9
VTD-XML 2.9, the next generation XML Processing API for SOA and Cloud computing, has been released. Please visit https://sourceforge.net/projects/vtd-xml/files/ to download the latest version. * Strict Conformance # VTD-XML now fully conforms to XML namespace 1.0 spec * Performance Improvement # Significantly improved parsing performance for small XML files * Expand Core VTD-XML API # Adds getPrefixString(), and toNormalizedString2() * Cutting/Splitting # Adds getSiblingElementFragment() * A number of bug fixes and code enhancement including: # Fixes a bug for reading very large XML documents on some platforms # Fixes a bug in parsing processing instruction # Fixes a bug in outputAndReparse() -- http://mail.python.org/mailman/listinfo/python-list
mrjob v0.2.7 released
What is mrjob? - mrjob is a Python package that helps you write and run Hadoop Streaming jobs. mrjob fully supports Amazon's Elastic MapReduce (EMR) service, which allows you to buy time on a Hadoop cluster on an hourly basis. It also works with your own Hadoop cluster. Some important features: * Run jobs on EMR, your own Hadoop cluster, or locally (for testing). * Write multi-step jobs (one map-reduce step feeds into the next) * Duplicate your production environment inside Hadoop * Upload your source tree and put it in your job's $PYTHONPATH * Run make and other setup scripts * Set environment variables (e.g. $TZ) * Easily install python packages from tarballs (EMR only) * Setup handled transparently by mrjob.conf config file * Automatically interpret error logs from EMR * SSH tunnel to hadoop job tracker on EMR * Minimal setup * To run on EMR, set $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY * To run on your Hadoop cluster, install simplejson and make sure $HADOOP_HOME is set. More info: * Install mrjob: python setup.py install * Documentation: http://packages.python.org/mrjob/ * PyPI: http://pypi.python.org/pypi/mrjob * Development is hosted at github: http://github.com/Yelp/mrjob What's new? - Big thank you to Yelp intern Steve Johnson, who wrote the majority of the code for this release. Wahbeh Qardaji, another Yelp intern, contributed as well, and has been working hard on features for v0.3.0. v0.2.7, 2011-07-12 -- Hooray for interns! * All runner options can be set from the command line (Issue #121) * Including for mrjob.tools.emr.create_job_flow (Issue #142) * New EMR options: * availability_zone (Issue #72) * bootstrap_actions (Issue #69) * enable_emr_debugging (Issue #133) * Read counters from EMR log files (Issue #134) * Clean old files out of S3 with mrjob.tools.emr.s3_tmpwatch (Issue #9) * EMR parses and reports job failure due to steps timing out (Issue #15) * EMR boostrap files are no longer made public on S3 (Issue #70) * mrjob.tools.emr.terminate_idle_job_flows handles custom hadoop streaming jars correctly (Issue #116) * LocalMRJobRunner separates out counters by step (Issue #28) * bootstrap_python_packages works regardless of tarball name (Issue #49) * mrjob always creates temp buckets in the correct AWS region (Issue #64) * Catch abuse of __main__ in jobs (Issue #78) * Added mr_travelling_salesman example -- http://mail.python.org/mailman/listinfo/python-list
mrjob v0.2.4 released
What is mrjob? --- mrjob is a Python package that helps you write and run Hadoop Streaming jobs. mrjob fully supports Amazon's Elastic MapReduce (EMR) service, which allows you to buy time on a Hadoop cluster on an hourly basis. It also works with your own Hadoop cluster. Some important features: * Run jobs on EMR, your own Hadoop cluster, or locally (for testing). * Write multi-step jobs (one map-reduce step feeds into the next) * Duplicate your production environment inside Hadoop * Upload your source tree and put it in your job's $PYTHONPATH * Run make and other setup scripts * Set environment variables (e.g. $TZ) * Easily install python packages from tarballs (EMR only) * Setup handled transparently by mrjob.conf config file * Automatically interpret error logs from EMR * SSH tunnel to hadoop job tracker on EMR * Minimal setup * To run on EMR, set $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY * To run on your Hadoop cluster, install simplejson and make sure $HADOOP_HOME is set. More info: * Install mrjob: python setup.py install * Documentation: http://packages.python.org/mrjob/ * PyPI: http://pypi.python.org/pypi/mrjob * Development is hosted at github: http://github.com/Yelp/mrjob What's new? --- v0.2.4, 2011-03-09 -- fix bootstrapping mrjob * Fix bootstrapping of mrjob in hadoop and local mode (Issue #89) * SSH tunnels try to use the same port for the same job flow (Issue #67) * Added mr_postfix_bounce and mr_pegasos_svm to examples. * Retry on spurious 505s from EMR API -- http://mail.python.org/mailman/listinfo/python-list
mrjob v0.2.5 released
What is mrjob? --- mrjob is a Python package that helps you write and run Hadoop Streaming jobs. mrjob fully supports Amazon's Elastic MapReduce (EMR) service, which allows you to buy time on a Hadoop cluster on an hourly basis. It also works with your own Hadoop cluster. Some important features: * Run jobs on EMR, your own Hadoop cluster, or locally (for testing). * Write multi-step jobs (one map-reduce step feeds into the next) * Duplicate your production environment inside Hadoop * Upload your source tree and put it in your job's $PYTHONPATH * Run make and other setup scripts * Set environment variables (e.g. $TZ) * Easily install python packages from tarballs (EMR only) * Setup handled transparently by mrjob.conf config file * Automatically interpret error logs from EMR * SSH tunnel to hadoop job tracker on EMR * Minimal setup * To run on EMR, set $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY * To run on your Hadoop cluster, install simplejson and make sure $HADOOP_HOME is set. More info: * Install mrjob: python setup.py install * Documentation: http://packages.python.org/mrjob/ * PyPI: http://pypi.python.org/pypi/mrjob * Discussion: http://groups.google.com/group/mrjob * Development is hosted at github: http://github.com/Yelp/mrjob What's new? --- v0.2.5, 2011-04-29 -- Hadoop input and output formats * Added hadoop_input/output_format options * You can now specify a custom Hadoop streaming jar (hadoop_streaming_jar) * extra args to hadoop now come before -mapper/-reducer on EMR, so that e.g. -libjar will work (worked in hadoop mode since v0.2.2) * hadoop mode now supports s3n:// URIs (Issue #53) -- http://mail.python.org/mailman/listinfo/python-list
Subject: mrjob v0.2.6 released
What is mrjob? - mrjob is a Python package that helps you write and run Hadoop Streaming jobs. mrjob fully supports Amazon's Elastic MapReduce (EMR) service, which allows you to buy time on a Hadoop cluster on an hourly basis. It also works with your own Hadoop cluster. Some important features: * Run jobs on EMR, your own Hadoop cluster, or locally (for testing). * Write multi-step jobs (one map-reduce step feeds into the next) * Duplicate your production environment inside Hadoop * Upload your source tree and put it in your job's $PYTHONPATH * Run make and other setup scripts * Set environment variables (e.g. $TZ) * Easily install python packages from tarballs (EMR only) * Setup handled transparently by mrjob.conf config file * Automatically interpret error logs from EMR * SSH tunnel to hadoop job tracker on EMR * Minimal setup * To run on EMR, set $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY * To run on your Hadoop cluster, install simplejson and make sure $HADOOP_HOME is set. More info: * Install mrjob: python setup.py install * Documentation: http://packages.python.org/mrjob/ * PyPI: http://pypi.python.org/pypi/mrjob * Development is hosted at github: http://github.com/Yelp/mrjob What's new? - v0.2.6, 2011-05-24 -- fix bootstrapping mrjob * Set Hadoop to run on EMR with --hadoop-version (Issue #71). * Default is still 0.18, but will change to 0.20 in mrjob v0.3.0. * New inline runner, for testing locally with a debugger * New --strict-protocols option, to catch unencodable data (Issue #76) * Added steps_python_bin option (for use with virtualenv) * mrjob no longer chokes when asked to run on an EMR job flow running Hadoop 0.20 (Issue #110) * mrjob no longer chokes on job flows with no LogUri (Issue #112) -- http://mail.python.org/mailman/listinfo/python-list
Re: Unable to make ironpython run in browser with silverlight
You need to run it from a web-server; it doesn't work when running from file:// due to Silverlight's security sandbox. Read the comments on my blog-post, it mentions the web-server there. -- http://mail.python.org/mailman/listinfo/python-list
Distributing multiple packages with on setup.py
Hi, I've reorganized my Python project to be under a same name umbrella. My project can now be seen as multiple subsystems than can depend on each other. That means that every sub-package can now be distributed alone so that only required dependencies can be installed. The old structure: / ├─ myproj/ │ ├─ __init__.py │ ├─ mod1.py │ ├─ subpackage1/ │ └─ subpackage2/ └─ setup.py The new structure: / ├─ myproj/ │ ├─ common/ │ │ └─ mod1.py │ ├─ subpackage1/ │ ├─ subpackage2/ │ └─ __init__.py └─ setup.py As you can see not much has changed except that `myproj` is now a `namespace package <https://packaging.python.org/guides/packaging-namespace-packages/>`_ and that sub-packages ``common``, ``subpackage1`` and ``subpackage2`` can now be distributed independently. Is it possible, still keeping one unique ``setup.py`` file, to create 3 independent packages? * ``myproj.common`` * ``myproj.subpackage1`` * ``myproj.subpackage2`` Also I'd like to specify that when installing ``myproj.subpackage1``, ``myproj.common`` is required or that ``myproj.subpackage2`` will require both ``myproj.common`` and ``myproj.subpackage1``. Regards, Jimmy -- https://mail.python.org/mailman/listinfo/python-list
Re: Distributing multiple packages with on setup.py
> I do this with my stuff, but instead of keeping a common setup.py I have an > elaborate and clumsy system that rolls a package or module distro on the > fly, writing a setup.py file in the process. > > So each package/module I publish has a dict names "DISTINFO" in the top > level file, looking like this: > > DISTINFO = { > 'keywords': ["python2", "python3"], > 'classifiers': [ > "Programming Language :: Python", > "Programming Language :: Python :: 2", > "Programming Language :: Python :: 3", > ], > 'install_requires': [ > 'cs.app.flag', > 'cs.env', > 'cs.logutils', > 'cs.pfx', > 'cs.psutils', > ], > 'entry_points': { > 'console_scripts': [ > 'svcd = cs.app.svcd:main' > ], > }, > } I think I will head this direction. And with `setup.cfg <https://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files>`_, it is quite easy to keep the package's metadata in a standard way and feed this to setup(). Regards, Jimmy -- https://mail.python.org/mailman/listinfo/python-list
Re: Distributing multiple packages with on setup.py
I think I will head this direction. And with `setup.cfg <https://setuptools.readthedocs.io/en/latest/setuptools.html#configuring-setup-using-setup-cfg-files>`_, it is quite easy to keep the package's metadata in a standard way and feed this to setup(). Regards, Jimmy -- https://mail.python.org/mailman/listinfo/python-list
Re: more pythonic way
The first one is used very often. Less verbose Le 11 févr. 2019 à 20:41, à 20:41, Felix Lazaro Carbonell a écrit: > > >Hello to everyone: > >Could you please tell me wich way of writing this method is more >pythonic: > > > >.. > >def find_monthly_expenses(month=None, year=None): > >month = month or datetime.date.today() > >.. > > > >Or it should better be: > >... > >if not month: > >month = datetime.date.today() > >.. > > > >Cheers, > >Felix. > > > >-- >https://mail.python.org/mailman/listinfo/python-list -- https://mail.python.org/mailman/listinfo/python-list
about types.new_class and module
Hello, I'm looking for an explanation where live classes created by types.new_class() : py> import types py> types.new_class('A') types.A py> types.A AttributeError: module 'types' has no attribute 'A' py> _.__module__ 'types' The new class comes from `types` module without being inside. That's annoying to me for my use case : I'm trying to create dataclasses on the fly using make_dataclass (which uses types.new_class). For new created classes, I have a cache to not recreate twice the same class. But I want to be sure not to override an existing class somewhere in the namespace which is already 'types.MyNewclass'. but how to check it if it's not in types ? To be clear : make_dataclass('Bla', {}) should raise an error if something named 'types.Bla' already exists. I hope I'm clear enough. Jimmy -- https://mail.python.org/mailman/listinfo/python-list
Re: about types.new_class and module
Thank you for the clarification. I thought everything was bounded to anything. Shouldn't the name be changed from `types.A` to `unbound.A` to be less confusing ? Le 04/03/2019 à 20:31, MRAB a écrit : 'new_class' creates a new class with the given name and returns a reference to it. The class doesn't 'live' anywhere. Although you might /think/ that an object lives in a certain namespace, it's just that there's a name there that's bound to the object. You can, in fact, create 2 classes with the same name. >>> import types >>> t1 = types.new_class('A') >>> t2 = types.new_class('A') >>> t1 is t2 False -- https://mail.python.org/mailman/listinfo/python-list
RE: Py2Exe + kinterbasdb
[EMAIL PROTECTED] wrote: > I compile an application (that working good in native python) to exe > with py2exe. > In native mode (python.exe ReportApp.py) it is working, the reports are > created good. > But when I try to create a report from the compiled exe, it is show an > error: > > Traceback (most recent call last): > File "Report01.pyc", line 164, in OnButton1Button > File "report_01.pyc", line 12, in OpenDBForReport > File "report_db.pyc", line 11, in OpenDB > File "kinterbasdb\__init__.pyc", line 472, in connect > File "kinterbasdb\__init__.pyc", line 558, in __init__ > File "kinterbasdb\__init__.pyc", line 367, in _ensureInitialized > File "kinterbasdb\__init__.pyc", line 315, in init > ImportError: No module named typeconv_backcompat Try adding kinterbasdb to the py2exe packages options as shown below: setup( console=["Report01.py"], options={"py2exe": {"packages": ["kinterbasdb"]}} ) Jimmy -- http://mail.python.org/mailman/listinfo/python-list
py2exe has a new maintainer
I am taking over the maintenance and support of py2exe from Thomas Heller. As he announced a few weeks ago he is looking to focus on other things. py2exe has been very useful to me over the years and I look forward to keeping it every bit as useful in the future. I plan to make the transition as smooth as possible for users of py2exe. I don't plan to make changes to the license other than adding my name to the list of people not to sue. I will try to be as helpful as Thomas has been in supporting py2exe on the py2exe mailing list and comp.lang.python. The mailing list, the SourceForge project, and the Wiki will continue in their current locations. The web site is moving to http://www.py2exe.org and the old site will forward to the new one so any bookmarks should still work. I will be releasing version 0.6.3 very soon with a few changes Thomas and others have made over the last few weeks. After that my priorities for py2exe will be: - Support - Documentation (which should help familiarize me with the code) - Automated tests (to point out when I haven't familiarized myself enough) - Bug fixes Any help on any of these fronts will be greatly appreciated. After I feel comfortable with things, I hope to work with other projects in the Python packaging community (e.g., cx_Freeze, PyInstaller/McMillan, py2app, setuptools, etc.) to see if we can't find synergies that will make all of them better. I recognize that different packagers are better for different audiences because of licensing, platform, Python versions, and module support among other things. Working together on the common parts (identifying dependencies, customized handling of modules with unique needs, etc.) should make all of the packagers serve their niches better. I'd like to thank Thomas for the great work he's done with py2exe over the years. He's set a very high standard for me to try and maintain. Jimmy -- http://mail.python.org/mailman/listinfo/python-list
py2exe 0.6.3 released
py2exe 0.6.3 released = py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation. Console and Windows (GUI) applications, Windows NT services, exe and dll COM servers are supported. Changes in 0.6.3: * First release assembled by py2exe's new maintainer, Jimmy Retzlaff. Code changes in this release are from Thomas Heller and Gordon Scott. * The dll-excludes option is now available on the command line. It was only possible to specify that in the options argument to the setup function before. The dll-excludes option can now be used to filter out dlls like msvcr71.dll or even w9xpopen.exe. * Fix from Gordon Scott: py2exe crashed copying extension modules in packages. Changes in 0.6.2: * Several important bugfixes: - bundled extensions in packages did not work correctly, this made the wxPython single-file sample fail with newer wxPython versions. - occasionally dlls/pyds were loaded twice, with very strange effects. - the source distribution was not complete. - it is now possible to build a debug version of py2exe. Changes in 0.6.1: * py2exe can now bundle binary extensions and dlls into the library-archive or the executable itself. This allows to finally build real single-file executables. The bundled dlls and pyds are loaded at runtime by some special code that emulates the Windows LoadLibrary function - they are never unpacked to the file system. This part of the code is distributed under the MPL 1.1, so this license is now pulled in by py2exe. * By default py2exe now includes the codecs module and the encodings package. * Several other fixes. Homepage: <http://www.py2exe.org> Download from the usual location: <http://sourceforge.net/project/showfiles.php?group_id=15583> Enjoy, Jimmy -- http://mail.python.org/mailman/listinfo/python-list
RE: py2exe and pyGTK (was "Error")
danger wrote: > hi everybody, i have a problem with py2exe that gives me this error: > > ImportError: could not import pango > ImportError: could not import pango > Traceback (most recent call last): > File "acqua.py", line 40, in ? > File "gtk\__init__.pyc", line 113, in ? > AttributeError: 'module' object has no attribute 'Font' > > does anybody knows how to solve it? Does http://www.anti-particle.com/py2exe.shtml help? Jimmy -- http://mail.python.org/mailman/listinfo/python-list
RE: Open Folder in Desktop
Kamilche wrote: > Is there a command you can execute in Python that will open a window on > the desktop, such as 'My Documents'? Kind of like 'system', but for > folder names, not just programs. I'm running on Windows 2000. There are two issues here. The first is how to open a folder and the second is how to resolve "special" folders. Folders are "documents" typically associated with the explorer.exe application. To open a document with its default app (e.g., a folder), use os.startfile which is included in Python. For example: import os os.startfile(r'c:\windows') Folders like My Documents, My Pictures, etc. are special and you need to determine their actual path before you can open them. The pywin32 extensions (https://sourceforge.net/project/showfiles.php?group_id=78018) include a way to get at this: from win32com.shell import shellcon, shell path = shell.SHGetFolderPath(0, shellcon.CSIDL_MYPICTURES, 0, 0) os.startfile(path) Google for CSIDL to find the constants to use for other special folders. Jimmy -- http://mail.python.org/mailman/listinfo/python-list
RE: bad generator performance
Johannes Ahl-mann wrote: > i just wondered if there was a concise, clean way of doing this with > generators which i had overlooked, or whether there was some blatant > mistake in my code. Aside from the recursion question... You don't really give the complete story so it's hard to tell what exactly is going on. For example, I would assume the recursion is calling the same method (i.e., depthFirstIterator1 or depthFirstIterator2), but then you posted separate timing information for a "recursive helper function" so I'm not so sure. Also there is not much of a hint as to the nature of your data. Below is a test where each of your 2 methods calls itself recursively. To make it work I had to build a data tree - I used the files and folders in my C:\Python23 directory. In my testing (on Python 2.3.4 on Windows XP), the generator version takes about 1/4 of the time that the list version takes. If both versions call the list version of the method recursively (i.e., you're only getting the benefit of the generator at the top level of the recursion), the generator version is still about 20% faster. Timing differences could potentially depend on your data also - things like how deep vs. wide your tree is. Jimmy import os import time class Node: def __init__(self, pathname): self.thisIsAFolder = os.path.isdir(pathname) self.children = [] if self.isFolder(): for filename in os.listdir(pathname): childpathname = os.path.join(pathname, filename) self.children.append(Node(childpathname)) def isFolder(self): return self.thisIsAFolder def depthFirstIterator1(self, depth = 0): ret = [[self, True, depth]] if self.isFolder(): for c in self.children: ret = ret + c.depthFirstIterator1(depth = depth + 1) return ret + [[self, False, depth]] def depthFirstIterator2(self, depth = 0): yield [self, True, depth] if self.isFolder(): for c in self.children: for y in c.depthFirstIterator2(depth = depth + 1): yield y yield [self, False, depth] x = Node(r'C:\Python23') for iterator in (x.depthFirstIterator1, x.depthFirstIterator2): print iterator.__name__, start = time.time() for item in iterator(): pass print round(time.time()-start, 2) -- http://mail.python.org/mailman/listinfo/python-list
RE: string methods (warning, newbie)
Anthonyberet wrote: > Is there a string mething to return only the alpha characters of a string? > eg 'The Beatles - help - 03 - Ticket to ride', would be > 'TheBeatlesTickettoride' > > If not then how best to approach this? > I have some complicated plan to cut the string into individual > characters and then concatenate a new string with the ones that return > true with the .isalpha string method. > > Is there an easier way? The approach you are considering may be easier than you think: >>> filter(str.isalpha, 'The Beatles - help - 03 - Ticket to ride') 'TheBeatleshelpTickettoride' Jimmy -- http://mail.python.org/mailman/listinfo/python-list
RE: Audio interviews of Guido or other Python advocates?
Dave Benjamin wrote: > I looked around for recordings of Guido, but couldn't find any. Does > anyone know of any streamable audio (or video) interviews or speeches > featuring Guido, the bots, or any other interesting people in the Python > community? There's a video with a few folks in it at: http://www.ibiblio.org/obp/pyBiblio/pythonvideo.php Jimmy -- http://mail.python.org/mailman/listinfo/python-list
RE: feature suggestion
flexibal wrote: ... > as we all know, just doing > v = 5 > declares a new variable named 'v'... but we are people, and we do make > typos... and it's very disturbing to find your program crashing after > two weeks of operation, over a NameError... because a certain branch in > your code, that was previously never taken, had finally been taken. ... PyChecker (http://pychecker.sourceforge.net/) will help you spot this kind of thing. For example consider typo.py: def f(): x = 1 y = 1 if 0 == 1: print a else: print x+y When you run PyChecker on typo.py it will issue the following warning: typo.py:5: No global (a) found Jimmy -- http://mail.python.org/mailman/listinfo/python-list
RE: Python 2.4 killing commercial Windows Python development ?
. Again look at the pain of shared JVM use. I think Microsoft is on the right track to addressing DLL hell now by recommending that DLLs be installed in the application folder, not the system folder. That's analogous to using application specific JVMs and things like py2exe or cx_freeze for Python. > To make installation easier, maybe someone could write a > small .exe that could be frozen with scripts or run with installers and > that would detect the presence/absence of the needed Python version and > offer an auto download and install if needed. My users only get access to "approved" sites (nothing else shows up in their DNS). It's hard enough to get my own domain added to the ordained list, much less a long list like python.org, sourceforge.net, effbot.org, etc. All this isn't just for my clients. I have a number of automated processes that I run on my server that are written in Python. When I need a new version of some module for one of those processes, I don't want to spend the time testing it with each of the others to make sure it didn't break anything. So I build single file executables from my Python scripts so they are completely self-contained. When I want to modify a module, then I can test/correct the impact of any new modules at that point since I'll be in the code anyway. Before I started doing this, the version of Python and the various extension modules in use on my server was a couple of years older than the version on my development machine because I almost never upgraded for fear of breaking several processes. Hard drive space is cheap and building exes is easy and I like the benefits. Jimmy p.s. - on the original topic of this thread - I also buy development tools from Microsoft that ensure I have the right to distribute the needed DLLs so it's not a concern in my case. -- http://mail.python.org/mailman/listinfo/python-list
RE: py2exe - create one EXE
Codecraig wrote: > i tried the SingleInstaller linkwhich points to a > script using NSIS. I followed those instructions which generated an > .exe. HOwever, when i run the .exe nothing happens (meaning no > process starts, no output, no errors, nothing). > > any ideas on that? have ever used it? There are a couple of things you can try. First off, if you are using Python 2.4, then you may be missing msvcr71.dll and/or msvcp71.dll on the system you are trying to run on (the corresponding file(s) for Python 2.3 and earlier are extremely common so you aren't nearly as likely to run into this problem). Look for the line that looks like this in the NSIS script: File /r '${py2exe. And add this line just after it (assuming you installed Python in the default location): File 'C:\Python24\msvc*.*' If you intend to distribute your result, then you can Google this group for discussions about msvcr71.dll and license requirements for redistribution - you won't find a definitive answer to the questions you'll see, but you should be aware of the issues. If that doesn't solve your problem, the next step to debugging it is to try running the multi-file version produced by setup.py. If that doesn't work, some common problems/workarounds can be found on the py2exe wiki. Obviously the single file version won't work until the multi file version works. Chris Liechti has another solution, but the last time I checked it was only for Python 2.3. It's on his page at: http://homepage.hispeed.ch/py430/python/ Jimmy -- http://mail.python.org/mailman/listinfo/python-list
RE: MessageBox ONOK?
Ali wrote: > How do i connect the onOK of a win32ui MessageBox with the Ok button so > that I get to know when the user clicks the Ok button? win32ui.MessageBox returns the ID of the button that was clicked to dismiss the message box. There are constants in win32con you can use to compare to that ID. An example: >>> import win32con >>> import win32ui >>> buttonID = win32ui.MessageBox('Hello World') >>> if buttonID == win32con.IDOK: ... print 'OK pressed' ... else: ... print 'OK not pressed' ... OK pressed I clicked OK when the dialog appeared. There are also constants for IDCANCEL, IDYES, IDNO, etc. which can be useful if you are using other buttons (e.g., win32ui.MessageBox('Do it?', None, win32con.MB_YESNO)). Jimmy -- http://mail.python.org/mailman/listinfo/python-list
mrjob v0.3.0 released
What is mrjob? --- mrjob is a Python package that helps you write and run Hadoop Streaming jobs. mrjob fully supports Amazon's Elastic MapReduce (EMR) service, which allows you to buy time on a Hadoop cluster on an hourly basis. It also works with your own Hadoop cluster. Some important features: * Run jobs on EMR, your own Hadoop cluster, or locally (for testing). * Write multi-step jobs (one map-reduce step feeds into the next) * Duplicate your production environment inside Hadoop * Upload your source tree and put it in your job's $PYTHONPATH * Run make and other setup scripts * Set environment variables (e.g. $TZ) * Easily install python packages from tarballs (EMR only) * Setup handled transparently by mrjob.conf config file * Automatically interpret error logs from EMR * SSH tunnel to hadoop job tracker on EMR * Minimal setup * To run on EMR, set $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY * To run on your Hadoop cluster, install simplejson and make sure $HADOOP_HOME is set. More info: * Install mrjob: pip install mrjob -OR- easy_install mrjob * Documentation: http://packages.python.org/mrjob/ * PyPI: http://pypi.python.org/pypi/mrjob * Mailing list: http://groups.google.com/group/mrjob * Development is hosted at github: http://github.com/Yelp/mrjob What's new? mrjob v0.3.0 is a major new release. Full details are at http://packages.python.org/mrjob/whats-new.html - here are a few highlights: v0.3.0, 2011-12-07 * Combiners * *_init() and *_final() for mappers, reducers, and combiners * Custom option parsers * Job flow pooling on EMR (saves time and money!) * SSH log fetching * New EMR diagnostic tools A big thanks to the contributors to this release: Steve Johnson, Dave Marin, Wahbeh Qardaji, Derek Wilson, Jordan Andersen, and Benjamin Goldenberg! -- http://mail.python.org/mailman/listinfo/python-list
py2exe 0.6.6 released
py2exe 0.6.6 released = py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation. Console and Windows (GUI) applications, Windows NT services, exe and dll COM servers are supported. Changes in 0.6.6: * Better support for Python 2.5. * Experimental support for 64-bit builds of Python on win64. * Better ISAPI support. * New samples for ISAPI and COM servers. * Support for new "command-line styles" when building Windows services. Changes in 0.6.5: * Fixed modulefinder / mf related bugs introduced in 0.6.4. This will be most evident when working with things like win32com.shell and xml.xpath. * Files no longer keep read-only attributes when they are copied as this was causing problems with the copying of some MS DLLs. Changes in 0.6.4: * New skip-archive option which copies the Python bytecode files directly into the dist directory and subdirectories - no archive is used. * An experimental new custom-boot-script option which allows a boot script to be specified (e.g., --custom-boot-script=cbs.py) which can do things like installing a customized stdout blackhole. See py2exe's boot_common.py for examples of what can be done. The custom boot script is executed during startup of the executable immediately after boot_common.py is executed. * Thomas Heller's performance improvements for finding needed modules. * Mark Hammond's fix for thread-state errors when a py2exe created executable tries to use a py2exe created COM DLL. Changes in 0.6.3: * First release assembled by py2exe's new maintainer, Jimmy Retzlaff. Code changes in this release are from Thomas Heller and Gordon Scott. * The dll-excludes option is now available on the command line. It was only possible to specify that in the options argument to the setup function before. The dll-excludes option can now be used to filter out dlls like msvcr71.dll or even w9xpopen.exe. * Fix from Gordon Scott: py2exe crashed copying extension modules in packages. Changes in 0.6.2: * Several important bugfixes: - bundled extensions in packages did not work correctly, this made the wxPython single-file sample fail with newer wxPython versions. - occasionally dlls/pyds were loaded twice, with very strange effects. - the source distribution was not complete. - it is now possible to build a debug version of py2exe. Changes in 0.6.1: * py2exe can now bundle binary extensions and dlls into the library-archive or the executable itself. This allows to finally build real single-file executables. The bundled dlls and pyds are loaded at runtime by some special code that emulates the Windows LoadLibrary function - they are never unpacked to the file system. This part of the code is distributed under the MPL 1.1, so this license is now pulled in by py2exe. * By default py2exe now includes the codecs module and the encodings package. * Several other fixes. Homepage: <http://www.py2exe.org> Download from the usual location: <http://sourceforge.net/project/showfiles.php?group_id=15583> Enjoy, Jimmy -- http://mail.python.org/mailman/listinfo/python-list
py2exe 0.6.4 released
py2exe 0.6.4 released = py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation. Console and Windows (GUI) applications, Windows NT services, exe and dll COM servers are supported. Changes in 0.6.4: * New skip-archive option which copies the Python bytecode files directly into the dist directory and subdirectories - no archive is used. * An experimental new custom-boot-script option which allows a boot script to be specified (e.g., --custom-boot-script=cbs.py) which can do things like installing a customized stdout blackhole. See py2exe's boot_common.py for examples of what can be done. The custom boot script is executed during startup of the executable immediately after boot_common.py is executed. * Thomas Heller's performance improvements for finding needed modules. * Mark Hammond's fix for thread-state errors when a py2exe created executable tries to use a py2exe created COM DLL. Changes in 0.6.3: * First release assembled by py2exe's new maintainer, Jimmy Retzlaff. Code changes in this release are from Thomas Heller and Gordon Scott. * The dll-excludes option is now available on the command line. It was only possible to specify that in the options argument to the setup function before. The dll-excludes option can now be used to filter out dlls like msvcr71.dll or even w9xpopen.exe. * Fix from Gordon Scott: py2exe crashed copying extension modules in packages. Changes in 0.6.2: * Several important bugfixes: - bundled extensions in packages did not work correctly, this made the wxPython single-file sample fail with newer wxPython versions. - occasionally dlls/pyds were loaded twice, with very strange effects. - the source distribution was not complete. - it is now possible to build a debug version of py2exe. Changes in 0.6.1: * py2exe can now bundle binary extensions and dlls into the library-archive or the executable itself. This allows to finally build real single-file executables. The bundled dlls and pyds are loaded at runtime by some special code that emulates the Windows LoadLibrary function - they are never unpacked to the file system. This part of the code is distributed under the MPL 1.1, so this license is now pulled in by py2exe. * By default py2exe now includes the codecs module and the encodings package. * Several other fixes. Homepage: <http://www.py2exe.org> Download from the usual location: <http://sourceforge.net/project/showfiles.php?group_id=15583> Enjoy, Jimmy -- http://mail.python.org/mailman/listinfo/python-list
Going past the float size limits?
Hello all It would be great if I could make a number that can go beyond current size limitations. Is there any sort of external library that can have infinitely huge numbers? Way way way way beyond say 5x10^350 or whatever it is? I'm hitting that "inf" boundary rather fast and I can't seem to work around it. Thanks! -- http://mail.python.org/mailman/listinfo/python-list
Re: Going past the float size limits?
On Oct 26, 6:56 pm, "Chris Mellon" <[EMAIL PROTECTED]> wrote: > On 10/26/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > Hello all > > It would be great if I could make a number that can go beyond current > > size limitations. Is there any sort of external library that can have > > infinitely huge numbers? Way way way way beyond say 5x10^350 or > > whatever it is? > > > I'm hitting that "inf" boundary rather fast and I can't seem to work > > around it. > > What in the world are you trying to count? The calculation looks like this A = 0.35 T = 0.30 C = 0.25 G = 0.10 and then I basically continually multiply those numbers together. I need to do it like 200,000+ times but that's nuts. I can't even do it 1000 times or the number rounds off to 0.0. I tried taking the inverse of these numbers as I go but then it just shoots up to "inf". -- http://mail.python.org/mailman/listinfo/python-list
Re: Going past the float size limits?
On Oct 26, 8:03 pm, Stéphane Larouche <[EMAIL PROTECTED]> wrote: > gmail.com> writes: > > > The calculation looks like this > > > A = 0.35 > > T = 0.30 > > C = 0.25 > > G = 0.10 > > > and then I basically continually multiply those numbers together. I > > need to do it like 200,000+ times but that's nuts. I can't even do it > > 1000 times or the number rounds off to 0.0. I tried taking the inverse > > of these numbers as I go but then it just shoots up to "inf". > > I suggest you add the logarithm of those numbers. > > Stéphane Well I'd add the logarithms if it was me that made the algorithm. I don't think I understand it all that well. My professor wrote it out and I don't want to veer away and add the logs of the values because I don't know if that's the same thing or not. -- http://mail.python.org/mailman/listinfo/python-list
ANN: EasyDialogs for Windows version 46691.0
EasyDialogs for Windows is available at: http://www.averdevelopment.com/python/ EasyDialogs for Windows is a ctypes based emulation of the EasyDialogs module included in the Python distribution for Mac. It attempts to be as compatible as possible. Code using the Mac EasyDialogs module can often be run unchanged on Windows using this module. The module has been tested on Python 2.3 running on Windows NT, 98, XP, and 2003. EasyDialogs is written in pure Python using Thomas Heller's ctypes module to call Windows APIs directly. No Python GUI toolkit is used. This means that relatively small distributions can be made with py2exe (or its equivalents). A simple test of all the dialogs in EasyDialogs bundled up using py2exe results in a distribution that is about 1.25MB. Using py2exe in concert with NSIS as shown here allows the same test to run as a single file executable that is just under 500KB. Requires: Microsoft Windows, Python 2.3 or higher, and ctypes 0.6.3 or higher (ctypes is included with Python 2.5 and higher, so it is not a separate requirement there). License: MIT Change history: Version 46691.0 - Fixed a bug that caused warnings with newer version of ctypes (including the version included in Python 2.5) - The edit box in AskString now scrolls horizontally if the entered text does not otherwise fit - AskFileForOpen(multiple=True) will allow multiple files to be selected and a list of strings will be returned. If multiple is False (the default if not specified) then only a single file can be selected and a string is returned. This no longer seems to work on the Mac, but it's useful enough to add it to the Windows version anyway. This change is based on a patch contributed by Waldemar Osuch. - Made minor changes to bring inline with SVN revision 46691 for Mac Version 1.16.0 - Removed resource DLL, resources are now in a Python source file which simplifies distribution of apps with py2exe - Spelling corrections - File open/save dialogs did not display on Windows 98 - AskString edit boxes were too short on Windows 98 - Improved display of drop down lists on Windows 98 and NT - Made minor changes to bring inline with CVS version 1.16 for Mac Version 1.14.0 - Initial public release Jimmy -- http://mail.python.org/mailman/listinfo/python-list
Latest XML Parsing/Memory benchmark
The latest benchmark results are now available using the latest Intel Core2 Duo processor. In summary, VTD-XML using JDK 1.6's server JVM achieved an astonishing 120MB/sec sustained throughput per core on a Core2 Duo 2.5 GHz processor. * Parsing Only: http://www.ximpleware.com/2.3/benchmark_2.3_parsing_only.html * XPath Only: http://www.ximpleware.com/2.3/benchmark_2.3_xpath.html * Parsing/XPath/Update: http://www.ximpleware.com/2.3/benchmark_2.3_update.html * Indexing/XPath/Update: http://www.ximpleware.com/2.3/benchmark_2.3_indexing.html -- http://mail.python.org/mailman/listinfo/python-list
py2exe 0.6.9 released
py2exe 0.6.9 released = py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation. Console and Windows (GUI) applications, Windows NT services, exe and dll COM servers are supported. Changes in 0.6.9: * Binaries for Python 2.6 and Python 2.7. * Fixed a modulefinder crash on certain relative imports. * Changed the py2exe\samples\singlefile\gui\test_wx.py sample to use the wx package instead of the old wxPython package. * Copy the manifest, if any, from the 'template' into the targets to ensure embedded assembly references, as required for python 2.6 based apps, are copied. * Allow each target to specify Vista User Access Control flags. For example, specifying 'uac_execution_info="requireAdministrator"' would force elevation for the final executable. Changes in 0.6.8: * Support for relative imports. * Fix MemoryLoadLibrary to handle loading function addresses by ordinal numbers. Patch and test by Matthias Miller. * Using the options compressed=1, bundle_files=3, and zipfile=None at the same time now works; patch from Alexey Borzenkov. * Allow renaming of single-executable files; patch from Alexey Borzenkov. * Embedding icon resources into the image now works correctly even for ico files containing multiple images. * pyd files from different packages with the same filename no longer conflict. Patch from Grant Edwards. * There are new samples for the 'typelibs' support, including the new option of pre-generating a typelib and specifying the file as an input to py2exe. * The test suite is now included in the source distribution. Changes in 0.6.6: * Better support for Python 2.5. * Experimental support for 64-bit builds of Python on win64. * Better ISAPI support. * New samples for ISAPI and COM servers. * Support for new "command-line styles" when building Windows services. Changes in 0.6.5: * Fixed modulefinder / mf related bugs introduced in 0.6.4. This will be most evident when working with things like win32com.shell and xml.xpath. * Files no longer keep read-only attributes when they are copied as this was causing problems with the copying of some MS DLLs. Changes in 0.6.4: * New skip-archive option which copies the Python bytecode files directly into the dist directory and subdirectories - no archive is used. * An experimental new custom-boot-script option which allows a boot script to be specified (e.g., --custom-boot-script=cbs.py) which can do things like installing a customized stdout blackhole. See py2exe's boot_common.py for examples of what can be done. The custom boot script is executed during startup of the executable immediately after boot_common.py is executed. * Thomas Heller's performance improvements for finding needed modules. * Mark Hammond's fix for thread-state errors when a py2exe created executable tries to use a py2exe created COM DLL. Changes in 0.6.3: * First release assembled by py2exe's new maintainer, Jimmy Retzlaff. Code changes in this release are from Thomas Heller and Gordon Scott. * The dll-excludes option is now available on the command line. It was only possible to specify that in the options argument to the setup function before. The dll-excludes option can now be used to filter out dlls like msvcr71.dll or even w9xpopen.exe. * Fix from Gordon Scott: py2exe crashed copying extension modules in packages. Changes in 0.6.2: * Several important bugfixes: - bundled extensions in packages did not work correctly, this made the wxPython single-file sample fail with newer wxPython versions. - occasionally dlls/pyds were loaded twice, with very strange effects. - the source distribution was not complete. - it is now possible to build a debug version of py2exe. Changes in 0.6.1: * py2exe can now bundle binary extensions and dlls into the library-archive or the executable itself. This allows to finally build real single-file executables. The bundled dlls and pyds are loaded at runtime by some special code that emulates the Windows LoadLibrary function - they are never unpacked to the file system. This part of the code is distributed under the MPL 1.1, so this license is now pulled in by py2exe. * By default py2exe now includes the codecs module and the encodings package. * Several other fixes. Homepage: <http://www.py2exe.org> Download from the usual location: <http://sourceforge.net/project/showfiles.php?group_id=15583> Enjoy, Jimmy -- http://mail.python.org/mailman/listinfo/python-list
py2exe 0.6.8 released
py2exe 0.6.8 released = py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation. Console and Windows (GUI) applications, Windows NT services, exe and dll COM servers are supported. Changes in 0.6.8: * Support for relative imports. * Fix MemoryLoadLibrary to handle loading function addresses by ordinal numbers. Patch and test by Matthias Miller. * Using the options compressed=1, bundle_files=3, and zipfile=None at the same time now works; patch from Alexey Borzenkov. * Allow renaming of single-executable files; patch from Alexey Borzenkov. * Embedding icon resources into the image now works correctly even for ico files containing multiple images. * pyd files from different packages with the same filename no longer conflict. Patch from Grant Edwards. * There are new samples for the 'typelibs' support, including the new option of pre-generating a typelib and specifying the file as an input to py2exe. * The test suite is now included in the source distribution. Changes in 0.6.6: * Better support for Python 2.5. * Experimental support for 64-bit builds of Python on win64. * Better ISAPI support. * New samples for ISAPI and COM servers. * Support for new "command-line styles" when building Windows services. Changes in 0.6.5: * Fixed modulefinder / mf related bugs introduced in 0.6.4. This will be most evident when working with things like win32com.shell and xml.xpath. * Files no longer keep read-only attributes when they are copied as this was causing problems with the copying of some MS DLLs. Changes in 0.6.4: * New skip-archive option which copies the Python bytecode files directly into the dist directory and subdirectories - no archive is used. * An experimental new custom-boot-script option which allows a boot script to be specified (e.g., --custom-boot-script=cbs.py) which can do things like installing a customized stdout blackhole. See py2exe's boot_common.py for examples of what can be done. The custom boot script is executed during startup of the executable immediately after boot_common.py is executed. * Thomas Heller's performance improvements for finding needed modules. * Mark Hammond's fix for thread-state errors when a py2exe created executable tries to use a py2exe created COM DLL. Changes in 0.6.3: * First release assembled by py2exe's new maintainer, Jimmy Retzlaff. Code changes in this release are from Thomas Heller and Gordon Scott. * The dll-excludes option is now available on the command line. It was only possible to specify that in the options argument to the setup function before. The dll-excludes option can now be used to filter out dlls like msvcr71.dll or even w9xpopen.exe. * Fix from Gordon Scott: py2exe crashed copying extension modules in packages. Changes in 0.6.2: * Several important bugfixes: - bundled extensions in packages did not work correctly, this made the wxPython single-file sample fail with newer wxPython versions. - occasionally dlls/pyds were loaded twice, with very strange effects. - the source distribution was not complete. - it is now possible to build a debug version of py2exe. Changes in 0.6.1: * py2exe can now bundle binary extensions and dlls into the library-archive or the executable itself. This allows to finally build real single-file executables. The bundled dlls and pyds are loaded at runtime by some special code that emulates the Windows LoadLibrary function - they are never unpacked to the file system. This part of the code is distributed under the MPL 1.1, so this license is now pulled in by py2exe. * By default py2exe now includes the codecs module and the encodings package. * Several other fixes. Homepage: <http://www.py2exe.org> Download from the usual location: <http://sourceforge.net/project/showfiles.php?group_id=15583> Enjoy, Jimmy -- http://mail.python.org/mailman/listinfo/python-list
py2exe 0.6.5 released
py2exe 0.6.5 released = py2exe is a Python distutils extension which converts Python scripts into executable Windows programs, able to run without requiring a Python installation. Console and Windows (GUI) applications, Windows NT services, exe and dll COM servers are supported. Changes in 0.6.5: * Fixed modulefinder / mf related bugs introduced in 0.6.4. This will be most evident when working with things like win32com.shell and xml.xpath. * Files no longer keep read-only attributes when they are copied as this was causing problems with the copying of some MS DLLs. Changes in 0.6.4: * New skip-archive option which copies the Python bytecode files directly into the dist directory and subdirectories - no archive is used. * An experimental new custom-boot-script option which allows a boot script to be specified (e.g., --custom-boot-script=cbs.py) which can do things like installing a customized stdout blackhole. See py2exe's boot_common.py for examples of what can be done. The custom boot script is executed during startup of the executable immediately after boot_common.py is executed. * Thomas Heller's performance improvements for finding needed modules. * Mark Hammond's fix for thread-state errors when a py2exe created executable tries to use a py2exe created COM DLL. Changes in 0.6.3: * First release assembled by py2exe's new maintainer, Jimmy Retzlaff. Code changes in this release are from Thomas Heller and Gordon Scott. * The dll-excludes option is now available on the command line. It was only possible to specify that in the options argument to the setup function before. The dll-excludes option can now be used to filter out dlls like msvcr71.dll or even w9xpopen.exe. * Fix from Gordon Scott: py2exe crashed copying extension modules in packages. Changes in 0.6.2: * Several important bugfixes: - bundled extensions in packages did not work correctly, this made the wxPython single-file sample fail with newer wxPython versions. - occasionally dlls/pyds were loaded twice, with very strange effects. - the source distribution was not complete. - it is now possible to build a debug version of py2exe. Changes in 0.6.1: * py2exe can now bundle binary extensions and dlls into the library-archive or the executable itself. This allows to finally build real single-file executables. The bundled dlls and pyds are loaded at runtime by some special code that emulates the Windows LoadLibrary function - they are never unpacked to the file system. This part of the code is distributed under the MPL 1.1, so this license is now pulled in by py2exe. * By default py2exe now includes the codecs module and the encodings package. * Several other fixes. Homepage: <http://www.py2exe.org> Download from the usual location: <http://sourceforge.net/project/showfiles.php?group_id=15583> Enjoy, Jimmy -- http://mail.python.org/mailman/listinfo/python-list
Best practise for dual stack programming in python
Hello, The organisation that I currently work for has a large number of 'legacy' tools and scripts which rely entirely on IPv4. Many of them have been written and not documented etc. The organisation is in the process of moving to a dual stack environment over the next 3 months. With that in mind many of our scripts need to be rewritten and documented. I have been looking at moving from a mix of languages over to a standard which at this point is looking like it will be Python (because I am most familiar with it). I have never done any dual stack coding so I am interested to know if there are any good resources for developing dual stack python code? I have had a look around and have found very little on the python web page which makes me worry. Does anyone have any recommendations on web pages to read or books to look at? Any additional advice would be really appreciated. Regards, Jimmy Stewpot. -- http://mail.python.org/mailman/listinfo/python-list
Re: [Py2exe-users] how to build same executabl with and without console output
On Fri, Jul 30, 2010 at 1:10 AM, Gelonida wrote: > What I'd like to achieve ideally is to create a py2exe program, > which > will only display a window (so 'compiled' as 'windows'-application) if > called normally. > > however if being called with the option --debug it should display the > graphical window plus a debug console where I can print to. > > Is there any trick in adding a console window to an application, > that was built as 'windows' application? > > If above is not possible: > > Is there any way to compile the same python script (myprog.py) from one > py2exe script into once a 'windows' executable (myprog.exe) and once > into a 'console' executable (myprog_debug.exe)? I can't think of an easy way to achieve the first approach - I've always taken the second approach. The advanced example included with py2exe has an example of how to do this. Look at all the occurrences of test_wx in the following link to see all the pieces involved: http://py2exe.svn.sourceforge.net/viewvc/py2exe/trunk/py2exe/py2exe/samples/advanced/setup.py?view=markup This uses an alternate form of the "windows" and "console" arguments where each target is an object with specially named member variables rather than a string that names the .py file (this string is one of the member variables). This is necessary so you can give different names to the console version and the windows version. Jimmy -- http://mail.python.org/mailman/listinfo/python-list
downloading python 3.6.0 with pygame
please i need tour help,how can i download python 3.6.0 together with pygame? -- https://mail.python.org/mailman/listinfo/python-list
test
please ignore -- http://mail.python.org/mailman/listinfo/python-list
Crypto Suggestion/Help
Hi all, I need some advise on doing the following. I have a Linux application that allows users to access it via a code (password). At the end of the day, I gather a log of activities of the users and zip the file and would like to encrypt it so that the users can not access it or tamper with it. Only manager should. If I use a private/public key for doing so I have to store the private key on my computer. What is a good way to encrypt a file and have the key well hidden on the same computer? If you have any other way to do, like MD5 or similar, please let me know. Thanks, Jimmy -- http://mail.python.org/mailman/listinfo/python-list
Re: Crypto Suggestion/Help
Paul, Thanks for the reply. Yes the shop has only one machine and many users use it to perform transactions. Maybe a basic Linux/Unix permissions will do as Thomas Kruger suggested in the thread following you. --Jimmy Paul Rubin wrote: > Jimmy E Touma <[EMAIL PROTECTED]> writes: >> I need some advise on doing the following. I have a Linux application >> that allows users to access it via a code (password). At the end of the >> day, I gather a log of activities of the users and zip the file and >> would like to encrypt it so that the users can not access it or tamper >> with it. Only manager should. If I use a private/public key for doing so >> I have to store the private key on my computer. What is a good way to >> encrypt a file and have the key well hidden on the same computer? If you >> have any other way to do, like MD5 or similar, please let me know. > > Are you saying you have a desktop app that's running on the user's own > machine and you're trying to prevent the user from getting at the log > data? That is impossible if the user has control over the machine and > is willing and able to hack the software. If you just want to make an > encrypted file that the user can't decrypt, use a public key on the > user's machine, and only have the secret key on the manager's machine. -- http://mail.python.org/mailman/listinfo/python-list