User Profile
Collapse
Profile Sidebar
Collapse
akilasekaran
Last Activity: Apr 13 '12, 08:38 PM
Joined: Feb 12 '12
Location:
-
oh wow i totally understood it.. thanks dwblas and bvdet :) -
i am familiar with split(),open() and read(). but my major concern is about the [1:].. i have neva come across such param with open(filename[1:]).
1.could u temme what [1:] signifies?
2.what is split function followed by [1] mean ?Leave a comment:
-
-
help on message splitting code
what is the actual function of code here. first and second lines are hard to figure out :-/Code:filename = message.split()[1] f = open(filename[1:]) outputdata = f.read() -
the error was all about indentation and proper port mentioning :-)Leave a comment:
-
-
i tried using indentation.. but the error comes in the print line following the client accept code. i.e 2nd line from try. :(Leave a comment:
-
-
actually the hello world program worked successfull when i did it without >>> .Thanks a lot.. but now another problem..
This program i wrote for server.
...Code:from socket import * s = socket(AF_INET,SOCK_STREAM) h=gethostbyname(gethostname()) print'host is ',h s.bind((h,9000)) s.listen(1) while 1: try: client, address = s.accept() print'connection from',addressLast edited by bvdet; Feb 12 '12, 04:51 PM. Reason: Please use code tags when posting code [code]....[/code]Leave a comment:
-
when i type in the python GUI i am unable to remove the >>>
may b am troublin u a lot.. :-DLeave a comment:
-
not only this program , but in other basic programs also i get the same syntax error.. but no error comes in a this one.. i wonder how..
...Code:#Python 2.7.2 (default, Jun 12 2011, 15:08:59) [MSC v.1500 32 bit (Intel)] on win32 #Type "copyright", "credits" or "license()" for more information. #import socket module from socket import * serverSocket = socket(AF_INET, SOCK_STREAM)
Last edited by bvdet; Feb 12 '12, 04:32 PM. Reason: Please use code tags when posting code [code]....[/code]Leave a comment:
-
-
-
D:\Python23>pyt hon hii.py
File "hii.py", line 1
Python 2.3.3 (#51, Dec 18 2003, 20:22:39) [MSC v.1200 32 bit (Intel)] on win
32
^
SyntaxError: invalid syntax
I got this when i tried to run the program from cmd line.Leave a comment:
-
Syntax error in python 2.3.4
i am new to the python codes.. i just started out hello world.. i ended up getting an "invalid syntax" error... but i was able to run a TCP server program from the very same version of python which is python 2.3.4
Iam perplexed !!
No activity results to display
Show More
Leave a comment: