15,175 Topics

Member Avatar for
Member Avatar for l00kit

Hello all, I'm studying socket programming and have trouble when simulate a FTP server (I don't want to use pyftpdlib). The problem is when the client want to list the directory (LIST command) on the server, I do not find a way to send directory contents. here is the code: …

Member Avatar for l00kit
0
246
Member Avatar for robtyu

I am trying to figure out what I am missing to get this to work. I am not sure how to get the account balance to change as the user continues to do more transactions. Here is the code I've written so far but now I'm stuck. import math [CODE]def …

Member Avatar for woooee
0
5K
Member Avatar for python01

Hi all, I am trying to set up a system like Scatt or Notpel(alot simpler, but using basic principle), and i need to get the laser in an optical mouse to be able to track a laser or IR LED. so far I have managed to get the mouse to …

Member Avatar for python01
0
181
Member Avatar for rebo544

Hi I'm new with Python (I'm a genetics major who took a computing course as an elective) and I have an assignment that requires me to write a simple text based game. Its an exercise an working with lists, if, elif, and while statements. It also has to be able …

Member Avatar for ultimatebuster
0
380
Member Avatar for sravan953

[CODE]# A simple calculator x=input("What do you want to do? \n 1) Add \n 2) Subtract \n 3) Multiply \n 4) Divide \n") #This is a comment, note that single line comments start with a hash '#' """'x' is a variable. The 'input' statement accepts a number where as the …

Member Avatar for mak.smash
0
955
Member Avatar for sophanox

Hey guys, this is my first project since learning the python basics so please bear with me! I am trying to either portscan a host or ping sweep a class c network based on what the user specifies. The code is very basic I know but what's giving me issues …

Member Avatar for sophanox
0
6K
Member Avatar for ksmakkapawee

I have 2 arrays A = [good, bad, cat, frog] and B = [best, great, ill, evil, wicked, rotten, vicious, poor, nasty, puss, toad, paddock] and I want to match between 2 arrays with ironpython or c# Match Result!! [good : best, great] [bad : ill, evil, wicked, rotten, vicious, …

Member Avatar for richieking
0
123
Member Avatar for MrKnowNothing

Hello, I am knew here and not sure how to ask but I guess I will ask it here and if this is not where it goes feel free to tell me where to post it.....THANKS I am trying to write a recursive function Python program that will ask the …

Member Avatar for Rehab A
0
306
Member Avatar for Viasur

Hello everyone, I'm looking for a programmer that can make a small program for me. I have a buget so is kind of a small job. If anyone knows how to do this or knows a friend that can, let me know please. Here is the information of what I …

Member Avatar for richieking
0
146
Member Avatar for python01

