15,194 Topics

Member Avatar for
Member Avatar for Bhavya_1

Hi. I want to learn penetration testing in python.but i am entirely clueless where to start. I have read about some famous tools like SCAPY and pycap.So,the thing is that i want to develop my own tools to comprimise a network.Are there any good tutorials on sapy or any other …

Member Avatar for 1baga
0
104
Member Avatar for EriCartman13

How do you rest your variable everytime your execute the program. [code]for x in range(1,100): running = True while running: guess = int(raw_input("Enter an integer:")) if guess == x: print "Nice" running = False if guess < x: print "Higher" running = True if guess > x: print "Lower" running …

Member Avatar for bumsfeld
-1
4K
Member Avatar for dilita.mido

Draw an inheritance hierarchy for classes Quadrilateral, TRapezoid, Parallelogram, Rectangle and Square. Use Quadrilateral as the base class of the hierarchy. Make the hierarchy as deep as possible.

Member Avatar for james.lu.75491856
0
184
Member Avatar for james.lu.75491856

I'm creating my own handler, but what kind of object is request? I can just have the documentation for it and look at that, but I don't know where to.

Member Avatar for james.lu.75491856
0
129
Member Avatar for Eggborne
0
82
Member Avatar for manuel.ramirez.9619

Hi! I´m making a really big program of mail sending. However my last problem is the scrolling... The scroll bar don´t react to the mouse wheel and only functions when focusing in the bar , And that´s not user-friendly. how Can I achieve to make the scroll bar react with …

Member Avatar for james.lu.75491856
0
373
Member Avatar for Tcll

