Unable to open a new cmd prompt in .exe file

This is the place for queries that don't fit in any of the other categories.

Unable to open a new cmd prompt in .exe file

Postby vengateshbabu » Mon Sep 16, 2013 7:52 am

Hi,

I am new to Python created small script. Its working fine and able to created multiple cmd prompts in .py but unable to create multiple cmd prompts in .exe. Could you please help me. Created .exe using py2exe.

Code: Select all

#!/usr/local/bin/python
import os
from Tkinter import *
import subprocess
class Example(Frame):
 
    def __init__(self, parent):
        Frame.__init__(self, parent)   
         
        self.parent = parent
       
        self.initUI()
       
    def initUI(self):
     
        self.parent.title("LOGGING TOOL")
       
        self.pack(fill=BOTH, expand=1)

        self.columnconfigure(1, weight=1)
        self.columnconfigure(3, pad=7)
        self.rowconfigure(3, weight=1)
        self.rowconfigure(5, pad=7)
       
        lbl = Label(self, text=" CAM Andriod Logging Tool")
        lbl.grid(sticky=W, pady=4, padx=5)
       
       
       
        abtn = Button(self, text="NETWORK SELECTION")
        abtn.grid(row=1, column=0)
        abtn["command"]=self.networkselection
        abtn["fg"]="blue"
       

        bbtn = Button(self, text="CONTEXT MONITOR")
        bbtn.grid(row=1, column=1)
        bbtn["command"]=self.contextmonitor
        bbtn["fg"]="blue"
       
        cbtn = Button(self, text="CAMSERVICE")
        cbtn.grid(row=3, column=0)
        cbtn["command"]=self.camservice
        cbtn["fg"]="blue"

        dbtn = Button(self, text="RSSI")
        dbtn.grid(row=3, column=1)
        dbtn["command"]=self.RSSI
        dbtn["fg"]="blue"

        ebtn = Button(self, text="QUIT")
        ebtn.grid(row=6, column=0)
        ebtn["command"]=self.quit
        ebtn["fg"]="red"

        fbtn = Button(self,text="SAVE LOG")
        fbtn.grid(row=5,column=0)
        fbtn["command"]=self.savelog
        fbtn["fg"]="blue"

        gbtn = Button(self,text="PING SERVER")
        gbtn.grid(row=5,column=1)
        gbtn["command"]=self.pingservers
        gbtn["fg"]="blue"




    def networkselection(self):
        p=('adb logcat -v time | grep -i "NETWORKSELECTION"')
        subprocess.Popen(p)
       
       

    def contextmonitor(self):
        subprocess.Popen('adb logcat -v time | grep -i "CONTEXTMONITOR"')

    def RSSI(self):
        q=('adb logcat -v time | grep -i "RSSI"')
        #os.system('adb logcat -v time  | findstr -i "RSSI"')
        subprocess.Popen(q)
       
    def camservice(self):
        subprocess.Popen('adb logcat -v time | grep -i "CAMSERVICE"')
        #os.system('adb logcat -v time  | findstr -i "CAMSERVICE"')
        #subprocess.Popen(p)

    def savelog(self):
        subprocess.Popen('adb logcat -v time > C:\logs\logcat1.txt')
        #os.system('adb logcat -v time > C:\logs\logcat1.txt')
        #subprocess.Popen(p)

    def pingservers(self):
        subprocess.Popen('adb logcat -v time | grep -i "SEVERURL"')
        #os.system('adb logcat -v time  | findstr -i "SEVERURL"')
        #subprocess.Popen(p)


def main():
 
    root = Tk()
    root.geometry("350x300+300+300")
    app = Example(root)
    root.mainloop()
    root.destroy()


if __name__ == '__main__':
    main() 

vengateshbabu
 
Posts: 1
Joined: Mon Sep 16, 2013 7:03 am

Return to General Coding Help

Who is online

Users browsing this forum: W3C [Linkcheck] and 5 guests