15,179 Topics

Member Avatar for
Member Avatar for Pyscript.exe

I tried to install pyHook, but all I seem to get when I try to run my program in the python shell to test it is this. ImportError: No module named pyHook I keep trying, and I have PyWin32, so I tried to install it like that by typing into …

Member Avatar for Pyscript.exe
0
4K
Member Avatar for rhys1619

Hi, at the end of the maze you see a red square. I was trying to make it say "you win , would you like to play again y or n". i have tried using def mes and gameover = false but nothing seems to work. would help a lot …

Member Avatar for Gribouillis
0
1K
Member Avatar for Nether_1

I have a simple pygame code that doesn't seem to be functioning correctly, check it out: import pygame, time active = True screen_size = (1052, 700) pygame.init() DISPLAY = pygame.display.set_mode(screen_size) firstimg = pygame.image.load('firstimage.png') secondimg = pygame.image.load('secondimage.png') clock = pygame.time.Clock() def WHITESCREEN: DISPLAY.fill(255, 255, 255) def DisplayFirstImg(): DISPLAY.blit(firstimg, (1, 1)) def …

0
161
Member Avatar for Nether_1

So this is more work onto the project I've been working on with the browser and search database stuff, so here goes. I'm attempting to have a large amount of .txt documents stored on an ftp server, and then allow these files to be downloaded, edited, and so on so …

Member Avatar for Gribouillis
0
418
Member Avatar for Ketaki_2

Hi, **Python script** from xml.dom import minidom doc = minidom.parse("wind7.xml") Ts = doc.getElementsByTagName("TimeStep") for Ts in TimeStep: Part = TimeStep.getElementsByTagName("Particle")[0] for Part in Particle: Pcid = Particle.getAttribute("Nr") Lat = Particle.getAttribute("x") Long = Particle.getAttribute("y") print("Pcid:%s,Lat:%s,Long:%s" % (Nr,x.firstChild.data,y.firstChild.data)) I have written this python script to extract XY data, but am getting lot …

Member Avatar for tinstaafl
0
468
Member Avatar for Nether_1

I'm attempting to write a simple search engine (which you might know if you read my previous question) that runs off of tags combined in a list. Currently it's just in a basic ASCII output, with things like print functions and the like. def main(): active = True done = …

Member Avatar for Gribouillis
0
357
Member Avatar for Gribouillis

This snippets contains a python program to find a shortest solution to the problem of the farmer who whishes to cross a river. The boat can only contain two things, including the rower. The farmer comes with a wolf, a duck and a bag of corn, and he can't leave …

Member Avatar for Gribouillis
0
2K
Member Avatar for Arzak

Hi everyone, I wanna ask about `Bytes` from `ifconfig eth0`. Like us know, menu's from `ifconfig eth0` is... **eth0 Link encap:Ethernet HWaddr 00:0F:20:CF:8B:42** **inet addr:217.149.127.10 Bcast:217.149.127.63 Mask:255.255.255.192** **UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1** **RX packets:2472694671 errors:1 dropped:0 overruns:0 frame:0** **TX packets:44641779 errors:0 dropped:0 overruns:0 carrier:0** **collisions:0 txqueuelen:1000** **RX bytes:1761467179 (1679.7 …

Member Avatar for Arzak
0
2K
Member Avatar for Nether_1

I'm creating a program that allows you to do a whole ton of stuff, basically just built to make my life a little easier on my pc. However, the idea I had was that I could have a form of 'settings bar' where I could edit the settings (duh) of …

Member Avatar for Gribouillis
0
788
Member Avatar for ktush

Hi, I am trying to plot live data reading them from a txt file. The interesting thing is that it works fine without the animate function and I am not sure what is going on when I introduce this function. The code is appended below. from datetime import datetime import …

Member Avatar for tinstaafl
0
463
Member Avatar for Tenck

I'm currently reading a huge Python book. I've just written my first Python code (from this book). It's [CODE]import sys print(sys.platform) print(2 ** 100) x = 'spam!' print(x*8) [/CODE] It works fine and I get the results I want. The only problem I have right now is running it off …

Member Avatar for rproffitt
0
2K
Member Avatar for Regan_1

Hi there! I am having trouble figuring out what is wrong with my code also I'm kinda new to Python. I'm trying to get variables to one class to another class then return it back. Here is my code: from tkinter import * from tkinter import ttk class Logic: def …

Member Avatar for Regan_1
0
339
Member Avatar for Kayla_1

HELP! I've been working on this assignment for a while and can't get it to work. It's supposed to pull contact info from a text file, and then return it. Every time I try to run it , it returns "no entry found" no matter what. HELP! #Declare constants lastname …

Member Avatar for woooee
0
913
Member Avatar for mailtosarach

Hi all, I want to write a program in python to capture memory and cpu readings of a process which is running on linux server and save the readings in a tabular format to any .doc or .csv file. Got to know that 'top' command would give the cpu and …

Member Avatar for Gribouillis
0
309
Member Avatar for Mayukh_1

I have inputs in the form like below Data: 01 18 01 23 45 67 89 AB CD EF FE DC BA 98 76 54 32 10 01 23 45 67 89 AB CD EF 02 18 67 89 AB CD EF FE DC BA 98 76 54 32 10 …

