15,406 Topics

Member Avatar for
Member Avatar for vlady

Hello, I learn tuples and I came acros the folloving explanation which I don't understand practicly because the scipt is not complet..., I think tha they want to show the direction but for me would be better complet example... so it's from document: Think Python (version 1.1.19) and text is …

Member Avatar for vlady
0
147
Member Avatar for shonabagylas

hi is it true that reverse engineering a compiled python "program" is significantly easier than other languages ? thank you

0
22
Member Avatar for dbphydb

Hi, I have a code which uses HTMLParser to reach a webpage where an exe file is located. The code then downloads and installs the file on local machine. I need a solution for the below problem: HTMLParser reaches a webpage where there are links to clients_test2, clients_test5, clients_test8. Each …

Member Avatar for dbphydb
0
163
Member Avatar for nramya82

Hi all, I am very new to programming , I am trying to do task where I have to count the number of lines that are read until the total length of the lines is 1,000 characters and also it it doesn't count characters on any line that begins with …

Member Avatar for TrustyTony
0
113
Member Avatar for bharatvamsi

hi, i'm novice user in python and i want to capture data at a specific port using python script.Please suggest me the approach. Same data i'm able to write into a file using linux command: tethereal -i any "port 9060" -w sam.txt I want to accomplish the above task using …

Member Avatar for Azeriah
0
296
Member Avatar for oaktrees

Could someone point me in the right direction? I have two excel files that I would like to merge. Is xlwrt and xlrd the place to start? If so, are these part of the standard library? Thank you.

Member Avatar for jcao219
0
125
Member Avatar for funfullson

I found that in python we have no realy private attributes.we just can use _ or __.but these are not deny access to my attributes.some thing such as private variables in c++. Is it TRUE? Realy python is week in these?

Member Avatar for jcao219
0
266
Member Avatar for pythonnewbie10

[code=php]'''process a file of students''' def main(): f = open( "Ex9_2010_input.txt", "r") line = f.readline() while len(line) != 0: print line line = f.readline() main() [/code] In this case, the file contains comma separated values, each line representing student names and assessment marks in this format: FirstName, LastName, Asg1Mark, Asg2Mark, …

Member Avatar for TrustyTony
0
113
Member Avatar for bjoernh

Hi there, I started Python today. My first mini-project is supposed to find strings in a text-file. Here is what I have written: [CODE] infile = open("Python/es.txt","r") text = infile.read() infile.close() print text search = 'du' index = text.find(search) if index==-1: print "nothing found" else: search, "found at index", index …

Member Avatar for griswolf
0
543
Member Avatar for lewashby

I'M using Ubuntu and I'M running python 3. I'M trying to find a pygame download for Ubuntu and python 3. I went to pygame.org and followed the Ubuntu link. I eventually found one link for pygame 1.9, which I'M told works for pythan 3. There were two files, amd64 & …

Member Avatar for griswolf
0
350
Member Avatar for atsuko

Hi there, I am new to python. Can somebody tell me how can I count a given word from a file. I found lots of solution for counting all the words in a file, but not for some particular ones. Thanks in advance

Member Avatar for TrustyTony
0
706
Member Avatar for Roiti

Hello I am kind of a new programmer in python and I tryed to do a port scanner. I have a problem here but I can gigure it out' when I try to compile it it just gets stuck :S Here is the code [CODE] import socket as sk import …

Member Avatar for The_Kernel
0
248
Member Avatar for ITgirl2010

I need to create an application that utilizes your Order class to implement a simple Order tracking system. To do this your system must be able to deal with a number of orders. Your application should have the following capabilities: 1. Create a new order 2. Update an existing order. …

Member Avatar for sneekula
0
102
Member Avatar for linuxoidoz

Hi, How can I convert a 64-bit unicode string into a text string? I'm converting ASCII characters for example like this [CODE]str = unichr(int('00A9', 16))[/CODE] But how can I convert unicode 'U2082' or any other character beyong the ASCII range? Thank you.

Member Avatar for Gribouillis
0
202
Member Avatar for pythonnewbie10

