- Strength to Increase Rep
- +6
- Strength to Decrease Rep
- -1
- Upvotes Received
- 15
- Posts with Upvotes
- 12
- Upvoting Members
- 11
- Downvotes Received
- 2
- Posts with Downvotes
- 2
- Downvoting Members
- 2
I have a wx.DatePickerCtrl with the dropdown popup window that allows the user to pick a date from the calendar. What I would l like to have my program do is process an event when the user has clicked on a day in the dropdown calendar. Unfortunately the only native … |
|
it says the following: Write a function that converts the time to 24hr format. Examples [CODE] >>> time24hr('12:34am') '0034hr' >>> time24hr('12:15pm') '1215hr' [/CODE] so i wrote the following: [CODE] def time24hr(tstr): a = tstr.split(':') am = {'12':'00','1':'01','2':'02','3':'03','4':'04','5':'05','6':'06', '7':'07','8':'08','9':'09','10':'10','11':'11'} pm = {'12':'12','1':'13','2':'14','3':'15','4':'16','5':'17','6':'18', '7':'19','8':'20','9':'21','10':'22','11':'23'} if 'am' in tstr: return am[a[0]] + a[1][:2] … |
|
I stumbled on upon this anomaly in one of my programs and can't figure out why this is happening. I made a small test function that exhibits the same behavoir. It's like the local variables of my function are being saved after the function exits. The exclude_ids variable keeps growing. … |
|
I'm soliciting advice for performace improvements for creating a weak checksum for file segments (used in the rSync algorithm) Here's what I have so far: def blockchecksums(instream, blocksize=4096): from hashlib import md5 weakhashes = [] stronghashes = [] for chunk in iter(lambda: instream.read(blocksize),""): a = b = 0 l = … |
|
hello everyone i created a python file DailyExpensessave.py when i need to import this in another python program i was getting this error > Traceback (most recent call last): > File "C:\Python32\DailyExpensessave", line 1, in <module> > from DailyExpenses import * > ImportError: No module named DailyExpenses Both the python … |
|
I'm creating a little space shooter game. I need to limit the amount of times a player can fire, I'm setting a 2 second limit. But whenever I try to implement that it just won't work. The bullets keep firing multiple times a second. Here's my code, I'd be very … |
|
I came across this project that could be really helpful.. if I was c++ literate. I know enough c++ to be dangerous and thats about it. Thanks in advance for anyone who wants to take a crack at it. ps credit to: http://www.codeproject.com/Articles/13839/How-to-Prepare-a-USB-Drive-for-Safe-Removal |
|
This code snippet allows you to list the files in a folder sorted by "last modified date". The tuple returned by the os.stat() function contains amongst other things the last modified date, which is then converted by the time.localtime() function to a tuple that is ideal for sorting. You can … |
|
I am a beginner to pything and I am looking to monitor a directory and run a script everytime something is input into the directory. I am wondering the best method for doing this using python? Any point in the right direction I would appreciate. |
|
I just made a small program to spell check a provided sentence and point errors in the sentence. Actually, the program creates a list by reading data from text file which contains dictionary words and from there it tells whether the inputted word/s are in dictionary or not. I would … |
|
I'm trying to create a wx.ListCtrl with a searchable header. I've been looking through the listctrl mixins, but I really don't have the wx expertise needed. I'm thinking I need to paint a textctrl using a dc object, but other than that I'm lost. Any ideas? |
|
I'm doing some research to determine the most efficient way to copy files. I've got 3 candidate functions: #1 [CODE=python] # uses generator to load segments to memory def copy(src, dst, iteration=1000): for x in xrange(iteration): def _write(filesrc, filedst): filegen = iter(lambda: filesrc.read(16384),"") try: while True: filedst.write(filegen.next()) except StopIteration: pass … |
|
I'd like to ask the user if he/she wants to rerun a script. I've thought of doing that with a while. My problem is that both [CODE] import sys rerun = "y" while rerun == "n": sys.exit() else: print("do some stuff") rerun = str(input("Would you like to start again? [y/n]: … |
|
Write a program which asks the user to enter a username, and then a password. Then when they type the command “log off”, they will have to retype their username and password in order to log back on again. Please note i am using python 3.2.2. Regards Mark |
|
With a lot of help from ihatehippies I got threads working yesterday. Now I need to stop 'em! More specifically I want to stop a second thread starting until the first has finished.. This is what I have in my threading class at the moment: [CODE]class ProcessThread(Thread): """Test Worker Thread … |
|
Hello, I'm a python beginner and glad I joined this forum :). I'm wanting to make a simple program where the window is hidden for x seconds/minutes and is then shown again. My problem is that using time.sleep() causes the Hide() function to not run until after time.sleep() is complete. … |
|
I am looking at a source code There is a class called A and it has a parameter in its _init_ function called. Class A self.id = id There is another class called B and has a parameter in its __init__ function called Class B self.ide = ide There's an … |
|
I started looking into networking and storing/altering data on a computer. I've got everything running, but can't get it to work from an outside computer. Is there an easy way to get past the LAN restrictions or am I going to have to change settings on my router? |
|
So I need to write a function that if a file exists, it will change the file name by sequentially adding integers, starting with 1, to the base file name (the part that does not include the file extension). so if the filename is hello.dat, then it will return hello1.dat … |
|
I am having trouble correcting the syntax on this problem so far and I can't seem to find my mistake any ideas on what I am doing wrong ? The object of the program is to ask user for amount of money to put in the pot, and play until … |
|
I have a wx Gui that gathers all the necessary info and starts an external command line app. Whilst it is running my gui freezes as you'd expect so I've been experimenting with putting the external app in a thread of its own. My original code ends with the line: … |
|
Trying to help my brother who has just started learning Python at school. He's not the brightest so any help is appreciated. I consider this quite hard for someone who has barely started, although he has missed a few lessons through illness. Solution is welcome but please try to explain … |
|
I'm probably missing something really obvious, but I downloaded the Python 2.72 release, and now I can't figure out what to do. I've tried googleing it but everything says to just install it. Is that install the setup.py file? If it is, how do I run a python file if … |
|
Hi, Just started learning python..and want to learn to do this I want to read a text file that something like 10000 20000 30000 40000 20000 30000 88888 88888 60000 12333 44431 12345 I want to get the difference of numbers in column1 divided by x, where I want to … |
|
i've been having trouble figuring this out since im new to python and i really wanna figure it out! Write a Sentinel controlled While loop that allows the user to enter text until they enter ! by itself. Output would be like this: Enter some text: Hi Enter some text: … |
|
Hi, I'm pretty new to python, just started 2 weeks ago xD, and new to forum too, I tried to search to see if there were any other question that was similar to this but couldn't find one. Therefore, I apologize if there's already another thread with the similar problem. … |
|
I have a problem that I have been working on. I felt like I was getting close just to find out with wasn't the 100% correct way of doing it. What I need to do is take a list of names from a file in the format last, first, middle. … |
|
Hi team. I have the below code working 100% on my local machine. It makes the required updates and I am happy with it. But when I try to run it from the server, it gives the attached error message. Please ignore all other lines(I have just removed other lines … |
|
My very reason for getting involved with Python was to use it as a gui for some command line programs, like eac3to, sox and neroaacenc. Previously I'd been using batch in windows and had become quite proficient. In batch, a line to process audio with sox looks like this: [CODE]"tools\sox.exe" … |
|
Just wanted to point out for anyone using py2exe that it apparently doesn't always (or maybe ever) raise AssertionErrors. It's been a while since they've updated the program so it's probably just easier to implement a workaround for those of us who use this compiler. I've noticed it not raising … |