[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

plz help how to print python variable using os.system

jitender001001

1/16/2008 1:29:00 PM

hi all
i m new to python and i have a problem of printing python
variable using os.system() in bash

!/usr/bin/env python

var = "/home/anonymous"
os.system("echo $var)

it is not working..
i want to print string using os.system() ....plz help
42 Answers

Lutz Horn

1/16/2008 1:41:00 PM

0

Hi,

On Wed, 16 Jan 2008 05:29:08 -0800 (PST), jitender001001@gmail.com said:
> var = "/home/anonymous"
> os.system("echo $var)

os.system("echo %s" % var)

Lutz
--
GnuPG Key: 1024D/6EBDA359 1999-09-20
Key fingerprint = 438D 31FC 9300 CED0 1CDE A19D CD0F 9CA2 6EBD A359
http://dev-random.dnsalias.net/0x6...
http://pgp.cs.uu.nl/stats/6EB...

jitender001001

1/18/2008 4:12:00 AM

0

Thanks Lutz.......


Grant Edwards

1/18/2008 4:46:00 PM

0

On 2008-01-16, Lutz Horn <lutz.horn@fastmail.fm> wrote:
> Hi,
>
> On Wed, 16 Jan 2008 05:29:08 -0800 (PST), jitender001001@gmail.com said:
>> var = "/home/anonymous"
>> os.system("echo $var)
>
> os.system("echo %s" % var)

Though one wonders why one would do that instead of simply doing

print var

--
Grant Edwards grante Yow! I'm ZIPPY the PINHEAD
at and I'm totally committed
visi.com to the festive mode.

dsi1

5/16/2014 7:42:00 PM

0

On Friday, May 16, 2014 8:23:36 AM UTC-10, andrewro...@gmail.com wrote:
> On Friday, May 16, 2014 1:03:59 PM UTC-5, dsi1 wrote:
>
> > On 5/16/2014 6:33 AM, andrewrobinson956@gmail.com wrote:
>
> >
>
> > >> As for fish, nothing beats fresh catfish fillets, lightly breaded with
>
> >
>
> > >>
>
> >
>
> > >> a 60/40 mixture of cornmeal and flour that's been seasoned with
>
> >
>
> > >>
>
> >
>
> > >> Lawry's seasoned salt and black pepper, and perfectly fried in
>
> >
>
> > >>
>
> >
>
> > >> peanut oil. I'm just sayin'!
>
> >
>
> > >>
>
> >
>
> > >> TWs
>
> >
>
> > >
>
> >
>
> > > The best fish are (in order):
>
> >
>
> > > 1) walleyes
>
> >
>
> > > 2) Yellow perch
>
> >
>
> > > 3) Chilean sea bass
>
> >
>
> > > 4) Larry's red herrings
>
> >
>
> > > 5) channel cats
>
> >
>
> > >
>
> >
>
> >
>
> >
>
> > Mostly we eat ocean fish over here. I don't believe that I've ever seen
>
> >
>
> > a walleye, although the image of wall eyes are pretty vivid in my mind.
>
> >
>
> > We have some channel cats of good size in Nuuanu reservoir. Most our
>
> >
>
> > freshwater fish have been killed of by the tilapia. Sorry for using that
>
> >
>
> > word. I've certainly had my gut fill of red herrings though.
>
>
>
> I have some tilapia. I roast them in butter, garlic and lemon juice. Not that bad.
>
> Walleyes look like they cataracts. They also like to go to deep water. So deep that when you pull them up. their eyes bug out.

I googled the walleye. They seem to be quite the capable fish. They look fast, with a great set of choppers and what a set of fins!
>
> Did you get red herrings packed in bullshit?

That sounds like something the Swedes would eat. :-)

Andrew Schulman

5/16/2014 10:35:00 PM

0

On Friday, May 16, 2014 6:12:32 PM UTC-4, wollybyrde wrote:
> sea bass, because the joke doesn't work with tooth fish
> http://javelinabomb.blogspot.com/2010/03/you-cant-sea-bass-until-you-see...

Good point. On the other hand, Patagonian toothfish have a lot of good points.

Andrew

Andrew Robinson

5/17/2014 1:53:00 AM

