[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
Shitty child programming error :(
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 12
Thread images: 2
File: protectyonetworks.jpg (52 KB, 500x304) Image search: [Google]
protectyonetworks.jpg
52 KB, 500x304
I'm VERY new to programming at the moment, just starting out with some python. I have this script here that I'm trying to run :

#!/usr/bin/python

from os import system

def pingz():
system('ping -c 5 %(ab)s' % locals())
return;
def trace_route():
system('traceroute %(cd)s' % locals())
return;
print("Bitch_Ass_Name's Web Utility:")
print("____________________\n")
print(" 1)Ping a website/IP Address.\n")
print(" 2)Trace the route to a website/IP Address.\n")
print(" 3)Whois inforation.\n")
choice = raw_input("What would you like to do? \n")
if choice == 1:
ab = raw_input("Please enter the domain name/IP address:\n")
pingz()
elif choice == 2:
cd = raw_input("Please enter the domain name/IP Adress:\n"
trace_route()
else:
print "Please restart the script...you trickster, you."


When I try running it I get a "File ./test2.py, line 22
trace_route()
^
SyntaxError: invalid syntax"

Why am I getting a syntax error for the trace_route but not pingz()? It's the same fucking syntax :( What am I doing wrong? Besides being a shitty programmer who can't RTFM
>>
Go fuck yourself.
>>
Forgot right parentheses ya dingus
>>
>>54386950
I appreciate the help, great community.
>>
>>54386940
eat shit, fuck off to /dpt/, and learn to use fucking code tags
>>
>>54386965
Which right parenthesis? I can't find any missing parenthesis :( Maybe that's what I get for trying to program without an IDE?
>>
>>54386976
The one literally right before where the error is you dumb nigger
>>
>>54386983
LOL I found out. I really do feel like a dumb nigger now. Thank you for the help though!! Here is a bonus bash script I made to parse Shodan for an IP's open ports and more. For my oh so friendly ne/g/ros :

#!/bin/bash

echo -n "Enter IP ADDRESS : "
read SHADOW

curl https://www.shodan.io/host/$SHADOW | egrep -wi -A1 --color 'Ports\open|Coun try|City|Organization|ISP|Hostnames|service-details|service-main'
>>
>>54386966
who said this was a community?
this is a board about technology not about homework or how to google stuff
go to r.eddit and paste your
Bitch_Ass_Name
shit there
>>
File: 640.png (166 KB, 640x360) Image search: [Google]
640.png
166 KB, 640x360
>>54387008
Heh
>>
>>54386940
>ab = raw_input("Please enter the domain name/IP Adress:\n")
>cd = raw_input("Please enter the domain name/IP Adress:\n"

what's the difference?
the variable.. and the )
>>
>>54387528
Yeah, lol I figured it out. The script still doesn't run because I'm a retarded negro, but I'm working it out <3
Thread replies: 12
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.