sockets in python tutorial menu

User Tag List

Results 1 to 3 of 3
  1. #1
    karapidiola's Avatar Active Member
    Reputation
    51
    Join Date
    Mar 2008
    Posts
    166
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sockets in python tutorial

    how to import the socket function ? in every os should be:
    Code:
    import socket
    or
    Code:
    from socket import *
    at this part u can import what u want for example:
    Code:
    from socket import connect
    ok now the library was in our source lets make a socket

    Code:
    sck = socket.socket(socket.AF_INET,socket.SOCK_STREAM)
    this will make tcp socket with the first import way
    look this case that comes with the second import
    Code:
    sck = socket(AF_INET,SOCK_STREAM)
    now connect the socket to a server by using the second way to create a socket
    Code:
    host = "google.gr"
    port = int(80) #or skip that int its the same
    sck . connect((host,port))
    another way for it:
    Code:
    sck.connect(('google.gr',int(80)))
    now lets send data to the server
    Code:
    data = "GET / HTTP\1.1\r\n\r\n"
    sck.send(data)
    now lets recv data from a server
    Code:
    data_buffer = sck.recv(1024) # how many bytes we want to recv
    print data_buffer #to see the data
    thats the most important things about the sockets
    advanced tutorial for more things like backdoors and that staff in python will come soon stay tunned

    sockets in python tutorial
  2. #2
    Stimorol's Avatar Member
    Reputation
    6
    Join Date
    Jul 2008
    Posts
    19
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice, keep up the work, this forum needs more Python!

  3. #3
    lokelusa's Avatar Member
    Reputation
    1
    Join Date
    Aug 2009
    Posts
    2
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, just what i need

Similar Threads

  1. [Python] Awesome beginner level python tutorials.
    By Maisteri in forum Programming
    Replies: 2
    Last Post: 10-30-2012, 11:57 PM
  2. python video tutorial
    By mag1212 in forum Programming
    Replies: 1
    Last Post: 01-24-2010, 05:24 PM
  3. Full Old School Tutorial...
    By Gnaughty in forum World of Warcraft Exploration
    Replies: 11
    Last Post: 09-12-2006, 10:38 AM
  4. Game Hacking Tutorial!
    By lopolop in forum Community Chat
    Replies: 24
    Last Post: 06-29-2006, 08:39 AM
  5. Muling Tutorial
    By Matt in forum World of Warcraft Guides
    Replies: 0
    Last Post: 06-19-2006, 05:40 PM
All times are GMT -5. The time now is 01:56 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search