15,179 Topics

Member Avatar for
Member Avatar for willygstyle

Hey all, I've figured out how to monitor changes in a directory. But is it possible to monitor if a user is accessing a directory. I assume that when you click on a folder to change directory that triggers some event, but what event and how would I get access …

0
53
Member Avatar for nickcampbell

Hi, I've got two tables in a database - one a list of schools (around 50 entries), and one a list of pupils (around 17,000). Both are spatially-attributed using PostGIS. Basically I need to allocate each pupil to their nearest school. Currently I'm looping through the schools repeatedly, using the …

Member Avatar for woooee
0
2K
Member Avatar for blade18

Hi Guys, I need to modify this script so that is also scan a range of host. [CODE] import socket import sys import fileinput import re import time from optparse import OptionParser usage = "./%prog -t target -p port -i input file -P proxy\nExample: ./%prog -t 74.52.252.187 -p 25 -f …

0
55
Member Avatar for Lingson

hi, I'm newbie in python and I'm using python 3.1 From the project ideas thread, I try to write a small module to calculate your age in years, months and days. Calculating the ages without the month (only years and days) would be easy, but adding the months makes me …

Member Avatar for leegeorg07
0
141
Member Avatar for kavingray

I’ve developed a twitter bot @Twity001 provides with useful information.It’s an auto reply bot.So you have to send a direct reply message to this bot to get information. Well,Twity is developed in Python.With the help of Cron job of GAE(I upload this program to gae btw),the program get the latest …

Member Avatar for sravan953
0
123
Member Avatar for nani123

I have a python script whihc logs in some file. This script calls some outside bat file which also logs in same file. The out side program complains that it cant get lock on log file. The python script has lock to log file so it has to temporarily release. …

Member Avatar for Stefano Mtangoo
0
228
Member Avatar for mn_kthompson

A couple weeks ago I was reading a thread about character counting and Vegaseat made the comment that [QUOTE]Function calls are time expensive in Python, so I modified Sneekula's count_char2() approach by replacing all those calls to islower(), isupper(), isdigit() and isspace(), and also changing the order of if/elif to …

Member Avatar for vegaseat
0
263
Member Avatar for EAnder

Im confused and I need to know how to read from a tkinter textbox in order to create a text editor. Also would it be possible to have certain words colorized as you type in words? I would like to make this into a code editor possibly. Any help would …

Member Avatar for vegaseat
0
817
Member Avatar for someone112

hello there everyone , i am trying to compile a python script into exe , i tried both py2exe and pyinstaller and both cannot produce an exe without errors... when trying to compile simple scripts , the resulted exe works fine..... both programs after compilation displayed error messages requesting modules …

Member Avatar for snippsat
0
101
Member Avatar for mayanktalwar
Member Avatar for sneekula
0
68
Member Avatar for goldy736

hi , i just started working in python , am using postgresql connected using turbo gears , python . I have connected to DB modifying the dev.py , I want to display a created table from postgre sql in web browser using python turbo gears , my table in the …

0
67
Member Avatar for Stefano Mtangoo

Hello All, I want to copy zipped file from one machine to another in same network. I have the IP and folder of destiny machine, but I'm pondering on the best way to go! transfering among same drive, I will use shutil module. But what about networked PCs? Should I …

Member Avatar for Gribouillis
0
219
Member Avatar for trayres

Hi everyone - I've got a C function that doesn't have a return type. Instead, its argument is a pointer to an array of doubles (the array is four doubles long - so the argument to the function is a pointer to the first one). So this function takes this …

0
63
Member Avatar for computerfreak97

I don't know why this isn't working properly, it is supposed to use different colors every time you specify a new color, but it is not. [code] import pygame, os pygame.init() pygame.display.init() screen = pygame.display.set_mode((830, 620)) draw = 0 selected = 0 points = [] col = [0,0,0] selectedtxt = …

0
40
Member Avatar for sravan953

Hey guys, I wanted to make a simple Python program to send an email to my Gmail account. So: [code=python] import smtplib sobj=smtplib.SMTP("smtp.gmail.com") sender="sravan953@gmail.com" rec="sravan953@gmail.com" msg=""" From: From Person<sravan953@gmail.com> To: To Person<sravan953@gmail.com> Subject: Test Does it work? """ sobj.sendmail(sender,rec,msg) [/code] -but it doesn't work, it shows an error [code] Traceback …

