15,181 Topics

Member Avatar for
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
184
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
451
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
874
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
380
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
225
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
406
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
74
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
116
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
512
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
Member Avatar for Tcll

[Click Here](thinking of PyReadLine... anyone know of a library that can color pixels in the console instead of text??)

0
99
Member Avatar for entropic3105
Member Avatar for Ismatus3

hello , I use Tkinter , at the line : `print modelidvar ` in Interface3() function , it prints "" , nothing , without any error message , can i know why plz , here is all the code : # -*- coding: cp1252 -*- # -*- coding: cp1252 -*- …

Member Avatar for vegaseat
0
200
Member Avatar for Liam_1

I'm making a simple text based game in python, which works fine until I activate "debug" mode (in game, with /debug), which is supposed to change this: # # # # # # # # # # # # # . . . . . . . . . . …

Member Avatar for TrustyTony
0
705
Member Avatar for Tiger1

Below are my code lines for computing cosine similarity over a list of values. My goal is to compute cosine similarity for each value in the f-list (f=[[3492.6], [13756.2], [22442.1], [22361.9], [26896.4]]) by taking a value from the list and compute how close in terms of cosine distance the rest …

0
94
Member Avatar for Dan_1

Hello everyone. I'm quite new to Python and Pygame, and programming in general. I've made a few basic games like pong, frogger and asteroids (the last two took me ages, but I learnt a lot doing them!) Anyway, I'd quite like to have a go at making a 2d side …

Member Avatar for JasonHippy
0
995
Member Avatar for ram619

Hello,I have written this script to telnet from Ubuntu system to windows7 running system. This script goes fine upto login name, then it takes the password but it is not able to process the password. Although it looks as if the password has reached other side but in real it …

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

import turtle def f(): turtle.forward(10) def l(): turtle.left(1) def r(): turtle.right(1) def b(): turtle.back(5) turtle.onkey(f,"Up") turtle.onkey(l,"Left") turtle.onkey(r,"Right") turtle.onkey(b,"Down") turtle.showturtle() turtle.listen() while True: print, EDIT: add `turtle.showturtle()` but STILL doesn't work

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

I've been trying out python codes looking at the python tutorials at python.org. I've been getting a better idea of it now and the tutorials are very good at teaching practical programming. However, I also want to apply for Python jobs so what a little bit of theoritical information on …

Member Avatar for rmad17
0
308
Member Avatar for hisan
Member Avatar for 3e0jUn
0
1K
Member Avatar for vegaseat

This code snppet uses the wx.lib.filebrowsebutton.FileBrowseButton widget to pick a file, in this case a '.wav' sound file, and plays it with the wx.Sound widget.

Member Avatar for vegaseat
1
1K
Member Avatar for james.lu.75491856

How do you get this: ![78dfa722ac966be9e9aa3a44ef62d566](/attachments/large/3/78dfa722ac966be9e9aa3a44ef62d566.PNG "78dfa722ac966be9e9aa3a44ef62d566") with pythoncard?

Member Avatar for vegaseat
0
105
Member Avatar for oliverven.quilnet

i installed alchemyAPI with python 2.7 on the desktop and it runs perfectly but when i saved the file to a live server whenever i try running the example files on aclemy i got the error. "Syntax Error near unexpected token `('" I checked the syntax python syntax and its …

Member Avatar for Unimportant
0
460

The End.