Tagged Questions
1
vote
3answers
25 views
Enter data in dictionary from two arrays
I have the following two arrays which I want to merge in a dictionary:
# Input:
wrd = ['i', 'am', 'am', 'the', 'boss', 'the', 'tiger', 'eats', 'rice', 'eats', 'grass']
cnt = [0, 1, 2, 3, 4, 5, 6, 7, ...
3
votes
3answers
53 views
How can I print a string on the same line as the input() function?
This may seem a bit silly or obvious to a lot of you, but how can I print a string after entering an input on the same line?
What I want to do is ask the user a question then they enter their input. ...
-2
votes
4answers
50 views
How to make my program do tasks in parallel?
I wrote a program in python & it works great,
It reads file names with specific extensions, searches a database on the network & renames them to a new name .
But it's too slow. It does this ...
0
votes
0answers
34 views
how can i impliment the following using python
how can i find statical co_occurrence of words in a text? and replace the most frequent word with the less frequent one,and then how can i use this words for indexing?
i tried this:
'''read document ...
0
votes
1answer
15 views
QT : Disable keyboard shortcut for quitting mac application or identify allow only closebutton event to quit application
In Mac Command + Q keyboard shortcut quits most of the applications.
In my case, I want to disable it for my application which I have developed in QT.
Or Is there any way to identify the close event ...
2
votes
3answers
50 views
Python - Error when trying to add comments
I am learning about reading/writing strings, lists, etc to txt/dat files. I wanted to add a comment in my code so I can refer back to what the access keys are. So this is what I did.
# Mode ...
0
votes
4answers
44 views
Separate a list into sublists?
I have a list that is like this:
l = ['a,b,c,d' , 'a,b,c,d', 'a,b,c,d', 'a,b,c,d']
and I want to make it so that the list is formatted like this:
l = ...
1
vote
2answers
21 views
Caesar cipher fails when output character is beyond 'z'
Just to be clear, I am asking this because I have tried it for about 1.5 hours and can't seem to get any results. I am not taking a programming class or anything but I have a lot of free time this ...
0
votes
0answers
14 views
Copy table from excel file to word document at bookmark in python
I have a data in excel file. I want to copy data from excel file to word document and want to paste data with table at bookmark. I found one thing in word is, use destination style option but May I ...
0
votes
2answers
33 views
getsizeof always 40 in python for each field in a csv [duplicate]
So I am reading a csv file row by row. Inside each row I go field by field and try to get the size of each field in bytes suing .getsizeof. The code is below :
for row in reader:
temp1 = []
...
0
votes
0answers
17 views
List value check and iteration issues in csv edit for IP subnets with no overlap
I am trying to get all of the subnets in a network with no overlap in any of the ranges. I am currently using this:
Zone Name, IPStart, IPStop,Range,Source
Group A ...
0
votes
1answer
29 views
Python generator function premature end exception
What exception should a Python generator function raise when it ends prematurely?
Context: searches of trees represented as classes with __iter__ defined allowing code like for i in ...
-1
votes
3answers
51 views
python skip useless data and read specific line [on hold]
my text file has 20 pages long and i need to print specific data
my text file looks like:
123mcx version 1.5.0 ld=fri Apr 09 08:00:00 MST 2008 12/10/12 11:59:03
...
0
votes
1answer
35 views
How do I write to a website/HTML Documet using python 3?
I'm using python 3 and I was able to read the code from my html document but i was unable to write to it. How would I go about this. I'll show you what I mean:
import urllib.request
...
1
vote
1answer
20 views
Scheduler going idle under multithreading
I'm running Python 3.3.2, Win7/Pro, 64-bit and have some code in which I'm trying to run a scheduler in its own thread. It appears that when the scheduler empties its working queue, it goes idle and ...