15,179 Topics
| |
Ok I have narrowed the problem down, and I'm hoping somebody knows the solution. Basically I have a pyGTK application, using widgets and all of that. I have stripped all of the gtk objects out except the gtk.main() initializer. I basically want to start a threading process, and still have … | |
Am I able to read or write to a file with this code or what is stumping me. The following is what I am suppose to do. Calculate each employee’s pay, and write it out to a sequential file. Be sure to include file I/O error handling logic. Include only … | |
Hi I am fairly new to python. I want to do a seating reservation program containing 32 seats so the users can reserve seats and unreserve seats. I know I need a class that sort of contains the seats, but I dont know how to make it.... I have made … | |
i have this code to simulated a walk going either forwards or backwards amd i need to modify it so that it can go either up, down, left or right. only problem is im stuck can you offer any advice? thanks [code] import random filename="walk1.txt" def randWalk(n): steps = 0 … | |
Hello, all professionals, I used subprocess.Popen to launch a process, right now I am planning to shut it down after a given time. Can I use subprocess.kill() to fulfill that? (I do not know how to do that cuz every time I will receive a error message.) [CODE] import subprocess … | |
I tried to generate permutations by using itertools module but its not working. [CODE=python] >>>print(permutations([1,2,3],3)) <itertools.permutations object at 0xa917c5c> [/CODE] Why is it so? and how do I make it work properly? | |
hi so i need to write a rock paper scissors game. when played in the command prompt it should look something like this user input is in [B]bold[/B] press q at any time to quit please choose rock(r), paper(p) or scissors(s): [B]r[/B] computer chose paper. you lose! your score: 0 … | |
Hi I'm new to python, I need a little help, i need to write a function that's has a radius parameter and retunes the circumference of the circle. anyone that's able to help ? sorry its not a lot of info to go on. | |
hello, can someone help me to do the graphic part of my program from latin letters to arabic numbers and visesersa? You write in the number/letters and then you push the arabic button or the latin botton and then it transelate.... Also i need a latin calculator which can + … | |
Hi All Hope you all are ok. I have a query on calculating frequency distribution. I have seven different files like the one I have attached which contains items as below in example. I want to know total how many times each pair occurs combining all these files. ex 208015_at … | |
Following the Python3 Tutorial for non-programmers I took on the exercise of creating "quit" and "lock/log out" options for a very simple program, as follows (comments in the code are pretty dumb and obvious, but they are notes for mydumbself): [CODE]#!/usr/bin/python3 # Filename: lockunlock.py password = str() logged = 2 … | |
How do I sort a list in Python alphabetically? The code that is used for Python 2 doesn't seem to work: [CODE=python] mylist.sort() [/CODE] Since the file I'm working with has all text in the same case, case doesn't matter here. Please help. Thanks. | |
I am using a sample from my book for testing a car class. I get this error and I am not sure why. I am only giving one argument that I can tell. Here is my error code: Traceback (most recent call last): File "G:\Python_Stuff\car.py", line 79, in <module> myCar.getVIN('V81FDX') … | |
Hi all. I'm having a bit of trouble implementing the basics of a multi panel GUI. Basically I need a GUI that will act as an in-dash display for a car. The home screen will offer the user the ability to chose a selection of buttons. For example, the 'settings' … | |
The following def is my assignment .. the problem is the accumulator pattern gets me very lost. I don't know how to write it.. I have asked my instructor for help and he refers me to the sad sad book we have been given. I DO NOT WANT THIS QUESTION … | |
Hello everyone, I was wondering, if I wanted to make my code a little smaller in one file, is it possible for me to import another file I made? E.G. (Very simple e.g. just for helping understand what I mean) Let's say I made a program that the user types … | |
I am trying to Subclass ElementTree with an abstract method. I have read in several forums that ElementTree is actually both a module and a class. I have been unable to get the subclassing to work. [CODE]from abc import ABCMeta, abstractmethod from xml.etree.ElementTree import ElementTree, Element, tostring class A(ElementTree): __metaclass__ … | |
Since I am a Python beginner, I was thinking about studying,and possibly working on some real-world software written in Python. So could you guys suggest some simple open source projects that I could use to study and, if possible, get involved with in development. Thanks. | |
I am trying to implement virtual LEDs on a Python window. I turn the LED "on" by drawing a green oval. I then use root.after() to schedule another call that turns the LED "off" by drawing a dark green oval. I use a 250ms delay. There are 4 active LEDs … | |
I am writing a program for python and need to create a loop that appends pay, hours, and wages to one list called lstEmp,and be able to exit the loop once you type in DONE. I am stuck please help. [CODE]def Input(): try: name=raw_input("Enter your first and last name: ") … | |
Hi am a noob working with Apache, mod_wsgi and python. Below is some sample code on the internet that will return "Hello World!" when i go to my local server: [url]www.localhost.com/py[/url] note: I do have WSGIScriptAlias /py "C:/Users/user/site/handler.py" in my httpd.conf [CODE] def application(environ, start_response): status = '200 OK' output … | |
# I'm trying to extract the url's from the below text, without the added html tags. Is there anyway I can get just parts starting with ( [url]http://)[/url] and ending with (")? # <a href="http://www.gumtree.sg/?ChangeLocation=Y" rel="nofollow">Singapore</a>, <a href="http://www.gumtree.com.au/?ChangeLocation=Y" rel="nofollow">Australia</a>, <a href="http://www.gumtree.co.nz/?ChangeLocation=Y" rel="nofollow">New Zealand</a>, <a href="http://www.gumtree.com" rel="nofollow">England</a>, <a href="http://edinburgh.gumtree.com" rel="nofollow">Scotland</a>, <a … | |
How can i highlight the whole line in Styledtextctrl in wxpython????I have been researching on it but i still could not get what i want. I want to highlight a whole line of sentence on the line position that i want. Can anyone help me on this???? Please........... Thanks :D | |
Ahoy Sailors! So I've been developing a networking application using Twisted. This can be divided into two parts. The Host and the Guest. I normally make and test such on my main Ubuntu Linux computer, Now the time has come to compile it for Windows. But straight out of left … | |
So what im trying to do is, if the user select his location then the listbox should be filled in with values. I always get [B]NameError: global name 'listcomputers' is not defined[/B] but i dont understand why. can anybody help me ? [CODE]import os import wx class MyForm(wx.Frame): def __init__(self): … | |
I am attempting to create code where the user can alter the A elements in the list continuously. If another letter in the list is replaced however, it should ask for new input from the user, and go back to the code where the user can alter A elements in … | |
Hello Everyone, I have a list of digits. What is the most efficient way to count the number of tokens between two known digits? Here is what I came up with: [CODE] def dis(l, a1, a2): i1 = l.index(a1) i2 = l.index(a2) distance = i2 - i1 - 1 return … | |
Hi Folks, I'm a noob but I'm slowly getting addicted to python. I've been hitting a wall for about 4 hours trying various things to no avail. It looks to me like it should work and runs without error but.... I expect the blockcount counter to be high (but it's … | |
| Hello! I wonder if anyone used google-diff-match-patch for fuzzy string comparisons, i.e., for finding a closest/most similar string? Can anyone explain and give some examples? Also, in genera, what would be the best matching algorithm in Python. I tried Levenshtein, but matches are not so good, and I tried difflib.get_close_matches … |
can anyone create a program for this? In this program, you will be creating a very simple pizza-ordering menu. At this pizzeria, there�s only one kind of pizza you can order: regular (cheese,) no toppings. Your choices are what size of pizza, and how many of them. You�ll need to … |
The End.