1
vote
4answers
28 views
Python: Finding the average stock value for each month
Basically I have a list of tuples that include a data and price, something like:
[ ("2013-02-12", 200.0), ("2012-02-25", 300.0), ("2000-03-04", 100.0), ("2000-03-05", 50.0)]
The function needs to ...
-2
votes
0answers
32 views
Python - open file as bytes and save again
Let's say I have an image, and I open it with python. Then I save those bytes into a .txt file. Then I want to read this txt again, and save those bytes as a new image.
How do I proceed?
Thanks :)
0
votes
0answers
3 views
PySide & Python3: Slot with QListWidgetItem produces wrong type?
I am sitting in front of a problem which drives me nuts. Maybe it's easy but I can't see the culprit.
I have a simple class which connects the currentItemChanged signal of a QListWidget to a custom ...
1
vote
1answer
21 views
Calling Different Functions tkinter
I'm trying to call different functions based on the inputted text in a Tkinter program.
root=Tk()
tex=Text(root)
tex.pack(side='right')
inputfield = Entry(root)
inputfield.pack(side='bottom')
text = ...
0
votes
3answers
66 views
Creating my own python module - questions
I'm creating my own python module that has some functions I want to use. I wanna know how to do these things:
How do I proceed with my python module called module.py, so I import only the functions ...
1
vote
2answers
43 views
Python Game Server
I'm completely lost trying to create a UDP server/client for my game in python. I'm new to the language and only have limited experience with networking. Right now, the server runs, but doesn't seem ...
0
votes
4answers
55 views
Python get rid of bytes b' '
import save
string = ""
with open("image.jpg", "rb") as f:
byte = f.read(1)
while byte != b"":
byte = f.read(1)
print ((byte))
I'm getting bytes like:
b'\x00'
How do I ...
0
votes
1answer
32 views
Press Enter Instead of Clicking Button
I have a skeleton of a program that I want to use:
from tkinter import *
import urllib
import urllib.request
import xml.etree.ElementTree as ET
root = Tk()
def program():
print('Hello')
...
0
votes
3answers
37 views
How to repeat input after input is typed?
I wrote a function that contains a dictionary of abbreviated week days to the full name of the day. I get the proper output day when I type in the abbreviation, but in order to try another ...
1
vote
4answers
52 views
How to count while there is an input
I'm trying to write a function that does not take an input, but instead asks for a name. If you enter an empty string, the function should print for every name the number of people with the same name.
...
0
votes
0answers
21 views
nessus scan from cronjob giving error,but not from bash.?
I am trying to run a nessus scan from cronjob by subprocess python module. ,but from cronjob it's is giving an error. But not giving any error on execution of script from bash?
the cronjob code
01 ...
-6
votes
2answers
68 views
Finding and counting the frequency of known pairs of words in multiple files [closed]
Basically I need to count the number of word pairs in multiple files. I have a list of word pairs in a file called result.txt, which looks like:
the of
the by
they is
group their
I want to check ...
0
votes
0answers
29 views
Is there a simply library to utilise to play midi songs? [duplicate]
I'm looking for a simple library to play MIDI songs in a simple game I'm (trying) to make. Does anyone know of one I could use?
I found pygame but found it far too complicated.
(I've only been ...
1
vote
2answers
63 views
Parsing multiple lines in Python
I'm currently learning Python and I need to write a program which determines the word which appears the most times in a poem. Problem which is troubling me is about parsing a lines of a poem into a ...
3
votes
2answers
73 views
Python 3 Finding the last number in a string
How can I find the last number in any big string?
For eg in the following string I want 47 as the output:
'tr bgcolor="aa77bb"td>font face="verdana"color="white" ...