From jon+python-uk at unequivocal.co.uk Thu Apr 1 03:39:01 2010 From: jon+python-uk at unequivocal.co.uk (Jon Ribbens) Date: Thu, 1 Apr 2010 02:39:01 +0100 Subject: [python-uk] easy_install pip won't work, am concerned Ministry of Packaging may chase after me. In-Reply-To: <616544d41003301414mb6e54f7ldf1199d7ddc123d5@mail.gmail.com> References: <73d18a591003301312m4a68885cq32d5ef258fff451f@mail.gmail.com> <616544d41003301319i72d15c08pd6656149981a4923@mail.gmail.com> <73d18a591003301338x154d1c24ga426eea2d5a6810c@mail.gmail.com> <616544d41003301414mb6e54f7ldf1199d7ddc123d5@mail.gmail.com> Message-ID: <20100401013901.GP19240@snowy.squish.net> On Tue, Mar 30, 2010 at 10:14:50PM +0100, Ed Stafford wrote: > Mike, > > Glad it worked for you. Although the Ubuntu team does a fine job of > package management I'm still a bit hesitant to use their python packages. > It's easy enough using vanilla python to get everything you need going. In > the future you can do the following just as easily. > > `wget [1]http://peak.telecommunity.com/dist/ez_setup.py` > `sudo python ez_setup.py` > `sudo easy_install pip virtualenv virtualenvwrapper` I strongly advise not using easy_install, it's awful. From funthyme at gmail.com Thu Apr 1 11:51:31 2010 From: funthyme at gmail.com (John Pinner) Date: Thu, 1 Apr 2010 10:51:31 +0100 Subject: [python-uk] easy_install pip won't work, am concerned Ministry of Packaging may chase after me. In-Reply-To: <20100401013901.GP19240@snowy.squish.net> References: <73d18a591003301312m4a68885cq32d5ef258fff451f@mail.gmail.com> <616544d41003301319i72d15c08pd6656149981a4923@mail.gmail.com> <73d18a591003301338x154d1c24ga426eea2d5a6810c@mail.gmail.com> <616544d41003301414mb6e54f7ldf1199d7ddc123d5@mail.gmail.com> <20100401013901.GP19240@snowy.squish.net> Message-ID: HI, At the risk of repeating other (lengthy) discussions on this subject from 18 months ago... On 1 April 2010 02:39, Jon Ribbens > wrote: > On Tue, Mar 30, 2010 at 10:14:50PM +0100, Ed Stafford wrote: > > Mike, > > > > Glad it worked for you. Although the Ubuntu team does a fine job of > > package management I'm still a bit hesitant to use their python > packages. > The problem is that they're usually out-of-date. The same goes for debian whence Ubuntu obtain their packages. The advantage of using Ubuntu/Debian packages, where up-to-date ones exist, is that your system is under consistent control of the system's package manager. > It's easy enough using vanilla python to get everything you need going. > The issue with using the Python utils is that they do not play with the distibution's package management. For example, they do not cooperate over dependencies, nor provide a clean uninstall. No self-respecting sysadmin would dream of using them, simply because they are independent of the system's package management ( eg apt or yum). In > > the future you can do the following just as easily. > > > > `wget [1]http://peak.telecommunity.com/dist/ez_setup.py` > > `sudo python ez_setup.py` > > `sudo easy_install pip virtualenv virtualenvwrapper` > > I strongly advise not using easy_install, it's awful. > Yes, because it's trying to solve the problems of package management on systems without a'proper' package manager, it compromises those systems with one. I think that the solution here is for the Python package maintainers to make sure that *they* provide the Debian/Ubuntu/Red Hat/SUSE/whatever packages, and not rely on the hard-pressed distribution maintainers. A kludge that I use is to download the Python package, eg xlwt, then do a setup.py build, and run alien on the resulting tar.gz to produce a .deb or .rpm. At least I get a package which can be installed/uninstalled by the system package manager, although Python dependencies will not be managed without a bit of tweaking. Best wishes, John -- _______________________________________________ > python-uk mailing list > python-uk at python.org > http://mail.python.org/mailman/listinfo/python-uk > -- EuroPython is coming! - http://www.europython.eu - 17th-24th July 2010, Birmingham, UK -------------- next part -------------- An HTML attachment was scrubbed... URL: From tartley at tartley.com Thu Apr 1 11:59:20 2010 From: tartley at tartley.com (Jonathan Hartley) Date: Thu, 01 Apr 2010 10:59:20 +0100 Subject: [python-uk] easy_install pip won't work, am concerned Ministry of Packaging may chase after me. In-Reply-To: <8303462.1270086385167.JavaMail.root@n17> References: <73d18a591003301312m4a68885cq32d5ef258fff451f@mail.gmail.com> <616544d41003301319i72d15c08pd6656149981a4923@mail.gmail.com> <73d18a591003301338x154d1c24ga426eea2d5a6810c@mail.gmail.com> <616544d41003301414mb6e54f7ldf1199d7ddc123d5@mail.gmail.com> <8303462.1270086385167.JavaMail.root@n17> Message-ID: <4BB46E78.205@tartley.com> On 01/04/2010 02:39, Jon Ribbens wrote: > On Tue, Mar 30, 2010 at 10:14:50PM +0100, Ed Stafford wrote: > >> Mike, >> >> Glad it worked for you. Although the Ubuntu team does a fine job of >> package management I'm still a bit hesitant to use their python packages. >> It's easy enough using vanilla python to get everything you need going. In >> the future you can do the following just as easily. >> >> `wget [1]http://peak.telecommunity.com/dist/ez_setup.py` >> `sudo python ez_setup.py` >> `sudo easy_install pip virtualenv virtualenvwrapper` >> > I strongly advise not using easy_install, it's awful. > _______________________________________________ > python-uk mailing list > python-uk at python.org > http://mail.python.org/mailman/listinfo/python-uk > > Living up to your domain name, I see. I might have preferred the gentler 'has been superseded'. :-) So you're recommending installing pip manually, by downloading from PyPI, unzipping and running 'python setup.py install', followed by 'pip install virtualenv virtualenvwrapper'. I know that's not much bother, but in case it enhances my understanding, are there specific reasons why 'easy_install pip' is harmful in this context? By definition this install isn't into a virtualenv. Thanks, Jonathan Jonathan Hartley Made of meat. http://tartley.com tartley at tartley.com +44 7737 062 225 twitter/skype: tartley From walter.stafford at carbonsixty.co.uk Thu Apr 1 12:21:26 2010 From: walter.stafford at carbonsixty.co.uk (Ed Stafford) Date: Thu, 1 Apr 2010 11:21:26 +0100 Subject: [python-uk] easy_install pip won't work, am concerned Ministry of Packaging may chase after me. In-Reply-To: References: <73d18a591003301312m4a68885cq32d5ef258fff451f@mail.gmail.com> <616544d41003301319i72d15c08pd6656149981a4923@mail.gmail.com> <73d18a591003301338x154d1c24ga426eea2d5a6810c@mail.gmail.com> <616544d41003301414mb6e54f7ldf1199d7ddc123d5@mail.gmail.com> <20100401013901.GP19240@snowy.squish.net> Message-ID: Hello, Without trying to argue about the purity of package managers or their uses I would say that the reality is that there are some issues with dependable python packages supplied for various distros. Because of that I always find it easier to manage the necessary packages myself, that's all I was trying to say. Sometimes it's just not worth the trouble of fighting a package manager when you have something else that's completely workable and reliable, e.g. pip/setup_tools and pypi. Even then we're sometimes forced to develop against trunk for various projects, in which case you would still be better off using something like pip. The reason setup_tools was installed is because pip requires it to function and I've never had any trouble using the bootstrap scripts then installing pip via easy_install. This has been my experience and your mileage may vary. Cheers, -Ed On 1 April 2010 10:51, John Pinner wrote: > HI, > > At the risk of repeating other (lengthy) discussions on this subject from > 18 months ago... > > On 1 April 2010 02:39, Jon Ribbens > > wrote: > >> On Tue, Mar 30, 2010 at 10:14:50PM +0100, Ed Stafford wrote: >> > Mike, >> > >> > Glad it worked for you. Although the Ubuntu team does a fine job of >> > package management I'm still a bit hesitant to use their python >> packages. >> > > The problem is that they're usually out-of-date. The same goes for debian > whence Ubuntu obtain their packages. > > The advantage of using Ubuntu/Debian packages, where up-to-date ones exist, > is that your system is under consistent control of the system's package > manager. > > > It's easy enough using vanilla python to get everything you need >> going. >> > > The issue with using the Python utils is that they do not play with the > distibution's package management. For example, they do not cooperate over > dependencies, nor provide a clean uninstall. No self-respecting sysadmin > would dream of using them, simply because they are independent of the > system's package management ( eg apt or yum). > > In >> > the future you can do the following just as easily. >> > >> > `wget [1]http://peak.telecommunity.com/dist/ez_setup.py` >> > `sudo python ez_setup.py` >> > `sudo easy_install pip virtualenv virtualenvwrapper` >> >> I strongly advise not using easy_install, it's awful. >> > > Yes, because it's trying to solve the problems of package management on > systems without a'proper' package manager, it compromises those systems > with one. > > I think that the solution here is for the Python package maintainers to > make sure that *they* provide the Debian/Ubuntu/Red Hat/SUSE/whatever > packages, and not rely on the hard-pressed distribution maintainers. > > A kludge that I use is to download the Python package, eg xlwt, then do a > setup.py build, and run alien on the resulting tar.gz to produce a .deb or > .rpm. At least I get a package which can be installed/uninstalled by the > system package manager, although Python dependencies will not be managed > without a bit of tweaking. > > Best wishes, > > John > -- > > > _______________________________________________ >> python-uk mailing list >> python-uk at python.org >> http://mail.python.org/mailman/listinfo/python-uk >> > > > > -- > EuroPython is coming! - http://www.europython.eu - 17th-24th July 2010, > Birmingham, UK > > _______________________________________________ > python-uk mailing list > python-uk at python.org > http://mail.python.org/mailman/listinfo/python-uk > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jon+python-uk at unequivocal.co.uk Thu Apr 1 12:26:24 2010 From: jon+python-uk at unequivocal.co.uk (Jon Ribbens) Date: Thu, 1 Apr 2010 11:26:24 +0100 Subject: [python-uk] easy_install pip won't work, am concerned Ministry of Packaging may chase after me. In-Reply-To: References: <73d18a591003301312m4a68885cq32d5ef258fff451f@mail.gmail.com> <616544d41003301319i72d15c08pd6656149981a4923@mail.gmail.com> <73d18a591003301338x154d1c24ga426eea2d5a6810c@mail.gmail.com> <616544d41003301414mb6e54f7ldf1199d7ddc123d5@mail.gmail.com> <20100401013901.GP19240@snowy.squish.net> Message-ID: <20100401102624.GQ19240@snowy.squish.net> On Thu, Apr 01, 2010 at 10:51:31AM +0100, John Pinner wrote: > I strongly advise not using easy_install, it's awful. > > Yes, because it's trying to solve the problems of package management on > systems without a'proper'? package manager, it compromises those systems > with one. Well, I don't know about that, but my experience is that it just flat-out doesn't work. For example, the MySQL<->Python connector has now unfortunately changed to using setuptools, which in its infinite wisdom decides to install it as a "Zip Egg" - which promptly fails to work at all since you can't load a .so file from a zip. Even when you manage to force it to not break things like that, it for some benighted reason installs every package in a different subdirectory (even though packages are already subdirectories!), and your Python sys.path gets ridiculously huge. From jon+python-uk at unequivocal.co.uk Thu Apr 1 12:29:46 2010 From: jon+python-uk at unequivocal.co.uk (Jon Ribbens) Date: Thu, 1 Apr 2010 11:29:46 +0100 Subject: [python-uk] easy_install pip won't work, am concerned Ministry of Packaging may chase after me. In-Reply-To: <4BB46E78.205@tartley.com> References: <73d18a591003301312m4a68885cq32d5ef258fff451f@mail.gmail.com> <616544d41003301319i72d15c08pd6656149981a4923@mail.gmail.com> <73d18a591003301338x154d1c24ga426eea2d5a6810c@mail.gmail.com> <616544d41003301414mb6e54f7ldf1199d7ddc123d5@mail.gmail.com> <8303462.1270086385167.JavaMail.root@n17> <4BB46E78.205@tartley.com> Message-ID: <20100401102946.GR19240@snowy.squish.net> On Thu, Apr 01, 2010 at 10:59:20AM +0100, Jonathan Hartley wrote: > On 01/04/2010 02:39, Jon Ribbens wrote: >> I strongly advise not using easy_install, it's awful. > > Living up to your domain name, I see. Someone else has equivocal.co.uk I'm afraid :-p > I might have preferred the gentler 'has been superseded'. :-) If it's been superceded, it's by "python setup.py install", which actually preceded it and worked better. As far as I can tell, easy_install is trying to solve an already-solved problem, and doing it worse than the existing solution. > I know that's not much bother, but in case it enhances my > understanding, are there specific reasons why 'easy_install pip' is > harmful in this context? See the other message I posted just now. From mike.maccana at gmail.com Thu Apr 1 19:41:17 2010 From: mike.maccana at gmail.com (Mike MacCana) Date: Thu, 1 Apr 2010 18:41:17 +0100 Subject: [python-uk] easy_install pip won't work, am concerned Ministry of Packaging may chase after me. In-Reply-To: References: <73d18a591003301312m4a68885cq32d5ef258fff451f@mail.gmail.com> <616544d41003301319i72d15c08pd6656149981a4923@mail.gmail.com> <73d18a591003301338x154d1c24ga426eea2d5a6810c@mail.gmail.com> <616544d41003301414mb6e54f7ldf1199d7ddc123d5@mail.gmail.com> <20100401013901.GP19240@snowy.squish.net> Message-ID: On Thu, Apr 1, 2010 at 10:51 AM, John Pinner wrote: > > The issue with using the Python utils is that they do not play with the > distibution's package management. For example, they do not cooperate over > dependencies, nor provide a clean uninstall. No self-respecting sysadmin > would dream of using them, simply because they are independent of the > system's package management ( eg apt or yum). > Exactly - that's why I'm interested in virtualenv in the first place - my apps are contained and separate from both each other and the OS. Mike -------------- next part -------------- An HTML attachment was scrubbed... URL: From carles at pina.cat Fri Apr 2 13:04:54 2010 From: carles at pina.cat (Carles Pina i Estany) Date: Fri, 2 Apr 2010 13:04:54 +0200 Subject: [python-uk] First April Code Dojo Message-ID: <20100402110454.GA5811@pina.cat> Hi, For the people who (we) couldn't attend yesterday in the code Dojo: how it went? What happened? How is the game doing? It has a parser? Where we go on next one? (ok, I should check git ;-) I'll do...) Have a nice long weekend, -- Carles Pina i Estany http://pinux.info From ntoll at ntoll.org Fri Apr 2 15:46:52 2010 From: ntoll at ntoll.org (Nicholas Tollervey) Date: Fri, 2 Apr 2010 14:46:52 +0100 Subject: [python-uk] First April Code Dojo In-Reply-To: <20100402110454.GA5811@pina.cat> References: <20100402110454.GA5811@pina.cat> Message-ID: Hi Carles (and anyone else who missed the dojo...) Last night's dojo was a cracker. Lots of interesting conversation over the pizza and beer (thanks Fry-IT): pygame and pyweek, some web-dev, welcoming dojo newbies and sharing some of the April fools we'd seen... We started the evening with a demonstration of a "floppy" game from the London Dojo team that are taking part in pyweek. I especially enjoyed the four-dimensional wombat that would pop in and out of existence at random points in the game. Everyone was encouraged by myself and Ciar?n to attend Europython (again). There was some talk about writing to your MP about DEB (see http://www.openrightsgroup.org/) and the wider scoped ACTA (here's a record of my interaction with my MEPs: http://ntoll.org/article/acting-on-acta). You are correct Carles in thinking we attempted to write a command parser for the adventure game. We split into four teams and *every* team managed to complete a working parser within the one hour deadline. I don't have all the code yet but will be updating the repos on GitHub once I do. A special mention should go to team 3 who decided to build their parsing on bayesian probability with hilarious results. Other highlights included the emergence of a "fortune cookie" AI in team 2's work (who decided to stick with the cmd module) and team 4's obsession with killing random things (ropes, axes, monsters and members of the dojo) only to end up being eaten "in game". In the end the dojo decided to "bless" the bayesian approach and Peter B. will give a quick talk at the start of the next dojo so everyone can catch up with where we're at. Dave K. suggested that next time we should add behaviour to objects and the ability to create/define puzzles. Javier "won" the O'Reilly book. :-) Photos can be found here: http://divvyshot.com/event/VfTUm/ The next dojo will be on May 6th, usual place / time etc... and I'll announce things when I've had time to sort out the page etc... Remember that Andy is organising a Pyssup in a fortnight or so... All the best and hopefully see you at the next one, Nicholas. On 2 Apr 2010, at 12:04, Carles Pina i Estany wrote: > > Hi, > > For the people who (we) couldn't attend yesterday in the code Dojo: how > it went? What happened? How is the game doing? It has a parser? Where we > go on next one? > > (ok, I should check git ;-) I'll do...) > > Have a nice long weekend, > > -- > Carles Pina i Estany > http://pinux.info > _______________________________________________ > python-uk mailing list > python-uk at python.org > http://mail.python.org/mailman/listinfo/python-uk From thomas_anish at hotmail.com Thu Apr 8 13:43:21 2010 From: thomas_anish at hotmail.com (anish thomas) Date: Thu, 8 Apr 2010 11:43:21 +0000 Subject: [python-uk] (no subject) Message-ID: Hi Experts, Not sure , I am contacting the right alias for some clarifications on python. Am beginer and looking for your comments/suggestions on implementing call backs in python. I have the following sample code, where I am trying to execute "hello" using callbacks,but its not printing the value. Can someone please comment on it Regards Anish def hello(): print 'hello' return def temp(val): val return temp(hello) _________________________________________________________________ Climate, controversies and the changing signatures of nature http://green.in.msn.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jaime.buelta at gmail.com Sat Apr 10 09:15:28 2010 From: jaime.buelta at gmail.com (Jaime Buelta) Date: Sat, 10 Apr 2010 08:15:28 +0100 Subject: [python-uk] (no subject) In-Reply-To: References: Message-ID: You should "call" the function used as argument in "temp" (named val), just if you're calling directly "hello". This way: def hello(): print 'hello' return def temp(val): val() # Note the brackets, as you're executing the function return temp(hello) I think this is what you are trying to achieve... Best regards, Jaime Buelta On Thu, Apr 8, 2010 at 12:43 PM, anish thomas wrote: > Hi Experts, > > Not sure , I am contacting the right alias for some clarifications on > python. > Am beginer and looking for your comments/suggestions on implementing call > backs in python. > I have the following sample code, where I am trying to execute "hello" > using callbacks,but its not printing the value. > Can someone please comment on it > > Regards > Anish > > > def hello(): > print 'hello' > return > def temp(val): > val > return > temp(hello) > > > > > ------------------------------ > Invest your money wisely post Budget Sign up now. > > _______________________________________________ > python-uk mailing list > python-uk at python.org > http://mail.python.org/mailman/listinfo/python-uk > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carles at pina.cat Sat Apr 10 09:54:17 2010 From: carles at pina.cat (Carles Pina i Estany) Date: Sat, 10 Apr 2010 08:54:17 +0100 Subject: [python-uk] (no subject) In-Reply-To: References: Message-ID: <20100410075417.GA11918@pina.cat> Hello, On Apr/08/2010, anish thomas wrote: > def hello(): > print 'hello' > return > > def temp(val): > val you need val(), to call the function -- Carles Pina i Estany http://pinux.info From marcus at primarydrive.com Wed Apr 14 16:37:57 2010 From: marcus at primarydrive.com (Marcus Hamilton) Date: Wed, 14 Apr 2010 15:37:57 +0100 Subject: [python-uk] Python programmer wanted Message-ID: <7D4465AC6E6F4A10B110BF370E704753@marcus> Hi there, I'm looking for a very experienced Python programmer for a job that will last for around a month in London. You would have to be able to start work as soon as possible. Please let me know if you are interested, and I will send further details. Kind regards Marcus -------------- next part -------------- An HTML attachment was scrubbed... URL: From gns24 at mythic-beasts.com Wed Apr 14 17:23:59 2010 From: gns24 at mythic-beasts.com (Graham Stratton) Date: Wed, 14 Apr 2010 16:23:59 +0100 Subject: [python-uk] Python programmer wanted In-Reply-To: <7D4465AC6E6F4A10B110BF370E704753@marcus> References: <7D4465AC6E6F4A10B110BF370E704753@marcus> Message-ID: Hi Marcus, I've been programming primarily in Python for about 6 years, on a wide variety of problems. I've attached my CV. I would be available to start immediately. If that's of interest I'd like to hear more about the role. -------------- next part -------------- A non-text attachment was scrubbed... Name: cv.pdf Type: application/pdf Size: 27136 bytes Desc: not available URL: -------------- next part -------------- Regards, Graham On 14 Apr 2010, at 15:37, Marcus Hamilton wrote: > Hi there, > > I'm looking for a very experienced Python programmer for a job that will last for around a month in London. > > You would have to be able to start work as soon as possible. > > Please let me know if you are interested, and I will send further details. > > Kind regards > Marcus > _______________________________________________ > python-uk mailing list > python-uk at python.org > http://mail.python.org/mailman/listinfo/python-uk From ntoll at ntoll.org Fri Apr 16 17:16:47 2010 From: ntoll at ntoll.org (Nicholas Tollervey) Date: Fri, 16 Apr 2010 16:16:47 +0100 Subject: [python-uk] Announcing the 9th London Python Code Dojo Message-ID: <08AA30C5-FFA2-4001-90C9-CFF14EF5D9CB@ntoll.org> Folks, When..? 6th May 18:30 ? 21:30 (ish). Where..? The usual place: Fry-IT Ltd, 503 Enterprise House, 1/2 Hatfields, London SE1 9PG Sign-up here: http://ldnpydojo.eventwax.com/9th-london-python-code-dojo Peter B. will give a quick talk at the start of this dojo so everyone can catch up with where we?re at in terms of the bayesian parser that was "blessed" at the end of the last dojo. Dave K. suggested that we add behaviour to objects and the ability to create/define puzzles. If we manage to pull that off we have a more-or-less finished adventure game. :-) Photos from all the dojos so far can be found here: http://divvyshot.com/event/IsJtx/ (a photo sharing site built w/Python) Free pizza and beer will be provided. (Thanks Fry-IT) Participants get the chance to win a cool book: "Natural Language Processing with Python". (Thanks O'Reilly) Remember to bring a laptop with Python and GIT installed (actually, shouldn't we be using Mercurial..?) Looking forward to it, Nicholas. From tibs at tibsnjoan.co.uk Tue Apr 27 20:32:41 2010 From: tibs at tibsnjoan.co.uk (Tony Ibbs) Date: Tue, 27 Apr 2010 19:32:41 +0100 Subject: [python-uk] Next CamPUG meeting, Tue 4th May Message-ID: <55EE86FB-C6EC-4B0A-9FAF-71F09CF20315@tibsnjoan.co.uk> As it says on our Google group: The next meeting will be 7.30pm, Tuesday 4th May, at RealVNC (http://tinyurl.com/realvncoffices). Since this is rather short notice, it's probably sensible to do a lightning talks meeting, so if you have something that can be explained in five minutes or so, please do so. As normal, volunteers beforehand to myself or the list, or just turn up and talk. If someone did get to last weekend's BarCamb meeting (I know Robin was hoping to go), that would be worth telling us about. Subsequent meetings are expected to be: * Tue 1st June, which should be another Dojo meeting (and I shall be away) * Tue 6th July, another talks meeting (I shan't repeat the EuroPython advert here) Tibs From sachin_chavan at yahoo.com Wed Apr 28 16:02:10 2010 From: sachin_chavan at yahoo.com (Goodies) Date: Wed, 28 Apr 2010 07:02:10 -0700 (PDT) Subject: [python-uk] How to access a class instance created in one module in another module? Message-ID: <28387973.post@talk.nabble.com> Hi, I have a query. I have two modules viz. MnSem5Main.py and MnCEMMain.py in different folders. I have created the below instances in MnSem5Main.py: 'app' , 'frame' Please note that 'app' is created using wx.App and 'frame' using wx.Frame builtin classes. I want to access these in MnCEMMain.py. How to access these instances? Regards, Sachindeo V Chavan -- View this message in context: http://old.nabble.com/How-to-access-a-class-instance-created-in-one-module-in-another-module--tp28387973p28387973.html Sent from the Python - python-uk mailing list archive at Nabble.com. From meitham at meitham.com Thu Apr 29 10:26:44 2010 From: meitham at meitham.com (meitham) Date: Thu, 29 Apr 2010 09:26:44 +0100 Subject: [python-uk] How to access a class instance created in one module in another module? In-Reply-To: <28387973.post@talk.nabble.com> References: <28387973.post@talk.nabble.com> Message-ID: > I have a query. I have two modules viz. MnSem5Main.py and MnCEMMain.py in > different folders. Make the two folders packages so you can import from them, just add an empty __init__.py file in each folder. > I have created the below instances in MnSem5Main.py: > > 'app' ? , ?'frame' > Please note that 'app' is created using wx.App and 'frame' using wx.Frame > builtin classes. > I want to access these in MnCEMMain.py. How to access these instances? suppose the folder name where MnSem5Main.py is located called foo from foo.MnSem5Main import app, frame From xtian at babbageclunk.com Thu Apr 29 11:29:07 2010 From: xtian at babbageclunk.com (xtian) Date: Thu, 29 Apr 2010 10:29:07 +0100 Subject: [python-uk] How to access a class instance created in one module in another module? In-Reply-To: <28387973.post@talk.nabble.com> References: <28387973.post@talk.nabble.com> Message-ID: On Wed, Apr 28, 2010 at 3:02 PM, Goodies wrote: > I have a query. I have two modules viz. MnSem5Main.py and MnCEMMain.py in > different folders. > I have created the below instances in MnSem5Main.py: > > 'app' ? , ?'frame' > Please note that 'app' is created using wx.App and 'frame' using wx.Frame > builtin classes. > I want to access these in MnCEMMain.py. How to access these instances? Your terminology is a little muddled here. It sounds like what you mean is that you created classes called app and frame in MnSem5Main.py which subclass (or inherit from) wx.App and wx.Frame. if MnSem5Main.py is on your PYTHONPATH, you can import the classes by putting the following line in MnSem5Main.py: from MnSem5Main import app, frame Then you can create instances of the classes by calling them with the appropriate parameters. Even if app and frame are instances of classes instead of classes, the import statement will get them from the MnSem5Main namespace and put them in your namespace. xtian From ntoll at ntoll.org Thu Apr 29 13:36:47 2010 From: ntoll at ntoll.org (Nicholas Tollervey) Date: Thu, 29 Apr 2010 12:36:47 +0100 Subject: [python-uk] Reminder: 9th London Python Code Dojo next week Message-ID: <1272541007.1682.9.camel@ntoll-ubuntu> Folks, A quick reminder that the next London Python Code Dojo is a week away. It's on 6th May, starts at 6:30pm (coding at 7:30) and will be at the offices of Fry-IT (details at the end). You can sign up here (just so we know how much pizza to order): http://ldnpydojo.eventwax.com/9th-london-python-code-dojo We hope to get close to finishing the text-adventure game we've been writing by adding behaviour to objects and puzzles. Peter will start the evening with a quick recap on the Bayesian parser we "blessed" at the end of the last dojo and we'll work in teams as before. As always, free pizza and beer will be provided by Fry-IT (thanks!) and there is also a copy of "Natural Language Processing with Python" to win (thanks to O'Reilly). Look forward to seeing you there! Nicholas. Venue: Fry-IT Limited 503 Enterprise House 1/2 Hatfields London SE1 9PG Telephone: 0207 0968800 Nearest Tubes: Waterloo Southwark