The Question below has been given to me: An internet shop requires an order tracking system. When someone buys an item online, an Order is created. However, orders are not sourced and processed until payment has been confirmed. Once the order has been processed it can be shipped. The order …

Member Avatar for snippsat
0
299
Member Avatar for ITgirl2010

I have been given this program that maintains a catalog of items '''maintain a catalog''' [code=php]def main(): global catalog loadCatalog() while True: pick = showMenu() if pick == 0: break elif pick == 1: sellItem() elif pick == 2: buyItem() else: print "Invalid selection" saveCatalog() def showMenu(): global catalog while …

0
68
Member Avatar for py.thon

Hello ,Iam trying to write a programme for the connect -N game : Your program must allow two people to play Connect-N against each other using a text-based interface. Since this is a text-based game, we do not represent the players as colours(traditionally red and yellow), but instead as numbers: …

Member Avatar for ANTALIFE
0
825
Member Avatar for elnaz1010

hi i want to redirect python compiler messages to a file. for example if i run a python which has a line [CODE=python]a=;2[/CODE] python compiler will give me an error message saying 'syntax error' how i can fetch this error and write it to a file? i run it with …

Member Avatar for Gribouillis
0
147
Member Avatar for james27

hello ALL im making some simple python post script but it not working well. there is 2 part to have to login. first login is using 'http://mybuddy.buddybuddy.co.kr/userinfo/UserInfo.asp' this one. and second login is using 'http://user.buddybuddy.co.kr/usercheck/UserCheckPWExec.asp' i can login first login page, but i couldn't login second page website. and return …

Member Avatar for Tech B
0
176
Member Avatar for rahul8590

i have a very simple program which takes in file name as argument and print the content of the file , but for some reason it isnt working here is the code [code] import sys ,os def Cat(filename): f = open(filename) text = f.read() print '----', filename print text def …

Member Avatar for rahul8590
0
198
Member Avatar for oaktrees

This should be simple, but I think I am missing up the syntax. I am trying to make a list of the letters that appear in a string. import string values=[] values[5]="12234.7B" holder=[] holder.append(values[5].letters) This code gives me an error on the letters function. Any idea why? Many thanks.

Member Avatar for oaktrees
0
118
Member Avatar for WildBamaBoy

Hi, I'm writing a program that totals how long someone has worked by the starting time and the ending time. It DOES work if the times entered are both AM or PM. Like if they worked from 2:00 to 9:10, it tells me the right answer of 7 hours and …

Member Avatar for WildBamaBoy
0
2K
Member Avatar for spikeru

I am a relatively inexperienced coder so please excuse my ignorance. I am attempting to write a code to iterate rotations of functional groups in a molecule. The number of groups that need to rotate and the step size is based on user input. I know i can generate the …

Member Avatar for TrustyTony
0
504
Member Avatar for ihatehippies

Can anyone think of an intelligent way to extract the largest sequence of numbers from a list like: [CODE=python][[2, 4, 9], [3, 5, 10], [6], [2, 4, 9], [1, 8, 11], [3, 5, 10], [6], [2, 4, 9], [0, 7], [1, 8, 11]][/CODE] without brute forcing every possibility. You can …

Member Avatar for TrustyTony
0
168
Member Avatar for lewashby

I use Ubuntu Linux and I'M running python 3. How do I know what version of pygame to get for python 3? And could someone point me to it? Thanks.

Member Avatar for griswolf
0
127
Member Avatar for aryan.9001

[CODE] import matplotlib.pyplot as plt for c in range(-21,21): for i in range(0,20): print c,i plt.plot([c],[i],'r.') plt.show() plt.clf() print 10000[/CODE] i am new to python what i want to do is plot the graph and after plotting clear it and print 10000 .. but it is not clearing the plot …

Member Avatar for rahul8590
0
80
Member Avatar for xcristi

Hello, Has anyone some tutorials/info about how can I print from a RichTextCtrl in wx,python? I tried using HtmlEasyPrinting but the text is not formatted as it's displayed on screen. Probably using wx.richtext.RichTextPrinting could help but I have no idea how. Thanks, Cristian

