15,175 Topics
| |
I'm trying to find a way to take a list of one-letter strings, for example, ['e', 'n', 'o', 't', 'r'] and find every order possible of these letters. I'll be able to, on my own, target the three words I would want for this, 'noter', 'toner', and 'tenor' (unless the … | |
I'm having a problem with 'os.path.getmtime'. I've been doing some research into generating '.pyc' files and I am able to retrieve the source modification time (in seconds) as recorded in the '.pyc' file. It is merely the second set of four bytes unpacked as a long integer. [code=Python] import random, … | |
When I am processing the data, I put them inside some beautiful data structure for convenience, but then again I am done with my work, and I want to save the result in hard drive, I need to store them in a txt file, and for later usage, I need … | |
Hi - I have tried and tried with this, googled and what knot, but to no avail. I just need the frame to clear. The code below shows the overlay problem which I tried clearing with all types of panel.Clear() / self.panel.Clear() combos etc. [CODE] import wx class MyFrame(wx.Frame): def … | |
I need to search for the hours of the day that each email was sent, then I need to create a dictionary from those. Then I need to print the dictionary at the end with the count of how many times an email was sent at each hour. Here is … | |
How do I copy folders using python? Shutil.copy doesn't work. it raises a permission denied error in windows | |
The program I'm trying to create is one where it asks for an amount of money, lets say 10 bucks. It will take the input and then randomly come up with an amount of change that equals the input. So for example if you were to enter 10 bucks it … | |
Hey everyone, I'm fairly new to python and have hit a brick wall in a program I'm writing. I need to read in a text file containing values (No problems here) the text file looks like this 10, .25, .26 12, .44, .34 4, .22, .56 The numbers 10, 12, … | |
I have problems running a compiled program with win32print and win32ui (to print an image) on a different computer. what shall i do? | |
Hi, does anyone know how to make barcodes images with python? I downloaded PyBarcode but it comes with no real help andi really dont know where to start. So does anyone know how to use pybarcode or some other module? | |
Hi im writing a program and one of the things i need it to do is get today's date and display it at various times. creating the date using 'datetime' i can do the problem is passing the created date strings to different classes i currently have 2 classes one … | |
I have a Frame called ChangeDirPanel and an other one called MyFrame, the last one is the top-lvl window and has a function called file_show_dir which updates a listbox in that same window. (both frames have their own class, is it better to have the same class?) I want to … | |
Hi, i'm writing a project for my A-level course in python and ive come to a problem, i know the forum rules say not to expect a quick sollution and i dont want that as i like to understand things instead of doing them blindly. i've written a class which … | |
Again I have problems with my classes :s I want to test if there is still text in the text_ctrl, if so it should give a warning in which you can chose to cancel, save or continue; but somehow the [icode]deditor.st = "continue"[/icode] is not passed :s [code=python]#!/usr/bin/env python # … | |
Hi, i download wmi from this: [url]http://timgolden.me.uk/python/wmi/index.html[/url] (windows version) [CODE=syntax] import wmi c = wmi.WMI () for process in c.Win32_Process (): print process.ProcessId, process.Name [/CODE] And run this script in Python 2.6 IDLE Show this error: Traceback (most recent call last): File "C:\Users\lola\Desktop\test.py", line 1, in <module> import wmi File … | |
I need help with something I'm working on. I'm new to python so bare with me. I have a string being randomly generated in such format (example): [CODE]F' B D D2 A2 C'[/CODE] [I]6 Letters from A to F with ether a number " 2 " or " ' " … | |
Hi, I want to parse a date and change the format using python. Date has the format like 'Mon Feb 15 2010' and i want to change the format into '15/02/2010'. Any one can help me. Thanks in advance. Nimmy | |
Hi Guys, I am trying to pass a c structure from C to Python. Write the recieved structure at Python to a file, read back the structure from the file at Python and send it back to C. I am passing the structure as an array of bytes and write … | |
I am creating a layout with some buttons. How can I add a layout in a function definition? | |
Hi, How can i check whether the GPRS connection is active or not using python? Is it possible to check it? Thanks in advance. nimmyliji | |
Hi all. Please edit/add/help me make this blackjack program work. Thank you. class Card: def __init__(self, suit, rank): self.rank = rank self.suit = suit if self.rank == 1: self.rank = "Ace" self.value = 11 elif self.rank == 11: self.rank = "Jack" self.value = 10 elif self.rank == 12: self.rank = … | |
Hi everyone. I am in the process of building a surfing conditions forecast site for the UK, and at the moment im really struggling with GRads software to produce a swell chart from GRIB files for the UK - (North West Atlantic). I have discovered that there is a different … | |
I have opened an image using the PhotoImage method of ImageTk How do I close the image. This is the scenario is I am using it in. I have 2 buttons, one each to open an image from disk & image from url. When I open either of them the … | |
I've read the documentation, but I still can't creat my own packages. How should the __init__.py look like? Cause i've tried to let it blank and some stuff like [CODE] my_package/ __init.py__ sub_pack/ __init.py__ test.py [/CODE] but it pointed syntax error If I don't write anything on it, no error … | |
import random class Card: def __init__(self, suit, rank): self.rank = rank self.suit = suit if self.rank == 1: self.rank = "Ace" self.value = 11 elif self.rank == 11: self.rank = "Jack" self.value = 10 elif self.rank == 12: self.rank = "Queen" self.value = 10 elif self.rank == 13: self.rank = … | |
How would I execute a command and have it's output returned as a list or string? For example (in Linux): [CODE]os.system("iwconfig")[/CODE] prints a list of wireless devices to stdout. How can I make Python see those results as a list or string so I can search for certain devices (like … | |
We're making blackjack and when we ask hit or stay, how do we make sure that the player gives us a valid response by typing either 'hit' or 'stay'? Thanks! | |
hi this is the corotuıne example writen in def [CODE]namelst=['Charles Darwin (1809-82)', "Darwin's principal works, The Origin of Species (1859)", 'and The Descent of Man (1871) marked a new epoch in our', 'understanding of our world and ourselves. His ideas', "were shaped by the Beagle's voyage around the world in", … | |
#it suppose to pıng but ıt ıs not workıng #do u know the reason why #thanks [CODE]from subprocess import call, STDOUT import time class pinger(object): def __init__(self, ip="192.168.2.1"): self.ip=ip self.succes=False self.timer=time.sleep(0.0) self.cnt=0 def wait(self): print "we are waiting. %s" % self.timer return self.timer def getwaiter(self): return self.wait def ping(self, i):#at … | |
Has anyone used this code to calculate quantiles? The code defines the function 'quantile'. If one runs the code and names the script file 'quanitle.py' and puts it in the same directory as another code file calling the function, why is the function not accessed???? Here's the copy-and-paste script for … |
The End.