Sponsored Content
Full Discussion: Modify python script
Top Forums Shell Programming and Scripting Modify python script Post 303020445 by wisecracker on Thursday 19th of July 2018 03:53:44 PM
Old 07-19-2018
Quote:
Originally Posted by drew77
How can I modify this so it uses Seamonkey and goes to Yahoo Advanced Web Search

Code:
#!/usr/bin/python3
import os
import urllib
google = os.popen('zenity --entry --text="Enter what you want to google: 
" --title="google.py"').read()
google = urllib.quote(google)
os.system('firefox http://www.google.com/search?q=%s' % (google))

Thanks.
I have no idea how you got this script to work with this line:
google = os.popen('zenity --entry --text="Enter what you want to google:
What is your traceback error as this would certainly crash the script.
There are two methods to get out of this probable error:
1) google = os.popen('zenity --entry --text="Enter what you want to google: " --title="google.py"').read() on one line.
OR...
2)
Code:
google = os.popen('zenity --entry --text="Enter what you want to google: " \
--title="google.py"').read()

...using the escape '\' character at the end of the 'SPACE' character.
I would use the first...
I have no idea at all about 'zenity' so I have to assume the syntax is correct for that _command_.
As for SeaMonkey until I/we know what the 'google.py' script is I/we have no idea...

Last edited by wisecracker; 07-19-2018 at 04:58 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Is it possible in a shell script to modify itself ??

We are running a quiz and the data collected from the quiz is submitted to the database. My requirement is to write a shell script to get these submitted records. I should be able to run this shell script at any time and the records it returns should be the ones submitted after the script was... (5 Replies)
Discussion started by: sehgalniraj
5 Replies

2. UNIX for Dummies Questions & Answers

Using a script to modify the crontab

I want to add one line to the end of my crontab using a script. I have tried piping in the editor commands, but I can't get it to work. crontab -e user << EX $a This is the text I want to add. . wq EX This doesn't work. Is there an easier way to do this? (2 Replies)
Discussion started by: johnmsucpe
2 Replies

3. Shell Programming and Scripting

Modify Perl script to work with txt - Permissions script

Hi I have this code, and i want work with a ls -shalR output in .txt What i need read to do this?? Where start? #!/usr/bin/perl # Allrights- A perl tool for making backups of file permissions # Copyright (C) 2005 Norbert Klein <norbert@acodedb.com> # This program is free... (1 Reply)
Discussion started by: joangopan
1 Replies

4. Shell Programming and Scripting

Please help to modify my script

Hi, I have a script which connect to ATM's and pull two files from the ATM. The which i try to pull is like PIC20085200001*.JPG First 7 digit consist of year montn and date as well After todays execution i want to change the date to next date I add few lines in the script but it is not... (6 Replies)
Discussion started by: Renjesh
6 Replies

5. Solaris

Need help with script when trying to modify user

The script get a csv file with 2 colls for example: 123456,UNIX 963852,Microsoft the script supose to put the number in the Description of the user in this case UNIX or Microsoft the error i get is does not exist.OR: UNIX does not exist.OR: Microsoft but the users exist so i do not... (7 Replies)
Discussion started by: shatztal
7 Replies

6. Shell Programming and Scripting

how can I modify this script.

hello forum members, I have a script which is used find the Uname and passwords and redirects into a output.txt file.I hardcoded a string "ciadev" but iwant search two more strings also "absdev" and "absprod" So modify this script please. I am lookinmg forward from you, please find the below... (2 Replies)
Discussion started by: rajkumar_g
2 Replies

7. Shell Programming and Scripting

Modify /etc/passwd via script

We have a business need to modify the /etc/passwd file every time a new user gets added, because the user ID begins with a zero. When you create the new user in smit, even if you put the leading zero in, it does not retain it when the entry is added. That being said, I need to create a script... (11 Replies)
Discussion started by: mshilling
11 Replies

8. Shell Programming and Scripting

Help me to modify my script in stdout

please help me to modify my script #! /bin/bash while read line do echo "$line" >>/tmp/result && mysql -ss -e "use $line; select count(*) from users where type='admin' and deleted = 0;" > /tmp/result; done < /tmp/db_data cat result alan_hardwsdefs 2 bgrmods 2 claudiatdsefs 1... (2 Replies)
Discussion started by: unimaxlin
2 Replies

9. Shell Programming and Scripting

Modify sed script

I'm trying to take out strings from log files and add them to a csv. For example, in the directory now, there are 2 log files. I get the following results: sed -e '/custodian/b' -e '/packaged by/b' -e '/package name/b' -e '/Total Data (MB) Read/b' -e '/Begin Time/b' -e d * packaged by =... (10 Replies)
Discussion started by: chipperuga
10 Replies

10. Windows & DOS: Issues & Discussions

How to execute python script on remote with python way..?

Hi all, I am trying to run below python code for connecting remote windows machine from unix to run an python file exist on that remote windows machine.. Below is the code I am trying: #!/usr/bin/env python import wmi c = wmi.WMI("xxxxx", user="xxxx", password="xxxxxxx")... (1 Reply)
Discussion started by: onenessboy
1 Replies
PPROF(1)							      Google								  PPROF(1)

NAME
google-pprof - manual page for google-pprof (part of gperftools) SYNOPSIS
google-pprof [options] <program> <profile> DESCRIPTION
Prints specified cpu- or heap-profile OPTIONS
--cum Sort by cumulative data --base=<base> Subtract <base> from <profile> before display Reporting Granularity: --addresses Report at address level --lines Report at source line level --functions Report at function level [default] --files Report at source file level Output type: --text Generate text report [default] --gv Generate Postscript and display --list=<regexp> Generate source listing of matching routines --disasm=<regexp> Generate disassembly of matching routines --dot Generate DOT file to stdout --ps Generate Postcript to stdout --pdf Generate PDF to stdout --gif Generate GIF to stdout Heap-Profile Options: --inuse_space Display in-use (mega)bytes [default] --inuse_objects Display in-use objects --alloc_space Display allocated (mega)bytes --alloc_objects Display allocated objects --show_bytes Display space in bytes --drop_negative Ignore negaive differences Call-graph Options: --nodecount=<n> Show at most so many nodes [default=80] --nodefraction=<f> Hide nodes below <f>*total [default=.005] --edgefraction=<f> Hide edges below <f>*total [default=.001] --focus=<regexp> Focus on nodes matching <regexp> --ignore=<regexp> Ignore nodes matching <regexp> --scale=<n> Set GV scaling [default=0] EXAMPLES
google-pprof /bin/ls ls.prof Outputs one line per procedure google-pprof --gv /bin/ls ls.prof Displays annotated call-graph via 'gv' google-pprof --gv --focus=Mutex /bin/ls ls.prof Restricts to code paths including a .*Mutex.* entry google-pprof --gv --focus=Mutex --ignore=string /bin/ls ls.prof Code paths including Mutex but not string google-pprof --list=getdir /bin/ls ls.prof Dissassembly (with per-line annotations) for getdir() google-pprof --disasm=getdir /bin/ls ls.prof Dissassembly (with per-PC annotations) for getdir() COPYRIGHT
Copyright (C) 2005 Google Inc. SEE ALSO
Further documentation for google-pprof is maintained as a web page called cpu_profiler.html and is likely installed at one of the following locations: /usr/share/gperftools/cpu_profiler.html /usr/local/share/gperftools/cpu_profiler.html google-pprof (part of gperftools) February 2005 PPROF(1)
All times are GMT -4. The time now is 08:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy