15,175 Topics

Member Avatar for
Member Avatar for FreezeBlink

This is probably totally absurd, but...is it possible to, through Python, access the command line and use it? For instance, write a program that outputted all of the files in a given directory, much like cd [directory] dir would?

Member Avatar for rikxik
0
188
Member Avatar for nclouse

I am working on a TCP socket server for a client and i am having a problem. Everything works except for one thing: i can't figure out how to have the server tell the client that the server is going down. I have the SocketServer running as a windows service. …

Member Avatar for ich1
0
198
Member Avatar for frijole

I have a script that I would like to repeatedly run every 30 seconds, does anyone know how to do this? Also, a side question. Is it possible to have the output form the previous run replaced by the new output? Instead of it all stacking up every time the …

Member Avatar for frijole
0
1K
Member Avatar for frijole

I hava s script that runs continuously and checks my mail but I would like to add some way to kill the script. With a control+something, is there any way to do that?

Member Avatar for Freaky_Chris
0
101
Member Avatar for JCsniper

I need to integrate this script to the web how i can do that? help me please! import sys import gammu import os import copy, re import commands message = "" number = "" message = raw_input("Write a message") number = raw_input("Enter the number to send d sms") gam = …

0
44
Member Avatar for LanierWexford

I was looking at the code snippets, specifically "Petals around the Rose” and I wanted to see how it runs, so I copy, pasted and saved the file in my text editor as Petals and now I am trying to figure out how to run the code. As always I …

Member Avatar for Freaky_Chris
0
81
Member Avatar for ivy47469

Hi everyone, I am new to Python, I am stuck with this problem. "If your initially deposit $10000 into the account, and earns 6% interest per year, to meet your monthly expense, at the beginning each month you withdraw $500, how long the account will be depleted? if you withdraw …

Member Avatar for kdoiron
0
121
Member Avatar for Tyrfing

Hello, I have a program that generates several 1-dimensional arrays that I would like to conduct data analysis on. I was wondering if there was some sort of python tool (or module, or anything) that could write these arrays to a column of a spreadsheet ( in OpenOffice formatting). Is …

Member Avatar for kdoiron
0
164
Member Avatar for athirar

While executing programs with large lists ,i am encountering an error message: Index error:List index out of range The program works well with small lists..Can anyone suggest me some efficient methods to handle this problem?or Is there any other efficient datastructure other than lists and dictionary to serve the purpose …

Member Avatar for kdoiron
0
115
Member Avatar for nuaris

Lists have the append() function to add an item to the end of the list. Is there a similar function to add to the end of dictionaries? Update() doesn't seem to work. Example: >>> a = {'a':'a'} >>> b = {'b':'b'} >>> c = {'c':'c'} >>> a {'a': 'a'} >>> …

Member Avatar for nuaris
0
746
Member Avatar for axn

i can write to the file with no issues, but cant read. i have defined the file to append so as not to overwrite data. then i write to it [B]log_file.writelines(lines)[/B] but the reading wont work?? [B]log_file.readlines(lines)[/B] and thought i could just use log_file = open('%s' % os.path.join(logfile_path, file), 'a+r')

Member Avatar for bvdet
0
101
Member Avatar for swaroopk85

Hi all, I am connecting to https site using proxy and certificates.I am getting the error as httplib.BadStatusLine: None.Can anyone help me how can we fix this issue???what is the reason for this error?? Thanks & Regards, Lalitha.K

-1
43
Member Avatar for ymf

Hi, I am writing a cgi script for a web database query "results" page and I need to display the results in an html table. My question: 'Is there a way to print out a list of words without the commas and the square brackets?' e.g if this is the …

Member Avatar for Freaky_Chris
0
99
Member Avatar for Shank89

Hey guys, I am creating a new mini battle tanks game in python. Not gui based as of now. What it does so far is show a tank moving around a grid size of -10 to 10 Currently i have set it up as this far, just defined the coordinates …

Member Avatar for Shank89
0
133
Member Avatar for tondeuse34

Hey guys, i got another question. say if you want to only write a few lines of code that can be called on at any time the while the script is running, i'm assuming its the pickle function or something similar to batch like the goto function? Thanks

Member Avatar for tondeuse34
0
127
Member Avatar for Mackjan

Hi I have got the TypeError. I use lists at the same way in my other programs it works excellent, but just in this program I have got problem don’t know how to solve it? [COLOR="Red"]Traceback (most recent call last): File "E:\extra_b.py", line 42, in <module> ordna(pile) File "E:\extra_b.py", line …

Member Avatar for woooee
0
147
Member Avatar for jascase901

i recently started python and i wanna learn how to implement modules in my program, but when ever i try to string modules together it says function not callable how do u make functions callable and if u cant then how would u put this code 'readTextfile.py--reads and displays text …

Member Avatar for woooee
0
90
Member Avatar for alivip

How can I get every Token (word) and PreviousToken(Previous word) From text file For example if the text file content is "Every man has a price. Every woman has a price." First Token(word) is "Every" PreviousToken(Previous word) is none(no previos) Second Token(word) is "man" PreviousToken(Previous word) is "Every" Third Token(word) …

Member Avatar for Freaky_Chris
0
242
Member Avatar for MikeyFTW

Ok heres the deal i need to make this program that will allow users to practice their addition and subtraction for whole numbers between 1 and 100, 1 and 200 and 1 and 500 (the levels of difficulty). The user will be allowed to choose which operation to have questions …

Member Avatar for kdoiron
0
119
Member Avatar for bosko

Hi! I have a class: [CODE=python]class A(object): calledMethod = None def a1(self): pass def a2(self): pass[/CODE] Now when I create an object and call some method: [CODE=python]a = A() a.a1() #or a.a2()[/CODE] I need somehow to save the name of called method in variable calledMethod. Could this be done with …

Member Avatar for bosko
0
99
Member Avatar for sarabhjeet

HI all, whenever we open any python/wxpython program there is one more window other than our application is running which is command line window that black window for showing any error or any output through print statement.So i want to remove that window from my wxpython's application,how to do this?please …

Member Avatar for sarabhjeet
0
136
Member Avatar for Capt.Micro

Hi everyone, I have looked through the ctypes documentation, but can't find anything about making the mouse click, I mean, I can get it to move, but not click. Thanks in advance.

0
60
Member Avatar for Tigairius

Well, I need a pretty simple code (Lempel-Ziv-Welch compression algorithm) converted from Python to Java. I don't want to run JPython because I don't need it to be interpreted as Java, I need to interpret it myself because I use a scripting language similar to Java, but not exactly the …

0
48
Member Avatar for Smythville

G'day all, I am just starting to teach myself python and in the program below I am reading in a CSV file and moving files from one directory to another. I would like to be able to ensure that the user enters a Y or an N only, if they …

Member Avatar for Freaky_Chris
0
88
Member Avatar for Mackjan

Hi I have a function dela ( ) and I want to call it by user (c) times, but I get an error. [COLOR="Red"]Traceback (most recent call last): File "C:/Python25/My programs/extra_b.py", line 21, in <module> for j in range (c): TypeError: range() integer end argument expected, got str.[/COLOR][code=python] if __name__ …

Member Avatar for Mackjan
0
235
Member Avatar for ycf123

Hi, all I am studying Python recently. I have written a example code to create a GTK window. Below is the sample code: import pygtk pygtk.require('2.0') import gtk import gtk.glade import os import sys import re from signal import SIGKILL from math import floor from time import time import trace …

0
55
Member Avatar for zls11610
Member Avatar for behshad312

I can't upload very large files (more than 500 MB) on the site using ftplib library. Who shall help me?

Member Avatar for jrcagle
0
79
Member Avatar for sanoski

I'm pretty new to programming. I've just been studying a few weeks off and on. I know a little, and I'm learning as I go. Programming is so much fun! I really wish I would have gotten into it years ago, but here's my question. I have a longterm project …

Member Avatar for jrcagle
0
92
Member Avatar for Seagull One

This problem has been bugging me for the past few days. I've tried all sorts of different things to get it to work, studied my books, but nothing. It goes like this: Let's say I want my robot to recite the three laws of robotics. I can say, "Recite the …

Member Avatar for Seagull One
0
140

The End.