15,175 Topics

Member Avatar for
Member Avatar for poeticinsanity

I am coding a web spider for research purposes and have run into an error I am uncertain about. I am fairly new to web programming and need a bit of guidance. I use http.client to get a connection, request a site, get the response, and read the resonse into …

Member Avatar for TrinitronX
0
341
Member Avatar for old_kid

Please let me know if I should make something more clear 1. Each item in list contains a tuple with its name -> ((value, work), 'name') 2. the function "sort" below sorts the list of subjects by "value" in descending order 3. I get: TypeError: 'int' object is unsubscriptable (occurs …

Member Avatar for griswolf
0
3K
Member Avatar for blenkhn

I need help with a py generated file that was made in QT. I use the following line [CODE]QtGui.QTabWidget.addTab(self.tabWidget, QtGui.qApp.tr("New Tab"))[/CODE] and get this error [CODE]Traceback (most recent call last): File "C:\python\mainwindow2.py", line 349, in createInvoice QtGui.QTabWidget.addTab(self.tabWidget, QtGui.qApp.tr("New Tab")) TypeError: arguments did not match any overloaded call: QTabWidget.addTab(QWidget, QString): argument …

Member Avatar for bumsfeld
-1
1K
Member Avatar for novice20

I want 1.py to call 2.py. 1.py takes an Ip address as a command line argument. I am trying a '[B]subprocess.call()[/B]' in 1.py to call 2.py. I have defined addr= sys.argv[1] before the [B]main()[/B] of 1.py. I want the same address to be accessed in 2.py. In short, 1.py should …

Member Avatar for slate
0
180
Member Avatar for jordan0420

Im working on my first big project, a GUI library for movie files (much like in itunes). so far i have the ability to list the movies title director and year in a list box as well as add movies to the database, however it is only text no actual …

Member Avatar for jordan0420
0
910
Member Avatar for scru

Sometimes IDLE crashes when trying to run GUI code. I already know the standard responses to this issue (use another editor, run from command line etc.). What I'm interested in is why does it do this? Does anybody have any information (or a link to info) on why this issue …

Member Avatar for richieking
0
233
Member Avatar for suri94

Hi! My brother made a programme that was a prank. That all computer that were connected to internet thought that his computer where internet. And i thought if you can make a programme that can check what other people are doing. And if i could like turn off the internet …

Member Avatar for richieking
0
91
Member Avatar for novice20

Hi, in the pysnmp tutorial, I couldn't find an equivalent for snmpwalk. What can be used?

0
52
Member Avatar for Insomaniacal

Hi everyone. I'm having a little bit of trouble getting a piece of code to work correctly here. Here is the code. [CODE]] filename = "./" + `random.randrange(0,9999999999999999999999999999999999)` + ".txt" f = open(filename, 'w') f.write(`data`) f.close f = open(filename,'rb') ftp = FTP('ftphost.com') time.sleep(5) ftp.login('user,pass') time.sleep(5) ftp.storbinary('STOR `filename`', f ) [/CODE] …

Member Avatar for jintujacob
0
236
Member Avatar for razax

Hi, This is my first post.I found interesting thing while playing with lists. [CODE]l = ['asd',"asd'das",'qw','213'] print "original list:", l print "first item:", l.pop(0) print "second item:", l.pop(1) print "modified list:", l [/CODE] [B]output:[/B] original list: ['asd', "asd'das", 'qw', '213'] first item: asd second item: qw modified list: ["asd'das", '213'] …

Member Avatar for razax
0
200
Member Avatar for LadyRelm2

So I'm new to python, although not terribly new to programming. I am going through some tutorials, but am having some trouble. I am trying to execute a program from the python shell (using Python 3.1). Right now, I have the >>> prompt. I can't seem to get any program …

Member Avatar for snippsat
0
1K
Member Avatar for triksterx

Hi everyone. Let me start by saying I have managed to learn quite a few things and solve pretty much any python problems using this site. So thanks to everyone who contributes to these forums. Now for my problem. I am having a hard time getting the .grid method to …

Member Avatar for woooee
0
1K
Member Avatar for TrustyTony

I have left my source of information as docstring comment on code side. If you want to solve the problem yourself do not run the code. This code actually gives the correct answer. I have not reacted to the border case comment in my formula source as it is quite …

0
1K
Member Avatar for MasterMic

I've taken 1 course in Java and 1 in C++ and now I'm tinkering with Python (love it so far). My module I'm currently working on is designed to solve a certain puzzle. To understand the code you'll need to understand the puzzle: There is an upside down triangle with …

Member Avatar for MasterMic
0
269
Member Avatar for AnaR

Hi, i would like to put some icons over desktop and these launch apps. It's necessary to use xlib with python, and i'm lost. thanks in advanced

Member Avatar for AnaR
0
238
Member Avatar for _neo_

I need to convert this C code to python. void GetChkSum(Int len, PSTR buf, PSTR res) { memset(res, 0, 4); for(int i=0; i<len; i+=4) { res[0]^=(buf+i)[0]; res[1]^=(buf+i)[1]; res[2]^=(buf+i)[2]; res[3]^=(buf+i)[3]; } res[0]=~res[0]; res[1]=~res[1]; res[2]=~res[2]; res[3]=~res[3]; } In my case, buf is bytes object. for example: buf = b'00000001TXBEG 0000' len is …

Member Avatar for _neo_
0
319
Member Avatar for tckotb

Please help, when i try to use keybd_event in my python script, it is not recognized by an emulator. [CODE] user32.keybd_event(0x43,0,0,0) [/CODE] It fails to be recognized by an emulator, but it works in browsers etc., so a game like playbiolab.com works just fine.

0
43
Member Avatar for ytrewq1

Hi, I have generated an array of random numbers and I'm trying to then write this array to a .txt file but the code I have written doesn't seem to do this correctly. Any help on this would be great. Here is what I have so far: import numpy as …

Member Avatar for snippsat
0
22K
Member Avatar for gunneronaspooky

Ok folks...more help with a programming class... I'm seriously starting to think programming is not for me, but I just want to finish out this class with a decent grade. I'm not looking for answers...just some guidance in the right direction. Here is the problem... As an exercise, write a …

Member Avatar for woooee
0
109
Member Avatar for sohel807

Following scripts makes logs first, and then can be printed. What should be the way I can print from the frame directly assuming I have printer in place? [ICODE]import wx import os.path class MainWindow(wx.Frame): def __init__(self, filename='noname.txt'): super(MainWindow, self).__init__(None, size=(400,200)) self.filename = filename self.dirname = '.' self.CreateInteriorWindowComponents() self.CreateExteriorWindowComponents() self.log= open("foo.log",'w+') …

0
71
Member Avatar for Boubakr

Hi... I've this: [CODE]random_name = ['Mohamed', 'Ahmed','Aboubakr'] print "1: %s 2: %s 3: %s" % (random_name[1], random_name[0], random_name[2])[/CODE] I want to print all the three names but in random way, as: some time: Mohamed, Ahmed, Aboubaker and some time: Mohamed, Aboubaker, Ahmed and some time: Aboubaker, Ahmed, Mohamed and some …

Member Avatar for TrustyTony
0
152
Member Avatar for rebo544

Hi so i created a function that asks users to input their grades for a course and theoretically it should post all of the results and then the grade for the course. I have so far been able to create a function that asks the user for their information and …

Member Avatar for richieking
0
126
Member Avatar for sohel807

I want to make a simple editor using wxPython. Complete code is already available in wxPython tutorial page ([url]http://wiki.wxpython.org/WxHowtoSmallEditor[/url]). However, in addition I want to add "print" menu which will print the contents of editor (i.e., whatever written in editor). I will appreciate if someone please show me. Thanks, Akand

Member Avatar for richieking
0
422
Member Avatar for gunneronaspooky

I'm just trying to come thru with a passing grade at this point because there was no instruction. I can't even get the program that was given to me to work, even though I copied it verbatim from the text. Please help me figure out what the error is so …

Member Avatar for -ordi-
0
136
Member Avatar for joywheels

Hi everyone, I am going through a self-paced class for Python beginners and have ran into a dictionary problem that I can't figure out. I'm creating a set of words from user input. Then send those words to a dictionary that adds a key for when the word is first …

Member Avatar for TrustyTony
0
130
Member Avatar for blenkhn

I have been trying to no avail to load a ui file and insert it into a tabWidget as a new tab. I commented out a try that I thought would work, I was wrong. I have tried several different ways but I always seem to get the same error. …

Member Avatar for blenkhn
0
885
Member Avatar for zizuno

I may have phrased the title wrong but it is what I mean. I am not looking for multiple windows at once, I am writing a script that opens a tkinter window asking for information etc etc etc and it all saves into a database after the last window. Right …

Member Avatar for TrustyTony
0
665
Member Avatar for pythonn00b

Implement a function punctuation() that takes no parameters, inputs a string from the user, and prints all of the punctuation characters appearing in the string, in order from left to right. My coding I have so far is: def punctuation(): a = raw_input("Please enter a string:") check = ['!', ',', …

Member Avatar for snippsat
0
378
Member Avatar for benqb

Iam using [color=#FF0040]import paketlogic2[/color] in my project when i hosted that project in webserver i got the following error [color=#FF4000]Couldn't connect to PacketLogic: cannot import name PLv11[/color] why?

0
49
Member Avatar for aint

Hi, I have many files made by a software. I want to extract some data from those files, and when I open the file with textedit, I see that what i need is on the first line. i have many of these files, and when I run the script, it …

Member Avatar for aint
0
133

The End.