Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #90197 > unrolled thread
| Started by | vjp2.at@at.BioStrategist.dot.dot.com |
|---|---|
| First post | 2015-05-08 23:36 +0000 |
| Last post | 2015-05-10 02:18 +0000 |
| Articles | 10 — 7 participants |
Back to article view | Back to comp.lang.python
Jython from bathc file? vjp2.at@at.BioStrategist.dot.dot.com - 2015-05-08 23:36 +0000
Re: Jython from bathc file? Todd Vargo <tlvargo@sbcglobal.netz> - 2015-05-09 06:17 -0400
Re: Jython from bathc file? Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2015-05-09 20:29 +1000
Re: Jython from bathc file? vjp2.at@at.BioStrategist.dot.dot.com - 2015-05-09 21:04 +0000
Re: Jython from bathc file? Michael Torrie <torriem@gmail.com> - 2015-05-09 16:54 -0600
Re: Jython from bathc file? Dave Angel <davea@davea.name> - 2015-05-09 19:51 -0400
Re: Jython from bathc file? vjp2.at@at.BioStrategist.dot.dot.com - 2015-05-10 02:25 +0000
Re: Jython from bathc file? Rustom Mody <rustompmody@gmail.com> - 2015-05-09 19:36 -0700
Re: Jython from bathc file? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2015-05-09 23:26 -0400
Re: Jython from bathc file? vjp2.at@at.BioStrategist.dot.dot.com - 2015-05-10 02:18 +0000
| From | vjp2.at@at.BioStrategist.dot.dot.com |
|---|---|
| Date | 2015-05-08 23:36 +0000 |
| Subject | Jython from bathc file? |
| Message-ID | <mijh9c$nv6$2@reader1.panix.com> |
How do I do this in a .bat file?
Do I include the Jython or pipe it?
% CLASSPATH=$CLASSPATH:$RDBASE/Code/JavaWrappers/gmwrapper/org.RDKit.jar; jython
-Djava.library.path=$RDBASE/Code/JavaWrappers/gmwrapper
Jython 2.2.1 on java1.6.0_20
Type "copyright", "credits" or "license" for more information.
>>> from org.RDKit import *
>>> from java import lang
>>> lang.System.loadLibrary('GraphMolWrap')
>>> m = RWMol.MolFromSmiles('c1ccccc1')
>>> m.getNumAtoms()
[toc] | [next] | [standalone]
| From | Todd Vargo <tlvargo@sbcglobal.netz> |
|---|---|
| Date | 2015-05-09 06:17 -0400 |
| Message-ID | <mikmrd$f3q$1@news.albasani.net> |
| In reply to | #90197 |
On 5/8/2015 7:36 PM, vjp2.at@at.BioStrategist.dot.dot.com wrote:
> How do I do this in a .bat file?
> Do I include the Jython or pipe it?
>
> % CLASSPATH=$CLASSPATH:$RDBASE/Code/JavaWrappers/gmwrapper/org.RDKit.jar; jython
> -Djava.library.path=$RDBASE/Code/JavaWrappers/gmwrapper
> Jython 2.2.1 on java1.6.0_20
> Type "copyright", "credits" or "license" for more information.
>>>> from org.RDKit import *
>>>> from java import lang
>>>> lang.System.loadLibrary('GraphMolWrap')
>>>> m = RWMol.MolFromSmiles('c1ccccc1')
>>>> m.getNumAtoms()
>
This does not do that but for those who don't know Jython it can help.
@echo off
set "x=thequickbrownfoxjumpsoverthelazydog"
set "x1=%x:~11,1%%x:~1,1%%x:~29,1%%x:~0,1%"
set "x2= %x:~32,2%%x:~2,1%%x:~20,1%"
set "x3= %x:~5,1%%x:~0,1% %x:~32,2%"
echo %x1%%x2%%x3%?
pause>nul
--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)
[toc] | [prev] | [next] | [standalone]
| From | Steven D'Aprano <steve+comp.lang.python@pearwood.info> |
|---|---|
| Date | 2015-05-09 20:29 +1000 |
| Message-ID | <554de1a2$0$13006$c3e8da3$5496439d@news.astraweb.com> |
| In reply to | #90197 |
On Sat, 9 May 2015 09:36 am, vjp2.at@at.BioStrategist.dot.dot.com wrote:
> How do I do this in a .bat file?
> Do I include the Jython or pipe it?
>
> % CLASSPATH=$CLASSPATH:$RDBASE/Code/JavaWrappers/gmwrapper/org.RDKit.jar;
> jython
> -Djava.library.path=$RDBASE/Code/JavaWrappers/gmwrapper
> Jython 2.2.1 on java1.6.0_20
> Type "copyright", "credits" or "license" for more information.
>>>> from org.RDKit import *
>>>> from java import lang
>>>> lang.System.loadLibrary('GraphMolWrap')
>>>> m = RWMol.MolFromSmiles('c1ccccc1')
>>>> m.getNumAtoms()
I'm not sure I fully understand your question, but perhaps this will help.
I haven't used Windows for anything like this for decades, but I would
expect something like this:
(1) Create a file containing your Python code and call it "myscript.py" (or
any other meaningful name):
from org.RDKit import *
from java import lang
lang.System.loadLibrary('GraphMolWrap')
m = RWMol.MolFromSmiles('c1ccccc1')
m.getNumAtoms()
(2) Create a .bat file which calls Jython. I don't remember .bat syntax, but
perhaps it is something like this?
CLASSPATH=$CLASSPATH:$RDBASE/Code/JavaWrappers/gmwrapper/org.RDKit.jar;
jython -Djava.library.path=$RDBASE/Code/JavaWrappers/gmwrapper myscript.py
And that's it.
Does that work? Any Windows users like to comment?
--
Steven
[toc] | [prev] | [next] | [standalone]
| From | vjp2.at@at.BioStrategist.dot.dot.com |
|---|---|
| Date | 2015-05-09 21:04 +0000 |
| Message-ID | <milsp5$fg8$1@reader1.panix.com> |
| In reply to | #90197 |
Thanks.. I suspected it wasn't meant to be taken as in the file
THe one thing I'm not sure if Jython is suppsosedto keep running
after the initisl stuff is loaded in..
To put the question in purely DOS terms if you run a program can you pipe it
some commands and then keep it running to take the remaining commands from
the console?
- = -
Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus, BioStrategist
http://www.panix.com/~vjp2/vasos.htm
---{Nothing herein constitutes advice. Everything fully disclaimed.}---
[Homeland Security means private firearms not lazy obstructive guards]
[Urb sprawl confounds terror] [Phooey on GUI: Windows for subprime Bimbos]
[toc] | [prev] | [next] | [standalone]
| From | Michael Torrie <torriem@gmail.com> |
|---|---|
| Date | 2015-05-09 16:54 -0600 |
| Message-ID | <mailman.291.1431212091.12865.python-list@python.org> |
| In reply to | #90247 |
On 05/09/2015 03:04 PM, vjp2.at@at.BioStrategist.dot.dot.com wrote: > Thanks.. I suspected it wasn't meant to be taken as in the file > > THe one thing I'm not sure if Jython is suppsosedto keep running > after the initisl stuff is loaded in.. > > > To put the question in purely DOS terms if you run a program can you pipe it > some commands and then keep it running to take the remaining commands from > the console? No. When the sending program is finished, it will close the pipe. This is how it works on both Unix and Windows, if I'm not mistaken. On Unix you might be able to read from standard in until it's done, then connect to a pseudo-tty and do interactive things. This bypasses standard in though (which was connected to the pipe).
[toc] | [prev] | [next] | [standalone]
| From | Dave Angel <davea@davea.name> |
|---|---|
| Date | 2015-05-09 19:51 -0400 |
| Message-ID | <mailman.294.1431215521.12865.python-list@python.org> |
| In reply to | #90247 |
On 05/09/2015 05:04 PM, vjp2.at@at.BioStrategist.dot.dot.com wrote: > Thanks.. I suspected it wasn't meant to be taken as in the file > > THe one thing I'm not sure if Jython is suppsosedto keep running > after the initisl stuff is loaded in.. > > > To put the question in purely DOS terms if you run a program can you pipe it > some commands and then keep it running to take the remaining commands from > the console? > That's not a built-in feature of cmd.exe. However, it wouldn't be hard to write a data source (funny.exe) that took data from a file, and then from stdin, sending both in progression to stdout. Then you'd run the two programs as: funny.exe infile.txt | newprog.exe -- DaveA
[toc] | [prev] | [next] | [standalone]
| From | vjp2.at@at.BioStrategist.dot.dot.com |
|---|---|
| Date | 2015-05-10 02:25 +0000 |
| Message-ID | <mimfi7$sda$1@reader1.panix.com> |
| In reply to | #90251 |
I have to try this and see if there is ome kind of init file in jython/python
sorta like autoexec.bat. Ialso have no idea if the commands they provide are
all it takes to run the app or I have to stay in jython.. sorry, I'm thinking
at loud.. ok, thanks to all..
- = -
Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus, BioStrategist
http://www.panix.com/~vjp2/vasos.htm
---{Nothing herein constitutes advice. Everything fully disclaimed.}---
[Homeland Security means private firearms not lazy obstructive guards]
[Urb sprawl confounds terror] [Phooey on GUI: Windows for subprime Bimbos]
[toc] | [prev] | [next] | [standalone]
| From | Rustom Mody <rustompmody@gmail.com> |
|---|---|
| Date | 2015-05-09 19:36 -0700 |
| Message-ID | <4b8e872c-3c95-40c2-b32c-bc6d5d5bac0e@googlegroups.com> |
| In reply to | #90252 |
On Sunday, May 10, 2015 at 7:55:22 AM UTC+5:30, vjp...@at.biostrategist.dot.dot.com wrote: > I have to try this and see if there is ome kind of init file in jython/python > sorta like autoexec.bat. Ialso have no idea if the commands they provide are > all it takes to run the app or I have to stay in jython.. sorry, I'm thinking > at loud.. ok, thanks to all.. > Maybe this? http://www.jython.org/docs/tutorial/interpreter.html?highlight=pythonstartup#the-interactive-startup-file PS People here tend to prefer avoidance of top-posting http://en.wikipedia.org/wiki/Posting_style#Top-posting
[toc] | [prev] | [next] | [standalone]
| From | Dennis Lee Bieber <wlfraed@ix.netcom.com> |
|---|---|
| Date | 2015-05-09 23:26 -0400 |
| Message-ID | <mailman.297.1431228417.12865.python-list@python.org> |
| In reply to | #90251 |
On Sun, 10 May 2015 02:18:16 +0000 (UTC),
vjp2.at@at.BioStrategist.dot.dot.com declaimed the following:
>Tee from gnuutils??
>
I doubt Python would ever be ported to an archaic Z-80 system, but
TRSDOS 6 might have supported the desired function:
ROUTE *dummy TO file/spc
LINK *ki TO *dummy
(Or maybe *dummy to *ki; It has been 40 years -- I suspect if I powered up
the Mod III/4 the heads would snap off the floppy drives)
ROUTE creates a "device" connected to a device or file
LINK connects two devices together so I/O passes through both.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
[toc] | [prev] | [next] | [standalone]
| From | vjp2.at@at.BioStrategist.dot.dot.com |
|---|---|
| Date | 2015-05-10 02:18 +0000 |
| Message-ID | <mimf58$gov$1@reader1.panix.com> |
| In reply to | #90251 |
Tee from gnuutils??
- = -
Vasos Panagiotopoulos, Columbia'81+, Reagan, Mozart, Pindus, BioStrategist
http://www.panix.com/~vjp2/vasos.htm
---{Nothing herein constitutes advice. Everything fully disclaimed.}---
[Homeland Security means private firearms not lazy obstructive guards]
[Urb sprawl confounds terror] [Phooey on GUI: Windows for subprime Bimbos]
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.python
csiph-web