Hi all, I was just wondering if it is possible to use python to send pulses of 5 v (default) through the parallel port. I have made up a circuit board to interpret the pulses, yet this isn't helpful since there are no pulses to receive. Here's some specs( maybe …

Member Avatar for python01
0
234
Member Avatar for Hoff123

Hi! I am kind of new at pygame and I can't use functions. I define the "screen" variable outside of all functions(the "screen" variable is the "window"), and I can't use it in functions. I know it has to be global, but that won't work. Anyway the best i can …

Member Avatar for Hoff123
0
5K
Member Avatar for people people

I am trying to make a simple game for class but I am getting hung up on one of the parts. There are two dice that roll and then you can input either the full sum or multiple numbers that equal the sum (ex. dice = 10 you could pick …

Member Avatar for TrustyTony
0
126
Member Avatar for bwbyron

So this is my original code. [CODE] import random hints = {"python" : "A program", "jumble" : "The act of mixing up", "easy" : "Facil is to Spanish as ____ is to English", "difficult" : "Not eaay, but ____", "answer" : "To ____ a question.", "xylophone" : "An instrument. Also …

Member Avatar for woooee
0
746
Member Avatar for MacUsers

Dear all, I was trying out OptionParser() and didn't quite understand who to use it correctly. This is my sample script: [code=python]#!/bin/env python from time import strftime from calendar import month_abbr from optparse import OptionParser # Set the CL options parser = OptionParser() usage = "usage: %prog [options] arg1 arg2" …

Member Avatar for MacUsers
0
206
Member Avatar for Micko

Hello, I'm using PythonWin and I have a problem. i don't know how to run script from Python shell Pythonwin Interactive Window). For example I wrote this code (from tutorial): [code] import sys print 'Begining... now...' for x in sys.argv: print x [/code] and I save it as Script.py in …

Member Avatar for danholding
0
2K
Member Avatar for kinto

Hello, I am stuck on how I have pass function arguments to the main method of my program. Here is my code: [CODE]network = [] def populateArray(): file = open('C:\\My Documents\\route.txt', 'r') for line in file: network.append(line) print "Network = " print network def main(): if __name__ == "__main__": main() …

Member Avatar for richieking
-1
260
Member Avatar for nosehat

What is the procedure in Python for opening a very large binary file in read/write mode, and overwriting individual bytes or sequences of bytes? I'm working with huge files that are many GB, and I would like to seek(arbitrary_long_integer), and overwrite what's there (instead of appending or inserting). I need …

Member Avatar for richieking
0
3K
Member Avatar for jeuxdeau2009

Im writing a blackjack program to train one to count cards using the Hi-Lo System. I found the engine online ( it was open sourced.) Instead of the code here using only numbers and Letters, i want to add only pictures of the cards instead of the numbers and card …

0
113
Member Avatar for zizuno

Basically I have an irc bot that connects to irc and listens to commands. Imports all of its functions from it. Here is some sample code with comments on what happens So my question is: how can I pass all of the information required to send irc information without reconnecting …

0
53
Member Avatar for rawrxiv

Good morning friends, I am having a weird little issue with python that I am certain stems from me failing to understand wtf is going on. I will give you the general disclaimer that I am a total programming beginner so I'll need some latitude :) The following snippet is …

Member Avatar for richieking
0
142
Member Avatar for BirdaoGwra

Hi, I am making a simple application where it reads and loads words from a text file into a ListCtrl(lc_report) in wxPython. There are only two column. i am loading it like this : [CODE]f=open('Test.txt','r') all_words = map(lambda l: l.split(" "), f.readlines())[/CODE] And in Test.txt file, there are some words …

Member Avatar for richieking
0
199
Member Avatar for sarfrazashfaq

HI All! I am creating a Python function that should set environment variable. My simple code is [I]#!/usr/bin/python import os os.environ['FK_DBO_PASS']="12345" print "After setting Environment Variable is ",os.environ['FK_DBO_PASS'][/I] When i execute this code file in command prompt it is giving me this result [I]After setting Environment Variable is 12345[/I] But …

Member Avatar for BearofNH
0
2K
Member Avatar for parijat24

[CODE]hi I am generating program to find keys in adictionary having same value in abig dictionary please see the example [B]cluster1 [/B]ENSTRUP00000000001 ENSTRUP00000000001 ENSTRUP00000001433 ENSTRUP00000030987 ENSTRUP00000031348 ENSTRUP00000033778 ENSTRUP00000034939 ENSTRUP00000036445 ENSTRUP00000041507 [B]cluster2[/B] ENSTRUP00000000004 ENSTRUP00000000004 ENSTRUP00000000270 ENSTRUP00000004241 ENSTRUP00000010453 ENSTRUP00000012064 ENSTRUP00000015898 ENSTRUP00000019830 ENSTRUP00000024116 ENSTRUP00000026101 ENSTRUP00000027201 ENSTRUP00000028303 ENSTRUP00000028313 ENSTRUP00000029002 ENSTRUP00000031498 ENSTRUP00000032796 ENSTRUP00000032823 ENSTRUP00000033498 ENSTRUP00000036274 …

Member Avatar for woooee
0
125
Member Avatar for dos_killer

when i write import win32print in my python command line (IDLE) it works fine and it is imported... but when i write import win32print in my py file then it gives an error says no module named win32print why am i not able to load the module when writing the …

Member Avatar for dos_killer
0
100
Member Avatar for Srynx

Hi! Just a quick question math.modf(x) is a python function that returns the fractional and integer parts of x. Both results carry the sign of x and are floats. Therefore, if I write, for instance, 5.4 to the python 2.6.6 command line I think I should get (0.4, 5.0) but …

Member Avatar for Srynx
0
104
Member Avatar for noonz

hi everyone so I am trying to do something after waiting a random number of seconds in a while loop.I have python22 installed and I am working on windows xp. The problem is that it time.sleep works fine the first time but returns the following error after that. I dont …

Member Avatar for woooee
0
932
Member Avatar for nightrev

I am having trouble writing a program that lists the perfect numbers less than 10,000 in JES. This is what I have so far. Can someone help me? [CODE]def perfect(): print "Perfect Numbers" count = 0 number = 4 while count < 10000: if sumsDivs(number): count = count + 1 …

Member Avatar for woooee
0
147
Member Avatar for nish88

hi everyone..... Can someone tell me 'how can we disable the close icon' which is found on upper left corner of a tkinter menu which is encircled in the picture below: Thanks in advance

Member Avatar for gleam.uahmed
0
4K
Member Avatar for HelloPeople1

Hi guys I finally finished my highscore list but i have one problem I have to sort it. I know how to sort regular list, but this is a bit different because of having the text in it. When I sort it I just get an weirdly sorted list. Does …

Member Avatar for slate
0
109
Member Avatar for lamba89

Hello, I have a problem using the MySQLdb library. I'm trying to insert values into my table but MySQL isn't showing them. What's more strange is the primary key is changing when I manually insert values using command prompt. Here's an example: [CODE] '786', '2011-02-16 14:52:38', NULL '787', '2011-02-16 14:52:52', …

Member Avatar for slate
0
169

The End.