15,179 Topics
| |
Hi, I am currently getting JSON data from the discogs API (mp3 tag data) and wish to sort the results by the key's value. In this case I am trying to get data for a Guns n Roses song and the output has 1988 as the first one while the … | |
Python webpage -please help Hi I am very new in python programming.I am trying make a basic webpage where I ask user to input url like "http://www.google.ca" and a description of the url like"search engine". Using python script I will add that url and description in dbm database and print … | |
Hello guys I have got a little programme that been written in Python, I did connect it to an application been created in Visual Basic 2010, But to run the Python file, Of course you will need to install the Python software/Format to be able to run the python file, … | |
Hello First apologies for being a total newb. Everyones gotta go though this stage i guess. I'm a teacher and I've written some python 3 code that does some handy stuff to grades. I can execute the code using IDLE and it does what I want it to(averaging scores, producing … | |
Which is smarter? class HoldAttr(object): pass a = HoldAttr b = getattr(a, 'attrname', []) b.append(1) setattr(a, 'attrname', b) # or try: b.a.append(1) except AttributeError: b.a = [1] ... or something else? Trying to learn. | |
#module nametest def showName(): print("__name__ is: " + str(__name__)) If I import nametest into another module or into the shell interpreter and call nametest.showName() I find that name = "nametest", in other words __name__ gets the module name it is a built-in member of? The only exception I know of … | |
New concepts to be applied for this assignment Lists File input and output Exceptions Generating random numbers Debugging flags/messages (Note: style requirements from previous assignments e.g., functional decomposition must also be applied). Introduction Write a fitness simulation whereby a single runner is traveling a fixed distance. The runner only has … | |
Write a Python program which will read data for several students from a text file and create a list of lists to store that data. The data must be read from a text file named “Lab11.txt”. Each line in the text file contains the first name, last name, techid, number … | |
Hi, I am working on an exercise in a book and have difficulty with it. I have completed the first part of the exercise which was to create a guessing game where the the player attempts to guess a secret number randomly generated. Suggestions such as to guess Lower and … | |
I want to move/ delete not os.remove files or folder recycle bin on windows or trash in other OSes using standard lib available in python .. is it possible ? | |
well this is more about what i want to learn, todat I downlaoded send2trash package and installed it, i opened __init__.py that came with it and it had the following code which i can very well understand except for the period infront of each module name.. if sys.platform == u'darwin': … | |
so im trying to make a very basic multiplayer game that gets a players x y from a server then displays the player. the script works fine when there is only one user in the database but when more users are added the script wont display the right player. i … | |
I am a newbie to py.test , Please let me know how to run the py.test in PyScripter Editor. I have tried in the belwo way but it doesn't work. import pytest def func(x): return x + 1 def test_answer(): assert func(3) == 5 pytest.main() | |
The project is: -------------------------------- Write a program that computes and prints the average of the numbers in a text file. You should make use of two higher-order functions (i.e., map and reduce, or something else) to simplify the design. Create a text file and name as numbers.txt and add the … | |
Hi, I have a csv file im reading and this is what I have done so far: import csv filename='C:\Users\temperature.csv' with open(filename, 'rb') as csvf: reader = csv.reader(csvf) for row in reader: print row the result is as following: ['Depth (m);15.08.2012 15:39:09;15.08.2012 16:09:10;15.08.2012 16:39:10;15.08.2012 16:43:36'] ['0;53.218;52.804;52.865;51.202'] ['0.128;53.107;52.709;52.414;52.141;'] ['1.143;52.205;51.88;51.664;51.234'] ['2.159;51.026;50.846;50.842;51.258'] ['3.174;50.061;50.055;50.457;50.19'] … | |
This is a program I am working on for homework and I keep getting this error and I'm not sure what I can do to fix it. Any help would be greatly appreciated. here is the error: Traceback (most recent call last): File "C:\Users\crazyjdog\Desktop\School Stuff\CSET 1100\Programs and Charts\program121.py", line 86, … | |
Hey there, i'm relatively new to pyGame and considering this is like my second attempt at doing it by myself after watching a few tutorials, i'd say im getting the hang of it. However, as i was creating a game i realised i had no clue how to make the … | |
Hello! Sory for my English, i'am from Russia Please, Help Me... There is such code: #coding:utf-8 import wx import sys import time import cefpython class MainFrame(wx.Frame): browser = None def __init__(self): wx.Frame.__init__(self, parent=None, id=wx.ID_ANY, title='wxPython example', size=(1000,800)) self.browser = cefpython.CreateBrowser(self.GetHandle(), browserSettings={}, navigateURL="http://google.com") class MyApp(wx.App): timer = None timerID = 1 … | |
I am trying to create a program that takes an input from a user for a file name and then a text string and removes the string from the file. I have been at this one for a while and I have exausted just about every idea I had to … | |
how should i save data like {username , passwords} to disk for later retrieval so that it cannot be opend and read in by a text editor? | |
Seconds since epoch should be zero, but are not: '''timetuple1.py create a time tuple for epoch 1/1/1970 00:00:00 however, seconds since epoch does not give 0 ''' import time timetuple = time.strptime("01/01/1970 00:00:00", "%m/%d/%Y %H:%M:%S") print(timetuple) print('-'*40) # seconds since epoch 1/1/1970 00:00:00 secs = time.mktime(timetuple) print(secs) '''my result >> … | |
I am running into a strange error everytime I use lxml.etree and was wondering if anyone else has ran into this problem before. It was not until, what I believe happened my lxml was updated to a new version, that I started to get this problem. the error is "File … | |
class Calculate: def __init__(self): self.prior = {} self.total = {} self.count = 0 def add(self, cls, obs): self.prior[cls] = self.prior.get(cls, 0) + 1 for idx, val in enumerate(obs): key = cls, idx, val self.total[key] = self.total.get(key, 0) + 1 self.count += 1 def discr(self, cls, obs): result = self.prior[cls]/self.count for … | |
I have this programme to discuss and I think its a challenging one.. Here I have a yml file which contains the data for an image. The image has x,y,z values and intensity data which is stored in this yml file. I have used opencv to load the data and … | |
Hello I am completely new to Python and I dont know how to prompt the user and use the information from the console in my code. So I guess the simplest example would be If I had to prompt the user for the raidus of a circle then print the … | |
Hello I need help ASAP, my problem is due by thursday.....Here is the problem my teacher has given... "Create a class that describes a box. The user should be able to submit the length, width, and height of a box. Also, you should include methods/functions to determine the surface area … | |
import wx app = wx.App() win = wx.Frame(None) win.Show() app.MainLoop() Why does the above code only work in python2.7 and not 3? | |
#!/usr/bin/python3 print('Content-type: text/plain') # prints an empty line, to end the headers print('Hello, world!') I'M trying to get the above python cgi output to load in my web browser but the browser is just displaying the code it's self. My apache program is working because I just tried the phpinfo … | |
Hello everyone Is there any way to kill the python.exe in Task Managaer "On Windows" using visual basic The Problem is that i do open more than 1 python file at the same, But on task manager it's hows me something like this Python.exe python.exe python.exe python.exe I have got … | |
I want to print a file using win32api. I have a network printer using this ip: 192.168.1.50 So i used this code: import win32api file_path="test.txt" win32api.ShellExecute(0, "print", file_path, None, ".", 0) How can i print this file on the printer that i don't have the name but the ip? Its … |
The End.