0
162
Member Avatar for pythonnewbie10

There exists a file of ‘Knock Knock’ jokes. The file consists of line pairs. The first element of each pair contains the setup line, and the second element contains the punch line. Here are a few lines from the file: Amish Amish you when you are away. Snow Snowbody but …

Member Avatar for TrustyTony
0
172
Member Avatar for arty.net

OS : Ubuntu 9.04 Python : 2.6.2 I want to print a "while" loop into a secondary wx.Frame named "Results" here's the code : [CODE] #!/usr/bin/env python # -*- coding: utf8 -*- import random import wx import os # Operating System dependent call import sys import cPickle as p import …

Member Avatar for arty.net
0
1K
Member Avatar for Escape5equence

I'm working on a text based escape the room game. I've finished it but whenever i enter the command 'help' or most any other, the command executes and does what it's meant to but instead of returning to where it was before the command, the game has an error and …

Member Avatar for 0x69
0
2K
Member Avatar for dbphydb

Hello, I am getting the below error when using mechanize to submit a webform. >>> Exception in Tkinter callback Traceback (most recent call last): File "C:\Python26\lib\lib-tk\Tkinter.py", line 1410, in __call__ return self.func(*args) File "C:\Python26\lib\idlelib\MultiCall.py", line 159, in handler doafterhandler.pop()() File "C:\Python26\lib\idlelib\MultiCall.py", line 206, in <lambda> doit = lambda: self.bindedfuncs[triplet[2]][triplet[0]].remove(func) ValueError: …

Member Avatar for dbphydb
0
77
Member Avatar for thejinx0r

Hi, I'm a bit new to python and gui programming. I was wondering if there was a way to display a widget on desktop such that when you minimize everything, my widget still displays? I'm currently checking out PyGTK because I'm using gnome on linux, but if there's a cross-platform …

Member Avatar for thejinx0r
0
134
Member Avatar for Greyhelm

