15,190 Topics

Member Avatar for
Member Avatar for ThePythonNoob

Hi, I have made a square that will move but there are some bugs in the movement. I can't find anything wrong with the logic which is why I need help ;) You have to press left and right to move the square. The problems with the movement are: 1: …

Member Avatar for ThePythonNoob
0
3K
Member Avatar for 3e0jUn

How do you make Python accept multiple strings and break them down in an input? For example, main = input ('> ') if main == ('ECHO',some_words): print (some_words) But everytime I do that, the some_words string wouldn't be defined. Error Message: Traceback (most recent call last): File "<pyshell#7>", line 1, …

Member Avatar for TrustyTony
0
185
Member Avatar for Dan08

Hi, I just installed PyQt Designer to start creating UI's with python, I've used WxPython and TKinter before, but never really done anything with PyQt. So for some of you this might be a very simple question that I can't seem to find with google. I really like how it …

0
137
Member Avatar for dwhite12

I need to write a code that imports a list of files then goes through each file and rewrites only half the file. Cutting off the file at a key word. If I can make my code print the half I need I can make it write new files with …

Member Avatar for dwhite12
0
231
Member Avatar for PlasmoMage

Hey all I would like to ask a few questions about an idea I had for my forensics class. 1. How hard would it be to create a script that monitored when icons on the desktop are moved? AND (bonus) if they are in a specific placement THEN call a …

Member Avatar for imamyth
0
102
Member Avatar for 3e0jUn

Can someone give a code snippet on how to 'chat' using the XMLRPC library in Python? Here's my server code: from xmlrpc.server import SimpleXMLRPCServer from xmlrpc.server import SimpleXMLRPCRequestHandler import os from os import access, path PATH = 'chatlog.$' class RequestHandler(SimpleXMLRPCRequestHandler): rpc_paths = ('/RPC2',) server = SimpleXMLRPCServer(("localhost", 8000), requestHandler=RequestHandler) server.register_introspection_functions() server.register_function(pow) …

Member Avatar for Gribouillis
0
511
Member Avatar for 3e0jUn

Is it possible (without using any external modules) to make two computers, or Python programs communicate through an Ethernet cable? E.g. Sending messages, numbers, etc. And if so, how?

Member Avatar for 3e0jUn
0
156
Member Avatar for BARATUM

I would like to develop a SQL injection vulnerbility scanner. However, i dont know how to develop it, It is any module in python could help me develop this app? My app requirement User able to input the target URL and apply SQL injection scanning on target URL After that, …

Member Avatar for ryantroop
0
920
Member Avatar for p34i

Could someone please give me a pointer as to why my use of appendText fails? This is my first bit of programming for 30 years - I'm sorry if its an idiot mistake :) The program has 2 text fields. You paste a list of url's into the first box …

Member Avatar for p34i
0
127
Member Avatar for 3e0jUn

How do you make Python set an str from a file? For example, my file would contain these pieces of text: username=Eugene password=eugene How do I get Python to return this? >>> print(username) Eugene >>> print(password) eugene Any help is deeply appreciated. Thanks!

Member Avatar for 3e0jUn
0
244
Member Avatar for fatalaccidents

Hey guys, I had a quick question. Let me try to explain what I'm trying to do here. I'm a bit new to numpy and I'm writing a parallelized code. It is working fine without the use of NumPy, but I'm trying to learn by getting it to work both …

Member Avatar for fatalaccidents
0
364
Member Avatar for napierin

Im brand new at python and am trying to teach myself through a book. Im trying to run a very simple command but I keep on getting a syntax error. If someone could take a look at it and tell me what im doing wrong I would greatly appreciate it. …

Member Avatar for napierin
0
234
Member Avatar for duckduck

I have been trying to create a text file and code it in UTF-8. I have managed to do it using codecs However, I am having trouble when I ask the user for input. Any ideas? # -*- coding: cp1252 -*- import codecs fileName = "testing1" textFile = codecs.open(fileName, "wt", …

Member Avatar for TrustyTony
0
137
Member Avatar for Arash-Sh

Hello im new in python and have a small project to do . my project is cms detector in python at first its in consol and does not has gui . because of im a newbie in programing i dont know how to begin the project . is there any …

Member Avatar for Arash-Sh
0
756
Member Avatar for heheja

Hey, Do any one know how to get only Lang ID from Google chrome site ("view-source:https://www.google.com/chrome?hl=en-GB") using this regex "<option value=""([a-zA-Z]*)"">[&#0-9; a-zA-Z()]*</option>" ?

Member Avatar for heheja
0
162
Member Avatar for matthewkeating

I am writing a script that solves a Quadratic equation. What I am doing wrong and why? The error I get is: [COLOR="Red"]Traceback (most recent call last): File "/home/matthew/Desktop/QuadraticSolver.py", line 5, in <module> c1 = (b * -1) + math.sqrt(((b*b) - 4*a*c) / 2*a) ValueError: math domain error[/COLOR] Here is …

Member Avatar for Gribouillis
0
612
Member Avatar for 3e0jUn

How do you make Python delete a specific line of text from a file? For example, delete_input = input ('> ') file = open('blahblah.$','w') #delete the variable delete_input file.delete(delete_input from file) Any form of help would be appreciated. Thanks!

Member Avatar for snippsat
0
81
Member Avatar for 3e0jUn

I have a very tough problem- how do you make an icon/character move across a console screen? For example, if I press W, +++++ ++E++ +++++ Then I press D +++++ +++E+ +++++ And I want it to be like the CHOICE command in CMD- Without requiring the user to …

Member Avatar for 3e0jUn
0
93
Member Avatar for Behseini

Hi, I am trying to create a simple GUI which let user to populate a list box base on a click event in wxpython. Can you please point me into a simple tutorial or example which has a sample? For example I have a list of colors: Red, Green, Blue, …

Member Avatar for Behseini
0
149
Member Avatar for HTMLperson5

Is there any way to remove an imported library? `Python 2.7.3 (default, Apr 10 2012, 23:31:26) [MSC v.1500 32 bit (Intel)] on win32` `Type "copyright", "credits" or "license()" for more information.` `>>> dir()` `['__builtins__', '__doc__', '__name__', '__package__']` (Currently imported packages) `>>> import time` `>>> dir()` `['__builtins__', '__doc__', '__name__', '__package__', 'time']` …

Member Avatar for HiHe
0
411
Member Avatar for kwolfe

Hi, I'm a newbie to Python and trying to write my first FTP script. Here's the code: from ftplib import FTP ftp = FTP("LoginServer.com") ftp.login("LoginID", "Password") # open the file to read it f = open("C:/Users/MyDocs/Documents/Python/test.txt", "r") # Open directory ftp.cwd("/") # save file ftp.storbinary("STOR test.txt", f) ftp.quit() f.close() I'm …

Member Avatar for TrustyTony
0
198
Member Avatar for javanub123

im following along in this nifty little book and one of the coding examples just sparked my interest. data = open('some_file.txt') for each_line in data: print(each_line) How does python know what i want it to do without really telling it? i figured i would have to tell it how i …

Member Avatar for HiHe
0
149
Member Avatar for Zeref

Hi guys. So, I'm trying to read data from a database and displaying in a GtkTreeview. I used glade to design the GUI when i click on the button (view movies) the list of movies should display as a list. def on_btnmovies_clicked(self,widget,data=None): store=self.builder.get_object('listmovies') connect=sqlite.connect('movies.db') db=connect.cursor() db.execute("SELECT * FROM movie") for …

Member Avatar for Zeref
0
746
Member Avatar for Iceman10284

Assume that a file containing a series of names ( as strings ) is named names.dat and exists on the computers disk. Design a program that displays the numbers of names that are stored in the file. ( Hint: Open the file and read every string stored on it. Each …

Member Avatar for sepp2k
0
537
Member Avatar for chriswelborn

I started using Python a few weeks ago, something finally clicked and I started writing tools for my personal use. I started writing something with a GUI using GTK and the code lines started multiplying rapidly, so I thought to myself "Am I commenting my source to death? How many …

Member Avatar for chriswelborn
2
364
Member Avatar for javanub123

im trying to write a program that will read a line of text from a file and then print that text into whereever the cursor is in the browser. like into the address bar or something. is the possible with python? how would i go about doing it. i know …

Member Avatar for javanub123
0
120
Member Avatar for ceck30s

Hi, I'm a beginner at python and I'm trying to extract specific columns from a text file, and then use those columns to make a line plot. The files contains the following few lines of data: # Raw SIFs at Crack Propagation Step: 0 # Vertex, X, Y, Z, K_I, …

Member Avatar for Gribouillis
0
765
Member Avatar for KoRnKloWn

I am currently working on an app to convert documents (specifically Open Document Text, at least for now) to epub format. The problem I'm running into right now is this, I am using etree ElementTree to parse the xml files extracted from the .odt file, right now I'm working on …

Member Avatar for KoRnKloWn
0
272
Member Avatar for fatalaccidents

Hey guys, I'm new to parallel programming, so I was wondering if anyone could help me parallelize a bit of code. It is a code that goes into large h5 files (using h5py) and grabs some data out. After that the data has to be reformatted and printed into another …

0
88
Member Avatar for 3e0jUn

How do you make Python delete a string or a number (in this case, .0) from a file? Example: #Error Fixing if '.0' in open('ship.$','r'): #Delete the '.0'

Member Avatar for snippsat
0
482

The End.