IMO, VS2010 with PythonTools 1.5 is the best IDE. it may not be as glamorous as Eclipse or PyScripter, but it certainly has more functionality and accuracy than either of them. -intellisense (PyScripter does a better job than Eclipse) -split file scrolling (not sure about PyScripter, but Eclipse doesn't have …

Member Avatar for Tcll
0
657
Member Avatar for Hikki_Passion

Ok, so I am trying to write a code that will find the attributes in a html tag using lists and splitting them up. Unfortunately its giving me a hard time with the added quotation marks. [CODE] def find_attribute_value(html_tag, att): '''Return the value of attribute att (a str) in the …

Member Avatar for james.lu.75491856
0
1K
Member Avatar for Swetha_1

for example: consider the contents of file1.txt: 1 0 9227 1152 34 2 2 111 7622 1120 34 2 3 68486 710 1024 14 2 6 265065 3389 800 22 2 7 393152 48438 64 132 3 8 412251 46744 64 132 3 9 430593 50866 256 95 4 10 …

Member Avatar for rrashkin
0
164
Member Avatar for james.lu.75491856

If you use the same HUGE number many times: * import sys * sys.maxint = sys.maxint+sys.maxint * This is because if you have the INFINITE(or lower) refrence to the same integer, It will take up the sppace of that integer. If you use many diffrent huge numbers: * Use a …

Member Avatar for james.lu.75491856
0
166
Member Avatar for Swetha_1

for example: consider the contents of file1.txt: 1 0 9227 1152 34 2 2 111 7622 1120 34 2 3 68486 710 1024 14 2 6 265065 3389 800 22 2 7 393152 48438 64 132 3 8 412251 46744 64 132 3 9 430593 50866 256 95 4 10 …

0
106
Member Avatar for james.lu.75491856
0
118
Member Avatar for deonis

Hi everyone, I have a problem to setup a custom lexer using in wx.stc.StyledTextCtrl (wxPython). I have a text file which consit of certain keywords which I would like to highlight. The text file is not related to any of the programing languages and so I cannot use the buildin …

Member Avatar for deonis
0
945
Member Avatar for 3e0jUn

I've been looking for a way to parse a simple XML-like language for use as a type of data storage. I've been through stuff like JSON, XML, etc but I don't want to use them because they are quite slow. I just need a simple way to parse this: [stuff] …

Member Avatar for james.lu.75491856
0
433
Member Avatar for benwadee
Member Avatar for TrustyTony
-1
146
Member Avatar for Brad_2

My platform is Ubuntu 12.10 with wx.Python 2.8.12.1 (gtk2-unicode). My application uses wxPython to print text to a printer. I want to use Ubuntu Condensed font face for some of the text. The problem is that when the text is printed the text that should be in Ubuntu Condensed face …

0
163
Member Avatar for pythonforlife

Sorry guys, how do you print a message dialog box if a file doesn't exists in python? I am currently using a program to do segmentation of video file and assembling it the files that I need and excluding those I don't. I have completed the tasks but if I …

Member Avatar for bumsfeld
0
460
Member Avatar for lewashby

How could I get the file name and the permissions to a file as a string? This is on a Linux system.

Member Avatar for james.lu.75491856
0
225
Member Avatar for amartin903

I've built a classifier after following an online tutorial. I take a bunch of tweets, use a HTML parser to get rid of unescaped syntax, remove everything shorter than 3 words and make a dictionary out of them. I then work out the frequency distribution of the words and so …

0
62
Member Avatar for lewashby

(Linux) In the following program when the command python permissions.ph is issued I simply get another prompt, but when python3 permissions.py is issued I get the error below. Why does python2 see tkinter but python 3 doesn't? garrett@bedroom ~/Projects/TestArea $ python permissions.py garrett@bedroom ~/Projects/TestArea $ python3 permissions.py Traceback (most recent …

Member Avatar for vegaseat
0
1K
Member Avatar for pythonforlife

Sorry guys, how do you print a message dialog box if a file doesn't exists in python? I am currently using a program to do segmentation of video file and assembling it the files that I need and excluding those I don't. I have completed the tasks but if I …

Member Avatar for vegaseat
0
226
Member Avatar for james.lu.75491856

I want to start a command in command prompt, but os.system() can only do one command, and I want it to start from a url. Example: import os,getpass print "Altline (C) James Lu" print "All rights reserverd." def currentuser(): try: return "Users/" + getpass.getuser() except: print "Cannot detect user, starting …

Member Avatar for Gribouillis
0
204
Member Avatar for sudipta.mml

Hi All, I was trying to evaluate the matrix coefficient by the method of constrained least square fitting. The linear matrix differential equation looks like X'=AX, where X' and X are two vectors and A is matrix. Moreover, there is a constraint on diagonal matrix element and which is a(i,i)=-Sum(i/=j)a(i,j). …

0
88
Member Avatar for floatingshed

I'm trying to create a custom dialog using pythoncard. My main program looks like this (I'm only testing!): [CODE]import wx from PythonCard import dialog, model import MyDialog class MyApp(model.Background): def on_initialize(self, event): self.MyDialog()[/CODE] The simple Pythoncard dialog looks like this: [CODE]from PythonCard import model class MyDialog(model.CustomDialog): def __init__(self, parent, txt=''): …

Member Avatar for John_43
0
150
Member Avatar for Tyyppi_77

So, I'm coding a IDE in Python and I'm using Tkinter for the GUI. What I'm looking for is a way to add a "recent files" menu to the menu that opens when you right click the program's icon in Windows's task bar. I have a picture to show what …

Member Avatar for Tyyppi_77
0
959
Member Avatar for sujan.dasmahapa

I am trying to extract text from PDF file in PDFNetSDK by PDFTron. But when the execution comes to dumpAlltext() there is no element type e_text. When I am debuggin the code i can see element type is e_path..I think e_path is having the all the text in it. How …

0
105
Member Avatar for james.lu.75491856

I am making a program like word, but when it's running how do I create a new component? (Like statictext) and bind a on_drag method to it?

0
72
Member Avatar for Judgment

I'm trying to create a game of Go Fish in Python. But I've stumbled onto a little problem that I can't seem to figure out how to deal with. There is a human player (player 0) and three computer players (from 1-3). The human player goes first and chooses a …

Member Avatar for james.lu.75491856
0
688
Member Avatar for pythonforlife

I would like to merge a few dat files in a directory and exclude certain dat files as previously I have already marked out the files that I need and do not need. Below is an example of my codes def onAssemble(self,event): with open("index.dat", 'r') as file: data = file.readlines() …

Member Avatar for pythonforlife
0
202
Member Avatar for lewashby

I'm looking throug the documentation at python.org for modules and functions allow me to do basic operations on in a Linux file system. I need to do simple things like list the file and folders in a directory 'ls' and change director 'cd'. I found these two pages that looked …

Member Avatar for lewashby
0
146
Member Avatar for dancks

I'm writing a basic sudoku solver. I have a simple method that looks for squareas with only 1 possible number and fills them in before trying to solve the puzzle. the method look like this: def fillinones(sq): table = {1:1,2:2,4:3,8:4,16:5,32:6,64:7,128:8,256:9} for i in range(0,80): p=checkpossible(sq,i) print "p: ",p if p …

Member Avatar for TrustyTony
0
180
Member Avatar for sujan.dasmahapa

how can I get color info for a PDF file I want to check color contrast for text. For that I need foreground and background colors. Currently I am using pdfminer. But with pdfminer this information is not possible to extract. Do you know if any other that can be …

0
69
Member Avatar for philcm

Hi ; I'm trying to add a simple menubar to my lister window : ------------------------------------ #!/usr/bin/env python import subprocess import os, stat, time import pygtk pygtk.require('2.0') import gtk folderxpm = [ "17 16 7 1", " c #000000", ". c #808000", "X c yellow", "o c #808080", "O c #c0c0c0", …

0
138
Member Avatar for james.lu.75491856

If there's a class called `foo` and you do `d = foo().someboundmethod`, will the instance of foo stil be there?

Member Avatar for ~s.o.s~
0
185
Member Avatar for vegaseat

In today's environment where just about anyone can snoop around your e-mail, it is prudent to securely encrypt your more private writings. This little Python program will make it easier to do so.

Member Avatar for vegaseat
4
456
Member Avatar for lewashby

In the following program, why is the count function failing? I'M getting an error that it needs at leat one argument and that I have given it 0. I have here count(number), how is number no an argument? According to the documentation the start and end points are optional. I …

Member Avatar for lewashby
0
1K
Member Avatar for james.lu.75491856

Traceback (most recent call last): File "C:/Users/James/Desktop/Quikemail.py", line 54, in send s.sendmail(me, you, msg.as_string()) File "C:\python 25\lib\email\message.py", line 131, in as_string g.flatten(self, unixfrom=unixfrom) File "C:\python 25\lib\email\generator.py", line 84, in flatten self._write(msg) File "C:\python 25\lib\email\generator.py", line 116, in _write self._write_headers(msg) File "C:\python 25\lib\email\generator.py", line 162, in _write_headers header_name=h, continuation_ws='\t').encode() File "C:\python …

Member Avatar for Gribouillis
0
3K
Member Avatar for dreking6

am a python beginner, receeently started learning about classesand i wrote this got this little code that keeps bringing this error . please i need someone here to help debug it: class employee(): ` empcount=0` def _init_(self,name,salary): self.name=name self.salary=salary employee.empcount=+1 def displaycount(self): print 'Total employee: %d' %employee.empcount def displayemployee(self): print …

Member Avatar for dreking6
0
6K
Member Avatar for dustin.hunt1

I'm currently builting a script for a church here in town to parse through the Bible and find select verses. I currently am using the KJV which is just in a single .txt file. Here is some sample from the text file: 1:1 In the beginning God created the heaven …

Member Avatar for slate
0
889
Member Avatar for Hamza_4

Hello everyone, I am new to programming and I was wondering if anyone could help me out. I have hundreds of CSV files in a folder that I need to edit and resave. Can anyone give me a bit of code to start me off properly?

Member Avatar for Hamza_4
0
384
Member Avatar for pauldespre

I want to write a script that logs an user into Facebook and initialize oauth dialog to get the access_token(*I don't want to log in into a website using facebook account!*). I don't want to use facebook-sdk,pyfb etc. This is what I've tried: import sys, urllib2,json,urlparse,webbrowser, os, cookielib, re class …

0
230
Member Avatar for Turo1

I am getting this error "The program is still running! Do you wan to kill it?" from the python IDE when I run the following code. Any ideas why this is happening? #!/usr/bin/python import sys ######################################################################## # prints program usage ######################################################################## def printUsage(): print "** Print part of Bible **" …

Member Avatar for james.lu.75491856
0
2K
Member Avatar for nytman

Dear list, i have problem, i was going through with python programming and found there is something missing in case of float data types. what i am trying to do is: i am writing a simple program in which i asked user to input salary, i want to ristrict user …

Member Avatar for nytman
0
19K
Member Avatar for james.lu.75491856

Traceback (most recent call last): File "C:/Users/James/Desktop/hugevar.py", line 2, in <module> class var(tempfile.TemporaryFile): TypeError: Error when calling the metaclass bases function() argument 1 must be code, not str Why does this happen and how can I fix it?

Member Avatar for Gribouillis
0
1K
Member Avatar for DeadH34d

I've been reading through this introductory book on Python, and I've been following along fairly well. Compared to C++, Python seems to make more sense to me. That is, until I reached a section on Logical Operators. I don't completely understand what I just typed in to IDLE, and the …

Member Avatar for Gribouillis
0
409
Member Avatar for james.lu.75491856
Member Avatar for sujan.dasmahapa

I am trying to read a PDF file using pypdf and write onto a text file. But its not working. content value in the below code is just "u/n/n/n/n/n'...PDF file has 5 pages so 5 times new line character and in the begining 'u'..whats going wrong please help. why the …

0
76
Member Avatar for danielsikes

I am new to python. Is there any way that python can detect when a field is focused in an external program? The script would just need to know when a text input field was selected. Thanks,

Member Avatar for vegaseat
0
118
Member Avatar for 3e0jUn

So I have this piece of code in a socket server: def process(self, request, client_address): input_file = request.makefile("rb", 0) output = request.makefile('wb', 0) remote_input = input_file.readline().strip() + b"\n" self.log(remote_input) self.proc.stdin.write(remote_input) self.proc.stdin.flush() self.proc.stdout.flush() while True: line = self.proc.stdout.readline() line = line.decode() if line: line = bytes(line.rstrip() + "\n", 'utf-8') output.write(line) else: …

Member Avatar for Gribouillis
0
516
Member Avatar for vegaseat

Uses the PySide GUI toolkit's QtMultimedia module to play a specified sound. You can change frequency/pitch and volume of the sine wave.

2
1K

The End.