I am trying to update an occupants list in the class Place, after setting it with: [CODE] places["smith"] = Place( "smith", "This is the Blacksmith's Shop", "grimwo", ("well", "bakery", "mill"), () ) persons["berrol"] = Person("berrol", "bakery", "baker") [/CODE] The classes are setup as: Person / Place [CODE] class Person(object): """ …

Member Avatar for Greyhelm
0
10K
Member Avatar for jeffjpeterson

Its been awhile since I've messed with any kind of programming and I'll admit, I'm a bit rusty. I am an avid amazon mp3 user, but their downloads always have extra stuff attached to the track name, like Explicit, or Album Version. I want to make a program that will …

Member Avatar for jeffjpeterson
0
284
Member Avatar for macca21

HEEEEELLLLLLP!!!! Here's what I have after hour upon hour of battling away at OOP... If anyone could fix my errors and help with a bit more of the development I'd be very grateful, I can't wrap my head around OOP despite the hours of reading and trying :( The task …

Member Avatar for snippsat
0
298
Member Avatar for oaktrees

I am reading in a string from a file which has the format $ 235.0 M. I need to convert this to a number and save the letter M somewhere else. Any pointers on how to strip off the $ and M? Thank you.

Member Avatar for oaktrees
0
136
Member Avatar for swerty4

Hi I need to remove characters such as ?.'"[] from a text file and replace it with a white space " " the file i need this done to is called mispel.txt i have also split the file into words and lowercase so far this what i have but last …

Member Avatar for sneekula
0
145
Member Avatar for vlady

Hello, Pls can somebody help me with time comparison between 2 scripts. I have already looked the documentation but I haven't found anything. I deal with following exercise: "Run this version of fibonacci and the original with a range of parameters and compare their run times." I intend to measure …

Member Avatar for vlady
0
148
Member Avatar for swerty4

Hey , Have a task i want to do I have a .txt file with mispelt words and a .txt file which is a dictionary and has correct spelling of words now i know that i need to split both of the .txt files into words , i need to …

Member Avatar for swerty4
0
136
Member Avatar for gorbulas

As part of a program I'm making, I have a class, and have 5 different instances of this class declared globally for accessing by anywhere else in the program. The class has a list associated with it, that should be different for each of the 5 instances of the classes. …

Member Avatar for gorbulas
0
375
Member Avatar for lightning18

i have this code but this only prints the line number in the incorrect word *text1*. however i want it to print the line number of the incorrect word located in the text file called words. what can i add to it or arrange? # text1 is my incorrectwords # …

Member Avatar for lightning18
0
139
Member Avatar for juanjo-argentin

hi I'm new user of PYTHON and I want extract a little part into a string like this example 100|1999|pepito|False|[B]27-10655374-1[/B]|False|||05/09/1952|1|4||3||1|1|8|67||4|False|True|False|oerirabtaa||||Femenino|0|0|0|0|0|0|2| the part to extract (in the example, in black letter), have two parameters 1 is the part with exclusive format ##-########-# 2 ever is locate between 4º and 5º | …

Member Avatar for juanjo-argentin
0
88
Member Avatar for jmark13

In python I have a very large string of 0s and 1s. i.e '010100100101110101001...' etc. I want to convert this to BINARY without first converting it to decimal. Then I want to take the resulting binary number and convert it to it's decimal equivalent. Fastest way possible because it is …

Member Avatar for jmark13
0
877
Member Avatar for xleon

i wanna check a zip file in a directory.how can do it? directory="c:\myzipfiles" listfiles="a.zip,b.zip,c.txt,d.xls" #a.zip is badfile import os import zipfile mylist=os.listdir("c:\myzipfiles") for zfile in mylist if zipfile.ZipFile.test(zfile): print"you can extract ",zfile else: print "you cant extract ",zfile and how can i use zipfile.ZipFile.testzip() thanks for answers...

Member Avatar for xleon
0
4K
Member Avatar for DancingDana

Hello! I've got this collection of python files in a directory. Each file contains a variable called 'ors' that has as its value a dictionary. I know you can get the value of the variable in a file by typing: >>> import filename >>> filename.variable What I'd like to do …

Member Avatar for TrustyTony
0
143
Member Avatar for PythonNoob

Hi people I need help solving the following problems. Any help will be greatly appreciated: 1. Create a simple python application that displays a list of movie titles that match a set of terms, which is given in a text file called "input.txt". The content input.txt must be: Harry Potter …

Member Avatar for PythonNoob
0
173
Member Avatar for lightning18

i currently have this piece of code i need to create a dictionary that prints the incorrect word and the line number where it is incorrect. words [] # is my txt file text1 [] # is my list of incorrect words i am new to programming and dont know …

Member Avatar for lightning18
0
80
Member Avatar for macca21

I need this program to buy and sell items from a list. the list needs to display similar to below and have a menu for user to select options from: ID No. Name Price Stock 1 Apples $2.50 4 Choice: Buy - 1 Sell - 2 Quit - 0 *Needs …

Member Avatar for macca21
0
97
Member Avatar for sarfrazashfaq

Hi there I have following XML document that i want to read in python code. i know how to read, thing is i want to make hash/list from this XML document. <?xml version="1.0" ?> ‐<TradeExt> ‐ <fxall category="buyer" version="2.0"> ‐<tradeHeader> <sourceId>test_sourceId1</sourceId> <pmsId>4521363.0.0</pmsId> <fundId>ACCT1@TESTCUST</fundId> </tradeHeader> ‐ <tradeStatus> <dealImmediately>F</dealImmediately> <blockImmediately>F</blockImmediately> </tradeStatus> ‐ …

Member Avatar for ultimatebuster
0
357
Member Avatar for cableguy31

I'm trying to write a script that will go to a host and list all of its shares. So far, in my searching, it seems that I need to include a top level share name. For example: [CODE]os.listdir('\\\\1.2.3.4\')[/CODE] doesn't seem to work, but [CODE]os.listdir('\\\\1.2.3.4\\share\')[/CODE] will work. As a bit of …

Member Avatar for TrustyTony
0
403

The End.