0

On Friday, May 16, 2014 8:34:21 PM UTC-5, dsi1 wrote:
> On 5/16/2014 12:12 PM, wollybyrde wrote:
>
> >
>
> > sea bass, because the joke doesn't work with tooth fish
>
> > http://javelinabomb.blogspot.com/2010/03/you-cant-sea-bass-until-you-see...
>
> >
>
> That's the friendliest fish I ever seen. I wouldn't have the heart to
>
> cook and eat his little heart. He looks so happy, it makes me happy.

a patagonian toothfish looks viscious and mean
http://michaelmcmahon.com/names-are-a-big-deal-in-marketi...

dsi1

5/17/2014 2:12:00 AM

0

On 5/16/2014 3:52 PM, wollybyrde wrote:
> On Friday, May 16, 2014 8:34:21 PM UTC-5, dsi1 wrote:
>> On 5/16/2014 12:12 PM, wollybyrde wrote:
>>
>>>
>>
>>> sea bass, because the joke doesn't work with tooth fish
>>
>>> http://javelinabomb.blogspot.com/2010/03/you-cant-sea-bass-until-you-see...
>>
>>>
>>
>> That's the friendliest fish I ever seen. I wouldn't have the heart to
>>
>> cook and eat his little heart. He looks so happy, it makes me happy.
>
> a patagonian toothfish looks viscious and mean
> http://michaelmcmahon.com/names-are-a-big-deal-in-marketi...
>

Ain't no doubt about it - that Patagonian toothfish is one bad
motherf***shut yo mouth!

The transformation of this nasty, evil, devilfish to the docile, happy,
sea bass could be used on humans with a high spousal disparity
coefficient. If your coefficient is approaching 1 - i.e., you're a crazy
old geezer that thinks he's Jesus, you need this treatment! As far as I
know, this involves getting skewered through the gut with a speargun and
being dragged behind the wake of a large fishing vessel.

Andrew Schulman

5/17/2014 4:17:00 PM

0

On Friday, May 16, 2014 9:52:58 PM UTC-4, wollybyrde wrote:
> a patagonian toothfish looks viscious and mean
>
> http://michaelmcmahon.com/names-are-a-big-deal-in-marketi...

Yeah, it's been some time that I've been hearing about the severe overfishing and fortunately, since I know in the cases I've asked where they said they knew about the overfishing, I don't see it being served much for a while.

Andrew

John Nguyen

5/17/2014 4:52:00 PM

0

On Saturday, May 17, 2014 12:16:44 PM UTC-4, Andrew Schulman wrote:
> On Friday, May 16, 2014 9:52:58 PM UTC-4, wollybyrde wrote:
>
> > a patagonian toothfish looks viscious and mean
>
> >
>
> > http://michaelmcmahon.com/names-are-a-big-deal-in-marketi...
>
>
>
> Yeah, it's been some time that I've been hearing about the severe overfishing and fortunately, since I know in the cases I've asked where they said they knew about the overfishing, I don't see it being served much for a while.
>
>
>
> Andrew

Thanks for making Saturday morning perfectly clear to me, and I really appreciate the effort.
Cheers,

John

Slogoin

5/17/2014 4:56:00 PM

0

On Saturday, May 17, 2014 9:16:44 AM UTC-7, Andrew Schulman wrote:
>
> Yeah, it's been some time that I've been hearing about the severe overfishing

Not just fish but the whole ocean and riparian areas are getting clobbered by us. Sadly invasive critters and plants are really off the radar while we run around looking for someone to blame.

Recently a leader of one island nation suggested their military blow the poachers out of the water, and I know people who honestly believe their government should let the people shoot "illegals" who are the ones they blame for over fishing.

There is a lot of work in education and there are limits to what we can do without understanding how connected we are. The recent Red Lobster deal will have a direct impact on people I know and the ecology of their island nation.

Our choices matter but it's all cost shifted so we can't see how messed up it is. The old islanders talk about lobster covering the beaches so you could just pick up a bucket and have a great meal, and there are pictures of them doing that in the 60s. In my lifetime our exponential growth and increasing mobility have made our globe into a giant trash pit. We are pathetic and the future will not be kind to us.