Member Avatar for BDG
0
6K
Member Avatar for OffbeatPatriot

I programmed a a neural network class in python using numpy. I had some trouble getting it to work properly, in my case I wanted to train it with back propagation to approximate XOR, but then it started working, then it didn't, and overall it only seems to work sometimes. …

Member Avatar for OffbeatPatriot
0
166
Member Avatar for hkfwy

Hi, I'm using Python 3.1, and got some confusion when using eval. The code is in the following [ICODE] from datetime import date globalDict = dict() globalDict['today'] = date.today globalDict['date'] = date globalDict['__builtins__'] = None #date.today() funName = input('please input the function name: ') result = eval(funName, globalDict) print("The result …

0
39
Member Avatar for fallopiano

hi all. This might be more of a math problem then anything, but i'll give it a shot. I have an idea for a game i am working on, in which the player must advanced thru a level my the means of propelling a cube in the air (across the …

Member Avatar for Gribouillis
0
140
Member Avatar for Lingson

hi, I'm using python 3.1 Is it possible if I run two applications at once? For example, if I make a clock/timer application with alarm etc, then I want exercise with my python, creating other codes, and running it. Is it possible? If I can make the application as stand-alone …

0
57
Member Avatar for hydrobat

Hi! I've made a small program for an assignment and it works as it should. There's just one problem; the code contains two global variables. I won't pass the course unless I get rid of them and it's been bugging me for weeks. The program: [CODE] ##This program simulates a …

Member Avatar for hydrobat
0
1K
Member Avatar for bumsfeld

What is more efficient? 1) import math 2) from math import * 3) from math import sin, cos

Member Avatar for Stefano Mtangoo
0
115
Member Avatar for leegeorg07

hi im making a chat program and im having a spot of trouble with a small part of code: [code=python] #def_unknown word_list=open("words.txt", "a") never_save=open("banned.txt", "a") def define_word(word): if word not in never_save.readlines() question="do you want to save %s? (y=yes n=not this time nn=no never)"% word define = raw_input(question) if define.lower()=="y": …

Member Avatar for woooee
0
115
Member Avatar for mediachicken

Hey guys! I'm working on a program in python with Tkinter that allows you to enter in a bunch of number and such, and generate an image. So, I have PIL creating a blank PNG image and saving it, it all works... Now I want to add stuff to the …

Member Avatar for Ene Uran
0
2K
Member Avatar for zachabesh

Hi all, Here's my issue: [CODE=python]>>> a = [1,2,3] #all good so far >>> b = a #make a copy of a, called b >>> b.remove(1) #remove value 1 from b ONLY >>> print a #grrr, value has also been removed from a [2, 3] >>> print b #and b! …

Member Avatar for zachabesh
0
100
Member Avatar for mattlew62

I am new to programming and python in general I have written a couple of beginner programs now I am working on my first one and I have hit a bump I am using the IDLE interface and using 2.5. I have a repetitive task I do at work which …

Member Avatar for woooee
0
156
Member Avatar for sravan953

Hey, I just learnt the basics of smtplib module, and now know how to successfully send emails using Python. My next step is to learn how to use Python to 'use' the web, as in, download files from a specified URL, or something like that. What module is required for …

Member Avatar for Dan08
0
102
Member Avatar for leegeorg07

i have a program that converts text into morse code and then outputs it using a module i found in the snippets section but whenever i try to run it, it raises the error that "utext is not iterable" here is the code: [code=python] morse_code={ "a":beeps.a(), "b":beeps.b(), "c":beeps.c(), "d":beeps.d(), "e":beeps.e(), …

Member Avatar for leegeorg07
0
94
Member Avatar for leegeorg07

hi i was wondering if there are any open source projects looking to take on people in a sort of internship? I looked on sourceforge but i couldnt find anything thanks in advance

0
55
Member Avatar for BigTurtle

Dear wizards, here are two easy wxpython questions. Thanks in advance for your help! 1. How do I get wxpython to activate a button when user presses "Enter"? In the baby application below, pressing "Tab" switches the focus from one button to another, but I don't know how to make …

0
66
Member Avatar for kk2628

Hi, I can use webbrowser.open_new(url) to open an browser window easily, but how do I close this browser window ? I have searched the web and still not able to find a solution. Another way of doing this might be to start the browser window in a separate program (progA) …

Member Avatar for kk2628
0
6K

The End.