15,179 Topics
| |
hi all, how to parse an xml attributes using python. I want to read or extract msg values from xml using python. <msg timestamp="20160817 12:46:42.520" level="INFO">Average : 0.14 % CPU (%) 10 Aug 07:00 2 12 Aug 07:00 maximum 5.17 average 0.13</msg> | |
Hello I have created two classes one for the user and the other for address every thing is ok and the tables of the two classes created in my database but when i try to initiate a new object from user class i get the below error "sqlalchemy.exc.InvalidRequestError: Mapper 'Mapper|user|user' … | |
Hye I'm new to c++ language. Can anyone suggest me what is the best programming software should I learn ? And how I'm gonna learn coding ? | |
Hi, im trying to add a slapsh screen before my game. It will display a png and the use can either press "e" to continue or "q" to quit. when i run this in my game is says that pygame.display.update() is the problem. Please help thanks. def game_intro(): intro = … | |
Hi guys, I'm new to Python have get done a lot by searching. Now I try to bind a scroll wheel to canvas, but it doesn't do anything. Will someone look at the code what I do wrong? I tried to keep my snippet clean. Hope It's enough. class Viewer(tk.Toplevel): … | |
A short example of Pygame showing an image with a known internet url. | |
Whenever I go to transfer a file from my server to my client, I get a new file, but the data does not go through. It prints server side once it is open, but it won't transfer the data to my new file. Here is the code:https://gist.github.com/anonymous/8f70b3e2eca8606dee2c245ce64e9b63 All I want … | |
hi, so ive been trying to add a splash screen to the start of my game. the user presses "e" to continue and "q" to quit. it's not working, could anyone help. import os import pygame import random pygame.init() #Colours im using in the game white = (255,255,255) black = … | |
I've tinkered with php in the past but I'v also enjoyed playing around with python. I have been wanting to give python a try as a possible alternative to php but I haven't had much luck. All of the videos I find on the subject are about setting up Django … | |
Hello, I'm trying to write my first cookie on python but when i import cookie or even http.cookie it gives me the below error import cookie c = cookie.SimpleCookie() c["value"] = "first" print (c) ImportError: No module named 'cookie' [Finished in 0.3s with exit code 1] [shell_cmd: python -u "C:\Users\hohait\Desktop\test.py"] … | |
hi, im making a game in pygame game and i was wanting to add an image (just a png of the story) before my game. I was wondering if anyone can help me with how i would do this. thanks | |
python3 pythonscript.py Traceback (most recent call last): File "pythonscript.py", line 1, in <module> import pysftp as sftp File "/usr/local/lib/python3.4/dist-packages/pysftp/__init__.py", line 12, in <module> import paramiko File "/usr/local/lib/python3.4/dist-packages/paramiko/__init__.py", line 30, in <module> from paramiko.transport import SecurityOptions, Transport File "/usr/local/lib/python3.4/dist-packages/paramiko/transport.py", line 32, in <module> from cryptography.hazmat.backends import default_backend ImportError: No module named … | |
Hi, i'm making a maze game. As you can see i have added an image for my floor and i'm trying to add an image to my walls. I am having trouble adding the image to the walls. Could anyone start me on my path on how to do this … | |
Use Python module threading to count intervals (in seconds) in the background. You can use this to time any relatively slow event like the time it took to finish a game or play some music. You can also peek at the current interval value as the event goes on. Go … | |
I am looking for a Backend as a Service (hosted solution) that provides a free starter plan. Firebase provides the ideal features I am looking for however it appears they have no C# client that supports their authentication system or any Python client at all. (Correct me if I am … | |
I am pretty much brand new to Python. I'm cramming this week trying to learn it and I've been handed some code samples to try them out and familiarize myself with them. Problem is that they were written years ago in Python 2. It's my own C++ code that I … | |
I am using this code to get all synonyms from the text in document named "answer_tokens.txt" it is only listing the words in the document without the synonyms. can someone check it out? from nltk.corpus import wordnet with open('answer_tokens.txt') as a: #opening the tokenised answer file wn_tokens = (a.read()) #printing … | |
I'm writing a simple server allowing me and my friends to send information to each other. Currently I've got the client down easy enough, it's all set up and I can communicate with servers. The problem is I can't get the server to work for some reason, I use working … | |
Dear all I am trying to send request to client device in Hex format and receive data into decimal format. By seeing forum and tutorial class. I could able to send and receive data from client device.Now I wanted to check the data i received valid or not. In order … | |
Hello, it is me once more. I am using Python 2.3, and I must use Zelle's graphics class (and I must agree with many of you. Tkinter is much better). We have been tasked with creating a Graphical Scientific Calculator. In addition to the normal operators, it must contain the … | |
Hey I'm coding Tron which is basically a two player snake game, I'm a noob when it come to pygame and python and need help with the collision logic and would love it if you could help me. (the comments are just ideas I had for the loops for the … | |
I'm knida new to Python and I made a program that works the way I want by renaming files in bulk, however it will only work in the current folder and will not go into sub directories. i already have import os from os import rename, listdir is there any … | |
| I know this should not be difficult, probably I've been too lazy to figure it out. When I execute the python script below, I get this message: <bound method Forces.Sums of <__main__.Forces instance at 0x7fcecfb56a28>>. What is wrong? import numpy class Forces: """ Forces between particles""" def __init__(self, l1, l2): … |
Hi, i have been making a maze game in pygame. I have made every level and have them all in different folders so i can find them easily. I have been trying to make a menu for the game where you are able to pick any level and play it. … | |
A list of class objects mimics a C array of structures. The snippet explores how to setup the list, and sort the list according to a selected attribute. Then we use a format string to display the sorted list. Take a look at how to search the list. All in … | |
As the title suggests, I'm attempting to build a first-person view game. I could do this on my own, but the way I'm thinking of doing it is completely impractical (involves coordinates and thousands of if statement for every possible view, which like I said is impossible). I can pretty … | |
I am struggling to get the following code to work in Python 3. from mpl_toolkits.mplot3d import Axes3D from mpl_toolkits.mplot3d.art3d import Poly3DCollection import matplotlib.pyplot as plt fig = plt.figure() ax = Axes3D(fig) x = [0,1,1,0] y = [0,0,1,1] z = [0,1,0,1] #verts = [zip(x, y,z)] verts = list(zip(x, y, z)) ax.add_collection3d(Poly3DCollection(verts)) … | |
Hi, this is a maze I have been working on. As you can see everything is just flat colors. I was wanting to make it so i can add more detail like having it so i could have a picture of some tree textures as the walls to my maze … | |
Write and test a program that prints out the multiplication table for the numbers 1 to 9. Sample run:(should look close to this) 1 2 3 4 5 6 7 8 9 1 1 2 3 4 5 6 7 8 9 2 2 4 6 8 10 12 14 … | |
|
The End.