writing two python commands in one line in command window

Page 1 of 1

8 Replies - 3502 Views - Last Post: 16 May 2012 - 02:39 AMRate Topic: //<![CDATA[ rating = new ipb.rating( 'topic_rate_', { url: 'http://www.dreamincode.net/forums/index.php?app=forums&module=ajax&section=topics&do=rateTopic&t=279197&amp;s=e0f6bf4e92a47b12a68ceff21b3ffe0c&md5check=' + ipb.vars['secure_hash'], cur_rating: 0, rated: 0, allow_rate: 0, multi_rate: 1, show_rate_text: true } ); //]]>

#1 sai_saketh92

Reputation: 0
• Posts: 12
• Joined: 10-May 12

writing two python commands in one line in command window

Posted 13 May 2012 - 08:59 PM

can two python commands be written in one line in command window? actually the task is to write and read serially simultaneously ,there should not be any time gap between them ,therefore i need to type two commands at single time in command window.

```ser.write('setphone-num1 09823232323')#-----------------setting phone number
ser.write('\r')
print y

```

this is in text editor ,but if i have to execute using command window then what is the solution?

Is This A Good Question/Topic? 0

Replies To: writing two python commands in one line in command window

#2 atraub

• Pythoneer

Reputation: 828
• Posts: 2,235
• Joined: 23-December 08

Re: writing two python commands in one line in command window

Posted 14 May 2012 - 05:45 AM

if you're asking if two command line arguments can be passed in simultaneously, the answer is yes. Could you clarify your question?

#3 sai_saketh92

Reputation: 0
• Posts: 12
• Joined: 10-May 12

Re: writing two python commands in one line in command window

Posted 14 May 2012 - 09:17 PM

atraub, on 14 May 2012 - 05:45 AM, said:

if you're asking if two command line arguments can be passed in simultaneously, the answer is yes. Could you clarify your question?

yes,the question is what is the required syntax for the sending two commands simultaneously in command line?

#4 atraub

• Pythoneer

Reputation: 828
• Posts: 2,235
• Joined: 23-December 08

Re: writing two python commands in one line in command window

Posted 14 May 2012 - 09:34 PM

Here's a link to the argparse module, give it a try, if you run into problems, show us what you got. I'll probably write a tutorial on this soon.

#5 sai_saketh92

Reputation: 0
• Posts: 12
• Joined: 10-May 12

Re: writing two python commands in one line in command window

Posted 14 May 2012 - 09:52 PM

atraub, on 14 May 2012 - 09:34 PM, said:

Here's a link to the argparse module, give it a try, if you run into problems, show us what you got. I'll probably write a tutorial on this soon.

it's is going all Greek to me.

#6 atraub

• Pythoneer

Reputation: 828
• Posts: 2,235
• Joined: 23-December 08

Re: writing two python commands in one line in command window

Posted 15 May 2012 - 05:30 AM

try the argparse tutorial, does this help?

• Saucy!

Reputation: 6243
• Posts: 24,012
• Joined: 23-August 08

Re: writing two python commands in one line in command window

Posted 15 May 2012 - 09:24 AM

#8 atraub

• Pythoneer

Reputation: 828
• Posts: 2,235
• Joined: 23-December 08

Re: writing two python commands in one line in command window

Posted 15 May 2012 - 12:06 PM

I'm hoping he just wants to pass in two args in 1 line, rather than process them simultaneously. I hope I hope.

• Saucy!

Reputation: 6243
• Posts: 24,012
• Joined: 23-August 08

Re: writing two python commands in one line in command window

Posted 16 May 2012 - 02:39 AM

I assumed threading based on this:

Quote

actually the task is to write and read serially simultaneously ,there should not be any time gap between them