15,179 Topics

Member Avatar for
Member Avatar for karthik_6

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>

Member Avatar for snippsat
0
632
Member Avatar for <HHH>

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' …

Member Avatar for <HHH>
0
10K
Member Avatar for Azim_1

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 ?

Member Avatar for rubberman
0
291
Member Avatar for rhys1619

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 = …

Member Avatar for rhys1619
0
1K
Member Avatar for Maikel

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): …

Member Avatar for rproffitt
0
776
Member Avatar for vegaseat
Member Avatar for Zach_2

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 …

Member Avatar for Gribouillis
0
285
Member Avatar for rhys1619

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 = …

0
262
Member Avatar for lewashby

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 …

Member Avatar for lewashby
0
1K
Member Avatar for <HHH>

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"] …

Member Avatar for <HHH>
0
5K
Member Avatar for rhys1619

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

Member Avatar for rproffitt
0
274
Member Avatar for lewashby

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 …

Member Avatar for Gribouillis
0
2K
Member Avatar for rhys1619

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 …

0
317
Member Avatar for vegaseat

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 …

Member Avatar for Viresh_2
0
9K
Member Avatar for Andrew_33

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 …

Member Avatar for rproffitt
0
231
Member Avatar for AssertNull

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 …

Member Avatar for AssertNull
0
1K
Member Avatar for influx

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 …

Member Avatar for influx
0
411
Member Avatar for Nether_1

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 …

Member Avatar for Nether_1
0
343
Member Avatar for ajit.nayak

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 …

Member Avatar for ddanbe
0
552
Member Avatar for tkpanther

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 …

Member Avatar for Gribouillis
0
22K
Member Avatar for Mariano_1

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 …

0
270
Member Avatar for Dennis_9

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 …

Member Avatar for Gribouillis
0
169
Member Avatar for _1_6

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): …

Member Avatar for Gribouillis
0
264
Member Avatar for rhys_2

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. …

0
168
Member Avatar for vegaseat

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 …

Member Avatar for Gribouillis
2
124K
Member Avatar for Nether_1

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 …

Member Avatar for rproffitt
0
312
Member Avatar for toll_booth

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)) …

Member Avatar for DerSoldi
0
2K
Member Avatar for rhys1619

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 …

Member Avatar for DerSoldi
0
296
Member Avatar for Nik_1

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 …

Member Avatar for makaijohn9
0
5K
Member Avatar for RMartins
Member Avatar for pythonBasic
0
719

The End.