You can subscribe to this list here.
2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(6) |
Nov
(8) |
Dec
(51) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2001 |
Jan
(105) |
Feb
(93) |
Mar
(194) |
Apr
(145) |
May
(100) |
Jun
(111) |
Jul
(117) |
Aug
(126) |
Sep
(233) |
Oct
(138) |
Nov
(164) |
Dec
(109) |
2002 |
Jan
(216) |
Feb
(175) |
Mar
(216) |
Apr
(194) |
May
(157) |
Jun
(140) |
Jul
(158) |
Aug
(73) |
Sep
(105) |
Oct
(164) |
Nov
(104) |
Dec
(95) |
2003 |
Jan
(72) |
Feb
(69) |
Mar
(81) |
Apr
(151) |
May
(101) |
Jun
(139) |
Jul
(99) |
Aug
(118) |
Sep
(115) |
Oct
(151) |
Nov
(161) |
Dec
(102) |
2004 |
Jan
(120) |
Feb
(175) |
Mar
(106) |
Apr
(111) |
May
(54) |
Jun
(78) |
Jul
(76) |
Aug
(105) |
Sep
(94) |
Oct
(143) |
Nov
(75) |
Dec
(85) |
2005 |
Jan
(99) |
Feb
(77) |
Mar
(164) |
Apr
(97) |
May
(79) |
Jun
(57) |
Jul
(65) |
Aug
(102) |
Sep
(95) |
Oct
(129) |
Nov
(123) |
Dec
(52) |
2006 |
Jan
(48) |
Feb
(99) |
Mar
(90) |
Apr
(51) |
May
(81) |
Jun
(136) |
Jul
(56) |
Aug
(109) |
Sep
(50) |
Oct
(44) |
Nov
(74) |
Dec
(75) |
2007 |
Jan
(92) |
Feb
(137) |
Mar
(93) |
Apr
(79) |
May
(52) |
Jun
(74) |
Jul
(143) |
Aug
(175) |
Sep
(154) |
Oct
(137) |
Nov
(88) |
Dec
(90) |
2008 |
Jan
(58) |
Feb
(113) |
Mar
(167) |
Apr
(88) |
May
(105) |
Jun
(37) |
Jul
(87) |
Aug
(72) |
Sep
(56) |
Oct
(41) |
Nov
(102) |
Dec
(70) |
2009 |
Jan
(115) |
Feb
(113) |
Mar
(126) |
Apr
(58) |
May
(125) |
Jun
(45) |
Jul
(90) |
Aug
(125) |
Sep
(84) |
Oct
(61) |
Nov
(111) |
Dec
(61) |
2010 |
Jan
(85) |
Feb
(86) |
Mar
(130) |
Apr
(58) |
May
(57) |
Jun
(32) |
Jul
(25) |
Aug
(50) |
Sep
(41) |
Oct
(65) |
Nov
(63) |
Dec
(24) |
2011 |
Jan
(43) |
Feb
(31) |
Mar
(28) |
Apr
(68) |
May
(53) |
Jun
(42) |
Jul
(58) |
Aug
(26) |
Sep
(51) |
Oct
(76) |
Nov
(60) |
Dec
(9) |
2012 |
Jan
(16) |
Feb
(32) |
Mar
(32) |
Apr
(39) |
May
(16) |
Jun
(19) |
Jul
(3) |
Aug
(11) |
Sep
(35) |
Oct
(47) |
Nov
(28) |
Dec
(18) |
2013 |
Jan
(18) |
Feb
(36) |
Mar
(10) |
Apr
(7) |
May
(7) |
Jun
(27) |
Jul
(17) |
Aug
(35) |
Sep
(19) |
Oct
(31) |
Nov
(8) |
Dec
(22) |
2014 |
Jan
(5) |
Feb
(11) |
Mar
(18) |
Apr
(23) |
May
(26) |
Jun
(14) |
Jul
(18) |
Aug
(26) |
Sep
(20) |
Oct
(48) |
Nov
(13) |
Dec
(9) |
2015 |
Jan
(9) |
Feb
(15) |
Mar
(25) |
Apr
(10) |
May
(26) |
Jun
(6) |
Jul
(13) |
Aug
(5) |
Sep
(14) |
Oct
(36) |
Nov
(24) |
Dec
(18) |
2016 |
Jan
(24) |
Feb
(11) |
Mar
(1) |
Apr
(6) |
May
(7) |
Jun
(3) |
Jul
(9) |
Aug
(15) |
Sep
(22) |
Oct
(5) |
Nov
(5) |
Dec
(2) |
2017 |
Jan
(20) |
Feb
(4) |
Mar
(4) |
Apr
(1) |
May
(5) |
Jun
(7) |
Jul
(14) |
Aug
(9) |
Sep
(18) |
Oct
(2) |
Nov
(3) |
Dec
(3) |
2018 |
Jan
(7) |
Feb
(6) |
Mar
(1) |
Apr
(2) |
May
|
Jun
|
Jul
(1) |
Aug
(18) |
Sep
(8) |
Oct
(9) |
Nov
(4) |
Dec
(6) |
2019 |
Jan
(5) |
Feb
|
Mar
(2) |
Apr
(4) |
May
(6) |
Jun
(8) |
Jul
(11) |
Aug
(10) |
Sep
(6) |
Oct
|
Nov
(1) |
Dec
|
2020 |
Jan
(8) |
Feb
(3) |
Mar
(1) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
|
Aug
|
Sep
(1) |
Oct
(5) |
Nov
(2) |
Dec
(1) |
2021 |
Jan
|
Feb
|
Mar
(5) |
Apr
(2) |
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2022 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(7) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2023 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(3) |
Jun
(5) |
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2024 |
Jan
|
Feb
(1) |
Mar
|
Apr
(2) |
May
|
Jun
(5) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2025 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Samuele P. <pe...@in...> - 2002-03-23 00:42:49
|
From: Edward Povazan <epo...@te...> > I am using Jython 2.1 under XP Pro. > > > import impi.core > > dir(impi.core) > ['__doc__', '__file__', '__name__', '__path__'] > > Hmm, this is strange, but I can acually: That means that impi.core is a Python package, you have a __init__.py both in impi and impi/core? That's OK. But so your from impi.core import * will never get you the Java class. Anyway why the error? The thing you haven't said to us is that you are doing the from impi.core import * from a module inside impi.core, is that true? Samuele. |
From: Edward P. <epo...@te...> - 2002-03-23 00:40:19
|
> I'm not quite sure how you managed it, but I imagine at some point > you had Impi in a file named impi.java? You may also not be using Jython > 2.1? That was my first thought ... I checked for rogue impi.java classes. Still doesn't work. I did see similar questions in the archives, I think it is something windows specific. -Ed |
From: O'Brien-Strain, E. <eo...@ex...> - 2002-03-23 00:22:28
|
If you want to enforce the singleton pattern you can remove the constructor in the constructor itself. That way only one object can be created. For example: #Define the class class Foo: def __init__(self,...): Foo.__init__ = None ... ... #Create the one-and-only instance Foo.instance = Foo(...) All other code should use "Foo.instance" to refer to the singleton. If any other code erroneously tries to create a second Foo it will get a TypeError complaining about trying to call a non-function. (For a nicer error message, instead of assigning __init__ to None you can assign it to a function that raises a more meaningful exception.) __ Eamonn O'Brien-Strain HP Labs eo...@hp... > -----Original Message----- > From: Ype Kingma [mailto:yk...@xs...] > Sent: Friday, March 22, 2002 3:27 PM > To: jyt...@li... > Subject: Re: [Jython-users] Singleton > > > Stephen, > > >Hi, > > > >I have read lots of stuff on creating the singleton design > pattern using > >python and to be honest most of this information has left me > confused. > >What is the best way to create the singleton in jython? > > There is no single best way. You can use the borg pattern > (use google to look for: python borg pattern singleton). > Or you implement the singleton using module semantics: > > class aSingle: pass > > theSingle = aSingle() > > and use itsModule.theSingle as the singleton. > > Or you can implement it in java as a singleton, > and access it from from jython. > > There are probably at least a few more other ways. > > >Thanks > > Cheers, > Ype > > -- > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |
From: Edward P. <epo...@te...> - 2002-03-23 00:15:35
|
I am using Jython 2.1 under XP Pro. > import impi.core > dir(impi.core) ['__doc__', '__file__', '__name__', '__path__'] Hmm, this is strange, but I can acually: import impi.core.Impi dir(impi.core.Impi) Which works as expected, showing all the static methods of the Impi class. Impi is a class containing static methods only. Do I have something set up wrong. My classpath is set to the root of my project. Is there anything else? Thanks -Ed |
From: Stefan F. <st...@ti...> - 2002-03-23 00:07:29
|
On Fri, 2002-03-22 at 15:57, Samuele Pedroni wrote: > From: Stefan Farestam <st...@ti...> > > > > I tried using retroguard to obfuscate a jar file > > created by jythonc but got errors. > > What kind of errors, from the obfuscator > or when running the obfuscated jar, > or where the errors obfuscated too <wink>? Nope, here they are (from retroguard.log): # Logfile created on Fri Mar 22 16:02:06 PST 2002 # # Jar file to be obfuscated: rvscript.jar # Target Jar file for obfuscated code: out.jar # RetroGuard Script file used: (none, defaults used) # # ERROR - corrupt class file: com/tibco/rvscript/StringIO.class # Unrecoverable error during obfuscation: # java.lang.NullPointerException java.lang.NullPointerException at a.a.a.s.for(Unknown Source) at a.a.a.s.a(Unknown Source) at RetroGuard.a(Unknown Source) at RetroGuard.a(Unknown Source) at RetroGuard.main(Unknown Source) > > I'm sonewhat > > mystified as I thought that jythonc produced > > standard Java bytecode. > > More or less standard, although I have > never used an obfuscator, I think > that it can have a lot of trouble dealing > with reflection and doing its job. > > regards. > > > > > Has anyone been able to use retroguard or any other > > obfuscator on jar produced by jythonc? > > -- Stefan Farestam Technical Alliance Mgr Cell: +1 650 714 8350 st...@ti... Strategic Alliances Office: +1 650 846 8445 www.tibco.com TIBCO Software Inc. |
From: Samuele P. <pe...@in...> - 2002-03-22 23:58:19
|
From: Stefan Farestam <st...@ti...> > > I tried using retroguard to obfuscate a jar file > created by jythonc but got errors. What kind of errors, from the obfuscator or when running the obfuscated jar, or where the errors obfuscated too <wink>? > I'm sonewhat > mystified as I thought that jythonc produced > standard Java bytecode. More or less standard, although I have never used an obfuscator, I think that it can have a lot of trouble dealing with reflection and doing its job. regards. > > Has anyone been able to use retroguard or any other > obfuscator on jar produced by jythonc? |
From: Samuele P. <pe...@in...> - 2002-03-22 23:43:27
|
> Hello All, > > I've look in the archives, but only see questions, and no answers relating > to this. > I have a folder hierarchy impi/core/ and a .class file impi/core/Impi.class > > when I 'from impi.core import *' from another module, I get > 'java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: > impi/core/impi (wrong name: impi/core/Impi)' > > Is there a quick fix for this? > Under which OS? What does: import impi.core dir(impi.core) display? Impli or impli Samuele. |
From: Kevin B. <kb...@ca...> - 2002-03-22 23:41:53
|
Hmm. I'm not quite sure how you managed it, but I imagine at some point you had Impi in a file named impi.java? You may also not be using Jython 2.1? Windows' case-insensitive filesystem is unfriendly to Java's case-sensitive class names & one-class-one-file philosophy. I'd suggest doing a clean build of all your Java code related to Impi. This will probably identify some class that is using 'impi' instead of 'Impi'. 'grep' may also do it. kb Edward Povazan wrote: >Hello All, > >I've look in the archives, but only see questions, and no answers relating >to this. >I have a folder hierarchy impi/core/ and a .class file impi/core/Impi.class > >when I 'from impi.core import *' from another module, I get >'java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: >impi/core/impi (wrong name: impi/core/Impi)' > >Is there a quick fix for this? > >Thanks >-Ed > > >_______________________________________________ >Jython-users mailing list >Jyt...@li... >https://lists.sourceforge.net/lists/listinfo/jython-users > |
From: Kevin B. <kb...@ca...> - 2002-03-22 23:29:22
|
One more I forgot to mention, which may be suitable for your application: If you are going to have one of your processes spawn the other, you can just use os.popen* (in CPython) or Java's Runtime.exec (in Jython until I or someone else implements popen* functions) to spawn the child process. The parent then reads from/writes to the returned file handles, and the child reads/writes stdin/stdout. kb Kevin Butler wrote: > You have several options, ranging in rough order of difficulty: > > - Python-specific RPC technology (PYRO http://pyro.sourceforge.net/ or > DOPY http://www.users.cloud9.net/~proteus/dopy/) > I actually haven't used either, as I've needed cross language > interoperability, but I probably would use one of them if I were doing > all-Python RPC > > - Python-based CORBA solution (Fnorb or omniorb and possibly Java's > CORBA interfaces) > > - XML-based RPC technology (xmlrpc/soap) (haven't done much with these) > > - custom sockets (probably using pickles, maybe SimpleTCPServer or > BaseHTTPServer) > > - some other communication mechanism you dream up - write to a file, > database, etc. > > In spite of what RPC vendors would have you think, none of this is > very difficult, and unless you > have significant stability or performance requirements, all should be > quite suitable. I imagine that > if PYRO or DOPY works for you, they will be significantly easier than > any of the others, but all > the others are pretty similar in difficulty. > > IMO, YMMV, etc. > > kb > > Stephen Naicken wrote: > >> I have a system made up of two parts. One in Jython and the other in >> CPython. The reason for this is that I could not find a Gnutella >> library in CPython, but I could in Java. Also I have been having >> difficulties with BerkeleyDB Java bindings, so I decided to use >> CPython's bsddb. >> >> Anyway, I would like the jython and python processes to communicate with >> each other. I was think of IPC using scokets, but I'm not sure if this >> is the best option. >> >> I'd be grateful for any advice on this as I have not done this sort of >> thing before. Alternatively if anyone knows of a good python gnutella >> library (like Jtella), that would be an alternative solution. >> >> Thanks Again. >> >> Stephen >> >> >> _______________________________________________ >> Jython-users mailing list >> Jyt...@li... >> https://lists.sourceforge.net/lists/listinfo/jython-users >> > > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users |
From: Stefan F. <st...@ti...> - 2002-03-22 23:27:37
|
I tried using retroguard to obfuscate a jar file created by jythonc but got errors. I'm sonewhat mystified as I thought that jythonc produced standard Java bytecode. Has anyone been able to use retroguard or any other obfuscator on jar produced by jythonc? Thanks, Stefan |
From: Ype K. <yk...@xs...> - 2002-03-22 23:24:31
|
Stephen, >Hi, > >I have read lots of stuff on creating the singleton design pattern using >python and to be honest most of this information has left me confused. >What is the best way to create the singleton in jython? There is no single best way. You can use the borg pattern (use google to look for: python borg pattern singleton). Or you implement the singleton using module semantics: class aSingle: pass theSingle = aSingle() and use itsModule.theSingle as the singleton. Or you can implement it in java as a singleton, and access it from from jython. There are probably at least a few more other ways. >Thanks Cheers, Ype -- |
From: Kevin B. <kb...@ca...> - 2002-03-22 23:10:03
|
You have several options, ranging in rough order of difficulty: - Python-specific RPC technology (PYRO http://pyro.sourceforge.net/ or DOPY http://www.users.cloud9.net/~proteus/dopy/) I actually haven't used either, as I've needed cross language interoperability, but I probably would use one of them if I were doing all-Python RPC - Python-based CORBA solution (Fnorb or omniorb and possibly Java's CORBA interfaces) - XML-based RPC technology (xmlrpc/soap) (haven't done much with these) - custom sockets (probably using pickles, maybe SimpleTCPServer or BaseHTTPServer) - some other communication mechanism you dream up - write to a file, database, etc. In spite of what RPC vendors would have you think, none of this is very difficult, and unless you have significant stability or performance requirements, all should be quite suitable. I imagine that if PYRO or DOPY works for you, they will be significantly easier than any of the others, but all the others are pretty similar in difficulty. IMO, YMMV, etc. kb Stephen Naicken wrote: >I have a system made up of two parts. One in Jython and the other in >CPython. The reason for this is that I could not find a Gnutella >library in CPython, but I could in Java. Also I have been having >difficulties with BerkeleyDB Java bindings, so I decided to use >CPython's bsddb. > >Anyway, I would like the jython and python processes to communicate with >each other. I was think of IPC using scokets, but I'm not sure if this >is the best option. > >I'd be grateful for any advice on this as I have not done this sort of >thing before. Alternatively if anyone knows of a good python gnutella >library (like Jtella), that would be an alternative solution. > >Thanks Again. > >Stephen > > >_______________________________________________ >Jython-users mailing list >Jyt...@li... >https://lists.sourceforge.net/lists/listinfo/jython-users > |
From: Edward P. <epo...@te...> - 2002-03-22 23:01:00
|
Hello All, I've look in the archives, but only see questions, and no answers relating to this. I have a folder hierarchy impi/core/ and a .class file impi/core/Impi.class when I 'from impi.core import *' from another module, I get 'java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: impi/core/impi (wrong name: impi/core/Impi)' Is there a quick fix for this? Thanks -Ed |
From: Jeff E. <je...@ad...> - 2002-03-22 16:44:17
|
Ashish, The default list cell renderer renders the objects in the list with the result of toString. Instances of Python classes do not return the result of __repr__ or __str__ for the Java toString method. You could write a replacement cell renderer that calls the __str__ method for PyInstances. Perhaps something like in Jython: class PyInstanceListCellRenderer(DefaultListCellRenderer): def getListCellRendererComponent(self,list, \ value, index, selected, focus): return DefaultListCellRenderer.getListCellRendererComponent(self,\ list,`value`,index,selected,focus) myList = JList(cellRenderer=PyInstanceListCellRenderer()) Jeff Emanuel BillWorker 2i wrote: > Okay, I just have modified your code to include a few more classes. If you > run the script you will see that only for PyClass5, the one that inherits > from java.lang.Object, the JList shows a proper string in the list. > > Ashish > > ---------- code --------- > import java > import javax.swing as swing > > class PyClass1: > pass > > class PyClass2: > def __repr__(self): > return 'PyClass2' > > class PyClass3: > def __str__(self): > return 'PyClass3' > > class PyClass4: > def toString(self): > return 'PyClass4' > > class PyClass5(java.lang.Object): > def toString(self): > return 'PyClass5' > > > class TestModel(swing.AbstractListModel): > def __init__(self): > self.classList = [PyClass1(), PyClass2(), PyClass3(), PyClass4(), > PyClass5()] > > def getElementAt(self, i): > return self.classList[i] > > def getSize(self): > return len(self.classList) > > > frame = swing.JFrame('test') > jlist = swing.JList(TestModel()) > frame.contentPane.add(jlist) > frame.pack() > frame.visible = 1 > > > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |
From: Michel P. <mi...@di...> - 2002-03-22 16:13:19
|
> I'd be grateful for any advice on this as I have not done this sort of > thing before. Alternatively if anyone knows of a good python gnutella > library (like Jtella), that would be an alternative solution. I have a CPython system (Zope) talking to a Jython system via xml-rpc. xmlrpcserver.py can be found at: http://www.pythonware.com/products/xmlrpc/index.htm it works fine in jython. Note, xml-rpc will only give you simple data pasing, numbers, strings, lists, "structs" etc. -Michel |
From: Stephen N. <ste...@co...> - 2002-03-22 15:29:26
|
I have a system made up of two parts. One in Jython and the other in CPython. The reason for this is that I could not find a Gnutella library in CPython, but I could in Java. Also I have been having difficulties with BerkeleyDB Java bindings, so I decided to use CPython's bsddb. Anyway, I would like the jython and python processes to communicate with each other. I was think of IPC using scokets, but I'm not sure if this is the best option. I'd be grateful for any advice on this as I have not done this sort of thing before. Alternatively if anyone knows of a good python gnutella library (like Jtella), that would be an alternative solution. Thanks Again. Stephen |
From: Michel P. <mi...@di...> - 2002-03-22 10:20:20
|
------------------- > > Thanks, Kevin ! I knew it must be something simple, but I definitely > couldn't find it after a quick look of the python documentation. > > As a matter of fact, I looked at the documentation python.org and I didn't > find any mention of the things that you mention. Could you please give me a > hint, where stuff like that can be looked up ? (I guess, other than the > source) The Python language reference: http://www.python.org/doc/current/ref/print.html -Michel |
From: Dave D. <d.j...@hu...> - 2002-03-22 10:14:26
|
Dear All, I have searched the archives and posted on the Junit list. No definitive answer, so trying again. ;) I have been using unittest with Jython but would like to use JUnit for teaching/illustrative purposes. The maillings suggest that use of JUnit and automatic suite generation is problematical due to reflection. I have tried using docstrings and jythonc but without much success. Does there exist a port of the JUnit distribution demo ( Money ) in jython that successfully works with GUI runner that I can use as a leg-up ? Many thanks David ________________________________________________________________________________ ******************************************************** * David Dench * * School of Computing & Mathematics * * The University of Huddersfield * * Tel: 01484 472083 * * email: d.j...@hu... * * web: http://scom.hud.ac.uk/scomdjd * ******************************************************** ________________________________________________________________________________ |
From: Jan W. <j.w...@sc...> - 2002-03-22 07:32:34
|
On Thu, Mar 21, 2002 at 11:02:06PM +0000, Stephen Naicken wrote: > Hi, ReHi, > I have read lots of stuff on creating the singleton design pattern usin= g > python and to be honest most of this information has left me confused. > What is the best way to create the singleton in jython? Well, in http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/66531 Al= ex Martelli argues that you don't want a singleton in most cases. He propose= s a different pattern he calls Borg. The implementation works just as well in Jython. Cheerio, --=20 J.W...@sc... - Fon +4970719457-257 Fax-211 science+computing ag - Hagellocher Weg 71-75 - 72070 T=FCbingen In case you're not a computer person, I should probably point out that "R= eal Soon Now" is a technical term meaning "sometime before the heat-death of = the universe, maybe". (Scott Fahlman) |
From: BillWorker 2. <bil...@in...> - 2002-03-22 06:45:04
|
Hey Brad, Are you porting the jwaa to jython?? Ashish |
From: Stephen N. <ste...@co...> - 2002-03-21 23:02:18
|
Hi, I have read lots of stuff on creating the singleton design pattern using python and to be honest most of this information has left me confused. What is the best way to create the singleton in jython? Thanks Stephen |
From: O'Brien-Strain, E. <eo...@ex...> - 2002-03-21 21:34:57
|
Another idiom is to use one of the dictionaries that the language provides such as "globals()" or the "__dict__" attribute of an object. For example: title = "My title" body = "Blah, blah" print """ <html> <head> <title>%(title)s</title> </head> <body>%(body)s</body> </html>""" % globals() __ Eamonn O'Brien-Strain HP Labs eo...@hp... ======================================================== > From: Ype Kingma [mailto:yk...@xs...] [...] > my = {} > my['title'] = "My title" > my['body'] = "Blah, blah" > print """ > <html> > <head> > <title>%(title)s</title> > </head> > <body>%(body)s</body> > </html>""" % my ========================================================== > From: Brad Cox [mailto:bc...@vi...] [...] > Does python have a way of interpolating variables into strings, along > the lines of this perl example? > > my $title = "My title"; > my $body = "Blah, blah"; > print """ > <html> > <head> > <title>$title</title> > </head> > <body>$body</body> > </html>""" |
From: Brad C. <bc...@vi...> - 2002-03-21 20:01:13
|
Thanks! I was afraid I'd have to import my java multi-line string preprocessor from java to do this in python. See http://virtualschool.edu/jwaa under Mls. At 8:39 PM +0100 3/21/02, Ype Kingma wrote: >Brad, > >>Does python have a way of interpolating variables into strings, >>along the lines of this perl example? >> > >my $title = "My title"; >>my $body = "Blah, blah"; >>print """ >><html> >> <head> >> <title>$title</title> >> </head> >> <body>$body</body> >></html>""" > >my = {} >my['title'] = "My title" >my['body'] = "Blah, blah" >print """ ><html> > <head> > <title>%(title)s</title> > </head> > <body>%(body)s</body> ></html>""" % my > >See http://www.python.org/doc/current/lib/typesseq-strings.html > >Regards, >Ype > > >-- > >_______________________________________________ >Jython-users mailing list >Jyt...@li... >https://lists.sourceforge.net/lists/listinfo/jython-users -- Brad Cox, PhD; bc...@vi... 703 361 4751 o For industrial age goods there were checks and credit cards. For everything else there is http://virtualschool.edu/mybank o Java Interactive Learning Environment http://virtualschool.edu/jile o Java Web Application Architecture: http://virtualschool.edu/jwaa |
From: Ype K. <yk...@xs...> - 2002-03-21 19:27:01
|
Brad, >Does python have a way of interpolating variables into strings, along the lines of this perl example? > >my $title = "My title"; >my $body = "Blah, blah"; >print """ ><html> > <head> > <title>$title</title> > </head> > <body>$body</body> ></html>""" my = {} my['title'] = "My title" my['body'] = "Blah, blah" print """ <html> <head> <title>%(title)s</title> </head> <body>%(body)s</body> </html>""" % my See http://www.python.org/doc/current/lib/typesseq-strings.html Regards, Ype -- |
From: Brad C. <bc...@vi...> - 2002-03-21 18:18:29
|
Does python have a way of interpolating variables into strings, along the lines of this perl example? my $title = "My title"; my $body = "Blah, blah"; print """ <html> <head> <title>$title</title> </head> <body>$body</body> </html>""" -- Brad Cox, PhD; bc...@vi... 703 361 4751 o For industrial age goods there were checks and credit cards. For everything else there is http://virtualschool.edu/mybank o Java Interactive Learning Environment http://virtualschool.edu/jile o Java Web Application Architecture: http://virtualschool.edu/jwaa |