Member Avatar for Gribouillis
0
340
Member Avatar for mridul.ahuja

I'm using selenium with firefox to load a webpage. The page uses ajax to load new content on clicking the Display More Results button. However when I try to find this button and simulate a click, it gives the following Stacktrace error. Can anyone tell me what I'm doing wrong …

0
396
Member Avatar for Nether_1

Okay so I'm writing a code for a game and the way its currently programmed is the main menu is contained within a large function that references another function, and so on. Not too complicated. But (as you'll see with the code below) I have all the essential variables set …

Member Avatar for Gribouillis
0
368
Member Avatar for Nether_1

Recently I started using my first attempt at Python multithreading. The purpose of the code is to run multiple WHILE loops at the same time, one of which searches for the change of a variable to TRUE caused by input picked up by the other. However, when i ran the …

Member Avatar for Gribouillis
0
3K
Member Avatar for mswamy

Hi, I want to write a python program for connect to remote server (using ssh) and execute the command and return back with output. Here is my code: import sys import os from subprocess import Popen, PIPE, STDOUT from time import sleep from os import waitpid, execv, read, write #Ports …

Member Avatar for mswamy
0
23K
Member Avatar for Aries_Child

Assignment Overview1 This assignment focuses on the design, implementation and testing of a Python program which uses file processing, lists and strings to solve the problem described below. Program Specifications: The New York Times newspaper has published “best seller” lists since 1942. Book sales are tracked nationwide, leading to a …

Member Avatar for jacks009
0
587
Member Avatar for Nether_1

Recently I started coding a simple Game Engine in Python, but for some reason I couldn't remember how to get Pygame to recognize you clicked on a certain area. No sample code (sorry) but I was wondering if anybody knew how to make it so Pygame will recognize that the …

Member Avatar for rproffitt
0
178
Member Avatar for Johnrednex

I'm using the BullionVault API to view my orders. I use the requests from the official documentation https://www.bullionvault.com/help/xml_api.html and python language. My issue is **the request response is the HTML DOM of the BullionVault login page**. Here is my code: login_page_url = "https://or.bullionvault.fr/secure/login.do" login_page_url2 = "https://live.bullionvault.com/secure/j_security_check" payload2 = {'j_username': 'myusername', …

Member Avatar for Johnrednex
0
1K
Member Avatar for zero_1

Hi, can anyone explain to make script `downstream kbps` and `upstream kbps` ? It's totally Different method from ubuntu, because my `Os System` still window 7. Every second `downstream` and `upstream` must change... Thanks Before... Noted: Python2.7

Member Avatar for zero_1
0
828
Member Avatar for dier02

How do you catch incorrect entries? Instead of yes or no the user enters something else? def weather(): import sys raining=input('Is it raining? ').lower() if raining == 'yes': ask =(input('Do you have an umbrella? ')).lower() if raining=='no': print('Go outside 1') sys.exit(0) if ask == 'yes': print('Go outside 2') sys.exit(0) while …

Member Avatar for jnneson
0
392
Member Avatar for Nether_1

Alright so I wrote a little program using Python 2.7 and the pygame module. For some reason, no matter what I do, the actual Pygame screen itself won't flip() or update() at all, no matter what I do. The code's pictured below(it's rather long): import pygame pygame.init() DISPLAY = pygame.display.set_mode((800, …

Member Avatar for Gribouillis
0
231
Member Avatar for Nether_1

Recently I attempted to install Pygame for Python 2.5 on my new computer. The computer runs Windows 10 32-bit, and I have installed a 32 bit copy of Pygame, so there shouldn't be problems there. Whenever I enter my Python shell to attempt to import, this error happens: >>> import …

Member Avatar for Nether_1
0
315
Member Avatar for sabbib

I want to use Tkinter funtion to create a a temperature calculator. I have all the code for the calculator, however using Tkinter function i cant figure out how to get the variable input by the users. I am new to python and programming, just started programming less then a …

Member Avatar for Judith_2
0
1K
Member Avatar for engrjd91

I am new to python, in the below code i am reading 2 files and writing in 2 files. I want to open these files in seperate functions as to make some indented look. Can anyone suggest me how to do it? def compare(): memberReportFile=open("D:\MemberReport.txt", 'w') readableRulesFile=open("D:\ReadableRules.txt", 'w') membersFile=open("D:\Members.txt") rulesFile=open("D:\Rules.txt", …

Member Avatar for slate
0
257
Member Avatar for engrjd91

Hello everyone, I have two files i.e Rules.txt and Members.txt. I have set different rules for different members. Now i have break down the rules comma seperately using the for loop. I want to compare each index of the 1st file with the respective index of the second file. If …

Member Avatar for Gribouillis
0
482
Member Avatar for Lazarus777

Hi, i still learning about python. Now i study learning convert ***bandwidth*** (**Byte**) from `ifconfig eth0`to **Kbps** The problem is, my pc using **os windows 7** not **linux/ubuntu** I dont know how to using command `ifconfig eth0` using win7. Any other way to solved this problem?

Member Avatar for Lazarus777
0
283

The End.