[Tutor] Need help to convert pdf to excel

2014-10-19 Thread AMNA MOHAMMED ALRUHEILI
Hell, My name is Amna and I am totally new to python world with zero experience in programming. I am facing the challenge of converting data from pdf to excel. The data within pdf is numbers separated by space not within a table. I need a help to figure out a code that help me to convert these pdf

Re: [Tutor] Need help to convert pdf to excel

2014-10-19 Thread Danny Yoo
On Sun, Oct 19, 2014 at 7:27 AM, AMNA MOHAMMED ALRUHEILI alruhe...@berkeley.edu wrote: My name is Amna and I am totally new to python world with zero experience in programming. I am facing the challenge of converting data from pdf to excel. The data within pdf is numbers separated by space not

Re: [Tutor] Need help with python script

2014-08-04 Thread P McCombs
Sorry, I missed copying this to the list. On Aug 4, 2014 8:13 AM, P McCombs mcco...@imperium.org wrote: On Jul 31, 2014 4:50 PM, McKinley, Brett D. bmckin...@mawss.com wrote: I would like to see if someone can help me with a python script. I’m trying to export a file geodatabase feature

Re: [Tutor] Need help with python script

2014-08-04 Thread Joel Goldstick
On Mon, Aug 4, 2014 at 11:20 AM, P McCombs mcco...@imperium.org wrote: Sorry, I missed copying this to the list. On Aug 4, 2014 8:13 AM, P McCombs mcco...@imperium.org wrote: On Jul 31, 2014 4:50 PM, McKinley, Brett D. bmckin...@mawss.com wrote: I would like to see if someone can help

[Tutor] Need help with python script

2014-07-31 Thread McKinley, Brett D.
I would like to see if someone can help me with a python script. I'm trying to export a file geodatabase feature class to csv file. This is what I have so far: import arcpy import os import csv import domainvalues def export_to_csv(dataset, output, dialect): Output the data to a CSV

[Tutor] need help reading the code

2014-07-07 Thread keith papa
# Hi am leaning python with A Byte of Python - Swaroop CH and am a little confused with The format method. So I leaned that printing the code: age = 20 name = 'Swaroop' print '{0} was {1} years old when he wrote this book'.format(name, age) print

Re: [Tutor] need help reading the code

2014-07-07 Thread Alan Gauld
On 07/07/14 19:29, keith papa wrote: Please post in plain text and avoid attachments if possible. Just paste code directly into the email. I've had to cut n paste everything to write this which is a pain... print '{0} was {1} years old when he wrote this book'.format(name, age) print 'Why

Re: [Tutor] need help reading the code

2014-07-07 Thread Alan Gauld
On 07/07/14 19:29, keith papa wrote: # decimal (.) precision of 3 for float '0.333' print '{0:.3f}'.format(1.0/3) The best way to see how this works is to try it with different values: print('{0:.3f}'.format(1.0/3)) 0.333 print('{0:.5f}'.format(1.0/3)) 0.3

[Tutor] Need help with generators....

2014-02-15 Thread Bunny Sehgal
I am doing Building Skills in Python. In the Generator Function example at [url] http://www.itmaybeahack.com/homepage/books/python/html/p02/p02c08_generators.html#generator-function-example[/url]i can't understand, how it is working properly. what i understood is as follows: 1)First it makes count

Re: [Tutor] Need help with generators....

2014-02-15 Thread Alan Gauld
On 15/02/14 13:35, Bunny Sehgal wrote: I am doing Building Skills in Python. In the Generator Function example at I assume you are talking about this one: spins = [('red', '18'), ('black', '13'), ('red', '7'), ('red', '5'), ('black', '13'), ('red', '25'), ('red', '9'), ('black',

Re: [Tutor] need help

2014-01-11 Thread Mark Lawrence
On 11/01/2014 14:52, S Tareq wrote: how can i do this on python using py game: No idea as what you've sent isn't readable when you try to reply. Also I can't see any code so sorry but I'm not doing your homework for you :( -- My fellow Pythonistas, ask not what our language can do for you,

Re: [Tutor] need help

2014-01-11 Thread Walter Prins
Hi, On 11 January 2014 14:52, S Tareq stare...@yahoo.com wrote: how can i do this on python using py game: You need to tell us more about what you've tried and where you're stuck. Needless to say we're not a solution provision service, but we'd be happy to help you get unstuck if you've

[Tutor] need help how to run it on python 3.3

2014-01-08 Thread S Tareq
need help how to run it on python 3.3, or change it to python 3.3 when i run it says syntax error if i run it on python 2.7 it works.  # Import statements import random import datetime #Arrays to store the definitions and keywords read from the file keywords=[]; definition=[]; correctAnswer=[];

Re: [Tutor] need help how to run it on python 3.3

2014-01-08 Thread Mark Lawrence
On 08/01/2014 18:19, S Tareq wrote: need help how to run it on python 3.3, or change it to python 3.3 when i run it says syntax error if i run it on python 2.7 it works. if(counter%2==0): Please remove those unneeded brackets, this is a Python list, not C :) print Please

Re: [Tutor] need help how to run it on python 3.3

2014-01-08 Thread Danny Yoo
Hi S Tareq, You probably want to review the What's new in Python 3 document, with close attention to the Common Stumbing Blocks section: http://docs.python.org/3.0/whatsnew/3.0.html#common-stumbling-blocks Have you read this document already? ___

Re: [Tutor] need help how to run it on python 3.3

2014-01-08 Thread Steve Mayer
You might want to check out the '2to3' program to convert Python 2.x code to Python 3.x code. The following command worked to change your code to runnable Python 3.x code: 2to3 -w your file containing 2.x code -- Steve Mayer smaye...@me.com On 8 Jan 2014, at 10:19, S Tareq wrote:

Re: [Tutor] need help how to run it on python 3.3

2014-01-08 Thread Danny Yoo
Hi S Tareq, If you can, next time please just copy and paste the error message as plain text. Please avoid screenshots unless they really are relevant to the problem at hand. There are good reasons why you should prefer plain text when asking questions on a mailing list like this one. (1)

Re: [Tutor] need help how to run it on python 3.3

2014-01-08 Thread Mark Lawrence
On 08/01/2014 20:54, S Tareq wrote: On Wednesday, 8 January 2014, 20:46, Danny Yoo d...@hashcollision.org wrote: Hi S Tareq, You probably want to review the What's new in Python 3 document, with close attention to the Common Stumbing Blocks section:

Re: [Tutor] need help how to run it on python 3.3

2014-01-08 Thread Dave Angel
On Wed, 8 Jan 2014 20:54:09 + (GMT), S Tareq stare...@yahoo.com wrote: ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor This is a text newsgroup. Html messages

Re: [Tutor] Need help on Python API programmig

2013-11-16 Thread Amit Saha
Hi Sourav, Please use Reply all when you reply an email so that everyone else also gets your messages and your chances of getting better help increases. On Sat, Nov 16, 2013 at 3:35 PM, Sourav Biswas sob...@gmail.com wrote: Hi Amit, Yes I know, the question is not quite good. Currently I am

[Tutor] Need help on Python API programmig

2013-11-15 Thread Sourav Biswas
Hi All, This is my first post. I want to learn API programming with Python. I have basic knowledge of Python Programming. Could you please let me know the starting points for this programming. -- Thanks, Sourav Biswas Hyderabad ___ Tutor maillist -

Re: [Tutor] Need help on Python API programmig

2013-11-15 Thread Amit Saha
Hello Sourav, On 16/11/2013 6:53 AM, Sourav Biswas sob...@gmail.com wrote: Hi All, This is my first post. I want to learn API programming with Python. I have basic knowledge of Python Programming. Could you please let me know the starting points for this programming. Since your question is

Re: [Tutor] need help with something

2013-09-15 Thread Alex Palazzo
Hi i need help with something with python. Alexander Palazzo Rhode Island College '17 (401)474-1669 apalazzo_5...@email.ric.edu___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options:

Re: [Tutor] need help with something

2013-09-15 Thread Steven D'Aprano
On Sat, Sep 14, 2013 at 11:17:31PM -0400, Alex Palazzo wrote: Hi i need help with something with python. And we're here to help. Would you like to tell us what you need help with, or shall we guess? -- Steven ___ Tutor maillist -

Re: [Tutor] Need help appending data to a logfile

2013-06-30 Thread Alan Gauld
On 30/06/13 04:41, Matt D wrote: So i have a program that gets pickled data from a thread and displays the data (9 strings) in TextCtrl fields in the UI. The fact that it is a UI is largely irrelevant apart from the fact that it forces an event driven architecture. When the pickle is

Re: [Tutor] Need help appending data to a logfile

2013-06-30 Thread Alan Gauld
On 30/06/13 15:04, Matt D wrote: that sounds ideal, but i have not found a way to pass the user selected file into the loop that writes the data without opening another file. Don;t pass the file pass the fgile *name* Then inside the update method open the file(in append mode) and write the

Re: [Tutor] Need help appending data to a logfile

2013-06-30 Thread Alan Gauld
On 30/06/13 16:42, Matt D wrote: im sorry i don't understand how to pass the file name from the open dialog into the update method? I'm sorry i just don't get it. so if the user opened file is 'handle' like this?: OK, technically you probably donb;t want to pasws it into the metjod but to

Re: [Tutor] Need help appending data to a logfile

2013-06-29 Thread Dave Angel
On 06/29/2013 08:26 AM, Matt D wrote: Matt probably read somewhere about an interface like tempfile.TemporaryFile where the file has no explicit name, and will be deleted from disk, and the space reused as soon as it is closed. I don't believe he's using such an interface, however. Yes

Re: [Tutor] Need help appending data to a logfile

2013-06-29 Thread Alan Gauld
On 29/06/13 16:00, Matt D wrote: with tempfile.NamedTemporaryFile('a+t',) as tf: self.logfile = tf This could give problems. with guarantees to close the file at the end of the block. But you have assigned it to self.logfile. So when the file is closed (and tempfile then

Re: [Tutor] Need help appending data to a logfile

2013-06-29 Thread Steven D'Aprano
On 30/06/13 10:51, Alan Gauld wrote: On 29/06/13 16:00, Matt D wrote: with tempfile.NamedTemporaryFile('a+t',) as tf: self.logfile = tf This could give problems. with guarantees to close the file at the end of the block. But you have assigned it to self.logfile. So when the

Re: [Tutor] Need help appending data to a logfile

2013-06-29 Thread Dave Angel
On 06/29/2013 09:38 PM, Steven D'Aprano wrote: SNIP I haven't read this entire thread, but the bits I have read lead me to think that Matt has tangled himself up in a total confused mess. It's *not this hard* to write status messages to a log file, the log module does all the work. Can

Re: [Tutor] Need help appending data to a logfile

2013-06-28 Thread Dave Angel
On 06/28/2013 07:27 AM, Matt D wrote: As for the shutil.copy() function, how complex can it be? It takes two file names, source and destination. It does not need a with statement since it wants strings, not file handles. You might get into trouble on some OS's with the source file already

Re: [Tutor] Need help appending data to a logfile

2013-06-28 Thread Steven D'Aprano
On 28/06/13 23:18, Matt D wrote: what if i did some thing like this i saw on stackoverflow: f = open(bigfile.txt, w) That clears any existing content of bigfile.txt, and opens it for writing. Do you intend to clear the content? for tempfile in tempfiles: What is in tempfiles? A list of

Re: [Tutor] Need help appending data to a logfile

2013-06-28 Thread Alan Gauld
On 28/06/13 20:54, Matt D wrote: def openFile(self, evt): with wx.FileDialog(self, Choose a file, os.getcwd(), , *.txt*, wx.SAVE) as dlg: if dlg.ShowModal() == wx.ID_OK: path = dlg.GetPath() mypath = os.path.basename(path)

Re: [Tutor] Need help appending data to a logfile

2013-06-28 Thread Alan Gauld
On 28/06/13 22:25, Matt D wrote: Python UI. I have a thread that waits on new data and when it comes in it gets displayed in TextCtrl fields. every time this happens my logger puts those values into a text file one row at a time. this how i open and the file for logging data: # open a

Re: [Tutor] Need help appending data to a logfile

2013-06-28 Thread Dave Angel
On 06/28/2013 08:04 PM, Alan Gauld wrote: On 28/06/13 22:25, Matt D wrote: Python UI. I have a thread that waits on new data and when it comes in it gets displayed in TextCtrl fields. every time this happens my logger puts those values into a text file one row at a time. this how i open and

Re: [Tutor] Need help appending data to a logfile

2013-06-27 Thread Dave Angel
On 06/27/2013 10:55 AM, Matt D wrote: On 06/27/2013 10:36 AM, Matt D wrote: You asked about a save-as feature. Why isn't that as simple as copying the current contents of the saved csv file? Or do you not know how you would go about copying? Hi. So I have the logger working, meaning

Re: [Tutor] Need help appending data to a logfile

2013-06-27 Thread Dave Angel
On 06/27/2013 12:33 PM, Matt D wrote: SNIP I forgot to mention i have the 'with open(mypath, a) as f: commented out because it was making an indentation error that i could not fix. It was indented, and should not have been. The extra indentation FOLLOWS the with statement, it's not

Re: [Tutor] Need help appending data to a logfile

2013-06-27 Thread Dave Angel
On 06/27/2013 05:09 PM, Matt D wrote: On 06/27/2013 12:54 PM, Dave Angel wrote: On 06/27/2013 12:33 PM, Matt D wrote: SNIP I forgot to mention i have the 'with open(mypath, a) as f: commented out because it was making an indentation error that i could not fix. It was indented, and

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Peter Otten
Matt D wrote: On 06/24/2013 07:17 PM, Alan Gauld wrote: On 24/06/13 23:05, Matt D wrote: I have been unable to find a way to write pickled data to text file. Probably because pickled data is not plain text. You need to use binary mode. However... def __init__(self, data):

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread eryksun
On Mon, Jun 24, 2013 at 6:57 PM, Steven D'Aprano st...@pearwood.info wrote: You certainly shouldn't be writing pickle data to a log file! Firstly, log files are usually opened in text mode, not binary mode, so it probably won't work, and secondly even if it did work, you will be dumping a

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Matt D
On 06/25/2013 07:28 AM, eryksun wrote: On Mon, Jun 24, 2013 at 6:57 PM, Steven D'Aprano st...@pearwood.info wrote: You certainly shouldn't be writing pickle data to a log file! Firstly, log files are usually opened in text mode, not binary mode, so it probably won't work, and secondly even if

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Prasad, Ramit
Peter Otten wrote: Matt D wrote: On 06/24/2013 07:17 PM, Alan Gauld wrote: On 24/06/13 23:05, Matt D wrote: I have been unable to find a way to write pickled data to text file. Probably because pickled data is not plain text. You need to use binary mode. However... def

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Matt D
with open('mypicklelog.txt','ab') as log: # open in binary mode pickle.dump(self.data, log) # serialize data and write to file where pickle.dump(obj, file) converts `obj` to a sequence of bytes before it is written to `file`. I put this like this: class DataEvent(wx.PyEvent):

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Matt D
Well I think self.data is some kind of container with a pickled string, given the code to unpickle it is: Exactly! This is what the C++ file 'pickle.h' creates to send to the Python GUI: /** * A pickled Python dictionary. Used to pass stuff to the UI. */ class pickle { public:

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Prasad, Ramit
Please leave attributions in so we know who is saying what. Matt D wrote: [Ramit Prasad wrote] [Peter Otten wrote] with open('mypicklelog.txt','ab') as log: # open in binary mode pickle.dump(self.data, log) # serialize data and write to file where pickle.dump(obj, file) converts

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Alan Gauld
On 25/06/13 17:32, Matt D wrote: self.data = data with open('mypicklelog.txt','ab') as log: # open in binary mode pickle.dump(self.data, log) # serialize data and write to file And I still get nothing. Define 'nothing'. Does the file exist? Does it have

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Prasad, Ramit
Again, please leave in attributions. Matt D wrote: [Ramit Prasad wrote] Well I think self.data is some kind of container with a pickled string, given the code to unpickle it is: Exactly! This is what the C++ file 'pickle.h' creates to send to the Python GUI: Not really. /** *

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Matt D
On 06/25/2013 01:54 PM, Alan Gauld wrote: On 25/06/13 17:32, Matt D wrote: self.data = data with open('mypicklelog.txt','ab') as log: # open in binary mode pickle.dump(self.data, log) # serialize data and write to file And I still get nothing. Define

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Alan Gauld
On 25/06/13 19:30, Matt D wrote: Does the file exist? Does it have anything in it? Does self.data exist - what does it look like if you print it? Are there any error messages? Yeh nothing as in an empty file. The file is there but there is nothing written in it. OK, Try deleting the file

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Matt D
The real question is why do you want this pickle in a file? I am not sure it will be easy to pull out and reuse anyway. Given your experience level, I think this is a lot of work for something that you are unlikely to be able to easily use. I think it would be more useful to

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Steven D'Aprano
On 26/06/13 04:30, Matt D wrote: On 06/25/2013 01:54 PM, Alan Gauld wrote: On 25/06/13 17:32, Matt D wrote: self.data = data with open('mypicklelog.txt','ab') as log: # open in binary mode pickle.dump(self.data, log) # serialize data and write to file And I

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Marc Tompkins
On Tue, Jun 25, 2013 at 6:12 PM, Steven D'Aprano st...@pearwood.infowrote: Why do you want to see rubbish like that inside your log file? Surely something like this is better? log.write(data = %r % data) which will give you a line like this: data = {'a': None, 'b': 42} in your log,

Re: [Tutor] Need help printing a pickled data

2013-06-25 Thread Steven D'Aprano
On 26/06/13 03:03, Matt D wrote: meanwhile can you please take a look at this update() and tell me if you see something wrong because ever sense I tried using the array for logging the values from the TextCtrls the program is not updating meaning when the program receives the c++ map, or the

Re: [Tutor] Need help appending data to a logfile

2013-06-24 Thread Dave Angel
On 06/24/2013 05:39 PM, Matt D wrote: But what he's doing has nothing to do with logging. He's just using that word. Right, I'm not doing a debugging thing. Just trying to create a log of data that has been passed into the display of this program. Since I started trying to use the array

[Tutor] Need help printing a pickled data

2013-06-24 Thread Matt D
I have been unable to find a way to write pickled data to text file. My last attempt was to add the last two lines: # the dataevent class -- stores the data that gets transmitted when the event occurs. #it is the data in text fields, stored in self.data as a dictionary, which is basically a c++

Re: [Tutor] Need help appending data to a logfile

2013-06-24 Thread Matt D
On 06/24/2013 05:57 PM, Dave Angel wrote: On 06/24/2013 05:39 PM, Matt D wrote: But what he's doing has nothing to do with logging. He's just using that word. Right, I'm not doing a debugging thing. Just trying to create a log of data that has been passed into the display of this

Re: [Tutor] Need help printing a pickled data

2013-06-24 Thread Steven D'Aprano
On Mon, Jun 24, 2013 at 06:05:37PM -0400, Matt D wrote: I have been unable to find a way to write pickled data to text file. Normally you write pickled data to a file like this: import pickle data = {'something': 'goes', 'here': 42} with open(/path/to/file/name.pickle, rb) as f:

Re: [Tutor] Need help printing a pickled data

2013-06-24 Thread Matt D
On 06/24/2013 06:05 PM, Matt D wrote: I have been unable to find a way to write pickled data to text file. My last attempt was to add the last two lines: # the dataevent class -- stores the data that gets transmitted when the event occurs. #it is the data in text fields, stored in

Re: [Tutor] Need help printing a pickled data

2013-06-24 Thread Alan Gauld
On 24/06/13 23:05, Matt D wrote: I have been unable to find a way to write pickled data to text file. Probably because pickled data is not plain text. You need to use binary mode. However... def __init__(self, data): wx.PyEvent.__init__(self) self.SetEventType

Re: [Tutor] Need help printing a pickled data

2013-06-24 Thread Marc Tompkins
On Mon, Jun 24, 2013 at 3:48 PM, Matt D md...@nycap.rr.com wrote: def __init__(self, data): wx.PyEvent.__init__(self) # this line *binds* this class to a certain type of event, wxDATA_EVENT self.SetEventType (wxDATA_EVENT) # and this is the actual

Re: [Tutor] Need help printing a pickled data

2013-06-24 Thread Matt D
On 06/24/2013 07:17 PM, Alan Gauld wrote: On 24/06/13 23:05, Matt D wrote: I have been unable to find a way to write pickled data to text file. Probably because pickled data is not plain text. You need to use binary mode. However... def __init__(self, data):

Re: [Tutor] Need help appending data to a logfile

2013-06-23 Thread Lukáš Němec
Dne 17. 6. 2013 20:17, Dave Angel napsal(a): On 06/17/2013 01:36 PM, Matt D wrote: Hey, I wrote some simple code to write data to a logfile and it works pretty well (thanks guys). Now my problem is that every time i run the program the old logfile.txt is overwritten. I need to be able to stop

Re: [Tutor] Need help appending data to a logfile

2013-06-23 Thread Dave Angel
On 06/17/2013 02:20 PM, Lukáš Němec wrote: SNIP Or even better, use python moto, dont re-invent the wheel, so use built in library logging, read the docs for it, or if you want, I can send you some examples how to work it, it takes some time to figure out properly... But what he's doing

Re: [Tutor] Need help appending data to a logfile

2013-06-19 Thread Prasad, Ramit
Peter Otten wrote: Matt D wrote: Hey, I wrote some simple code to write data to a logfile and it works pretty well (thanks guys). Now my problem is that every time i run the program the old logfile.txt is overwritten. The help() function in the interactive interpreter is a good tool

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-19 Thread Prasad, Ramit
Matt D wrote: Also note, that unless you do self.logfile.close() it is not guaranteed that the data is being written to file. I prefer to use the following idiom for Python 2.6+ (might be in 2.5, but not sure offhand when it was added). with open('filename.txt', 'a') as f: #

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-19 Thread Matt D
A common way to trigger UI actions is a button whose callback calls that. Or you can bind in an event hook for closing the window. in __init__ add this line - self.Bind(wx.EVT_CLOSE, self.onExit) def onExit(self, event): '''Run when closing''' self.logfile.close()

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-18 Thread Prasad, Ramit
Matt D wrote: There are other ways a script might change the current directory. For example, some naive scripts use os.chdir() But how is it you don't know what the current directory was when the code ran? A simply pwd can tell you, if your prompt doesn't already reveal it. hey

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-18 Thread Matt D
Everything Dave Angel said applies. You can sort the keys by doing and sorting the keys and then logging. That should ensure field order. for k in sorted(self.fields): v = self.fields[k] Also note, that unless you do self.logfile.close() it is not guaranteed that the data is

[Tutor] Need help appending data to a logfile

2013-06-17 Thread Matt D
Hey, I wrote some simple code to write data to a logfile and it works pretty well (thanks guys). Now my problem is that every time i run the program the old logfile.txt is overwritten. I need to be able to stop and start the program without overwriting, or losing, the old data. here is the

Re: [Tutor] Need help appending data to a logfile

2013-06-17 Thread Dave Angel
On 06/17/2013 01:36 PM, Matt D wrote: Hey, I wrote some simple code to write data to a logfile and it works pretty well (thanks guys). Now my problem is that every time i run the program the old logfile.txt is overwritten. I need to be able to stop and start the program without overwriting, or

Re: [Tutor] Need help appending data to a logfile

2013-06-17 Thread Peter Otten
Matt D wrote: Hey, I wrote some simple code to write data to a logfile and it works pretty well (thanks guys). Now my problem is that every time i run the program the old logfile.txt is overwritten. The help() function in the interactive interpreter is a good tool hunt for help on

Re: [Tutor] Need help appending data to a logfile

2013-06-17 Thread Jim Mooney
On 17 June 2013 11:30, Peter Otten __pete...@web.de wrote: The help() function in the interactive interpreter is a good tool hunt for help on features of functions and classes. For example: I tripped on Python help a couple of times, since I'm used to easy-living GUI help, so here is a bit of

Re: [Tutor] Need help appending data to a logfile

2013-06-17 Thread Dave Angel
On 06/17/2013 05:17 PM, Jim Mooney wrote: On 17 June 2013 11:30, Peter Otten __pete...@web.de wrote: The help() function in the interactive interpreter is a good tool hunt for help on features of functions and classes. For example: I tripped on Python help a couple of times, since I'm used

Re: [Tutor] Need help appending data to a logfile

2013-06-17 Thread Jim Mooney
But in 3.3, it says: Help on built-in function close: close(...) with no more explanation. Hmm, I thought close in 3.3 was a method of the file handle, not a builtin function. Have I missed something? I assume all builtin functions do not need an object dot prefix, and close needs the file

Re: [Tutor] Need help appending data to a logfile

2013-06-17 Thread Mark Lawrence
On 17/06/2013 23:39, Jim Mooney wrote: But in 3.3, it says: Help on built-in function close: close(...) with no more explanation. Hmm, I thought close in 3.3 was a method of the file handle, not a builtin function. Have I missed something? I assume all builtin functions do not need an object

Re: [Tutor] Need help appending data to a logfile

2013-06-17 Thread Jim Mooney
On 17 June 2013 16:04, Mark Lawrence breamore...@yahoo.co.uk wrote: You now have an opportunity to expand your knowledge of the Python infrastructure by raising your first bug report to get this fixed. I look forward to seeing your effort on the bug tracker mailing list. Well, although I

Re: [Tutor] Need help appending data to a logfile

2013-06-17 Thread Dave Angel
On 06/17/2013 08:07 PM, Jim Mooney wrote: On 17 June 2013 16:04, Mark Lawrence breamore...@yahoo.co.uk wrote: You now have an opportunity to expand your knowledge of the Python infrastructure by raising your first bug report to get this fixed. I look forward to seeing your effort on the bug

Re: [Tutor] Need help appending data to a logfile

2013-06-17 Thread eryksun
On Mon, Jun 17, 2013 at 5:43 PM, Dave Angel da...@davea.name wrote: But in 3.3, it says: Help on built-in function close: close(...) with no more explanation. The category built-in function here doesn't mean it's in the builtins namespace. It means it's a function or method from an

Re: [Tutor] Need help appending data to a logfile

2013-06-17 Thread Jim Mooney
On 17 June 2013 17:57, Dave Angel da...@davea.name wrote: Well, although I would like to see my name in lights, I didn't discover it, Dave did, so that would be dishonest ;') http://bugs.python.org/issue18249 filed at 8:55 pm Looks like you've got a quibble on that. But the point is, it

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-13 Thread Matt D
On 06/13/2013 03:39 AM, Alan Gauld wrote: On 13/06/13 05:24, Matt D wrote: I already told you i found the file? why would someone else be running the program? Because it does something useful? Most pro programmers write programs for other people to use. Even an amateur may be creating

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Matt D
On 06/10/2013 12:23 PM, Prasad, Ramit wrote: Matt D wrote: Ramit Prasad wrote: Scrolled panel is just a graphical container that allows for scrolling inside, but it is the window that scrolls not widgets inside it. This of it like a webpage that scrolls. If you use web email the text

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Dave Angel
On 06/12/2013 05:32 PM, Matt D wrote: On 06/10/2013 12:23 PM, Prasad, Ramit wrote: Matt D wrote: Ramit Prasad wrote: Scrolled panel is just a graphical container that allows for scrolling inside, but it is the window that scrolls not widgets inside it. This of it like a webpage that scrolls.

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Matt D
On 06/12/2013 05:59 PM, Dave Angel wrote: On 06/12/2013 05:32 PM, Matt D wrote: On 06/10/2013 12:23 PM, Prasad, Ramit wrote: Matt D wrote: Ramit Prasad wrote: Scrolled panel is just a graphical container that allows for scrolling inside, but it is the window that scrolls not widgets inside

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Dave Angel
On 06/12/2013 08:46 PM, Matt D wrote: On 06/12/2013 05:59 PM, Dave Angel wrote: On 06/12/2013 05:32 PM, Matt D wrote: SNIP Hey, if i put: self.logfile = open('logfile.csv', 'w') in the .py file, within the 'class TrafficPane', then shouldn't logfile.csv be written to the directory

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Matt D
There are other ways a script might change the current directory. For example, some naive scripts use os.chdir() But how is it you don't know what the current directory was when the code ran? A simply pwd can tell you, if your prompt doesn't already reveal it. hey i found the

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Dave Angel
On 06/12/2013 09:23 PM, Matt D wrote: There are other ways a script might change the current directory. For example, some naive scripts use os.chdir() But how is it you don't know what the current directory was when the code ran? A simply pwd can tell you, if your prompt doesn't already

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-12 Thread Matt D
On 06/12/2013 09:54 PM, Dave Angel wrote: On 06/12/2013 09:14 PM, Matt D wrote: On 06/12/2013 09:02 PM, Dave Angel wrote: On 06/12/2013 08:46 PM, Matt D wrote: On 06/12/2013 05:59 PM, Dave Angel wrote: On 06/12/2013 05:32 PM, Matt D wrote: SNIP Hey, if i put: self.logfile =

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-04 Thread Prasad, Ramit
Matt D wrote: Hello, I am using an open source wxPython GUI that I like very very much. I have ideas about some modifications I need but I cannot be bothering the author too much so I must learn some very specific things about Python in order to make the modification myself. First, I need

[Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-03 Thread Matt D
Hello, I am using an open source wxPython GUI that I like very very much. I have ideas about some modifications I need but I cannot be bothering the author too much so I must learn some very specific things about Python in order to make the modification myself. First, I need some help

Re: [Tutor] Need Help Modifying a wxPython GUI (scrolling display and logging)

2013-06-03 Thread Alan Gauld
On 03/06/13 15:01, Matt D wrote: I am using an open source wxPython GUI that I like very very much. I have ideas about some modifications I need but I cannot be bothering the author too much so I must learn some very specific things about Python OK, we can help on the python bits but not so

[Tutor] Need help on win32 application error

2013-04-02 Thread Ankesh.Pratap
Hi Team, I am facing folowing erro while executing python code: Win32 exception occurred releasing IUnknown at 0x03210eb8 Please let me know the resolution of the same.PFA the version details of python exe that I am using. Thanks and Regards, Ankesh Pratap Programmer

Re: [Tutor] Need help on win32 application error

2013-04-02 Thread Bod Soutar
On 2 April 2013 19:19, ankesh.pra...@cognizant.com wrote: Hi Team, I am facing folowing erro while executing python code: Win32 exception occurred releasing IUnknown at 0x03210eb8 Please let me know the resolution of the same.PFA the version details of python exe that I

Re: [Tutor] Need help on win32 application error

2013-04-02 Thread Alan Gauld
On 02/04/13 19:19, ankesh.pra...@cognizant.com wrote: Hi Team, I am facing folowing erro while executing python code: Win32 exception occurred releasing IUnknown at 0x03210eb8 Please let me know the resolution of the same.PFA the version details of python exe that I am

Re: [Tutor] Need help on win32 application error

2013-04-02 Thread Tim Golden
On 02/04/2013 19:19, ankesh.pra...@cognizant.com wrote: I am facing folowing erro while executing python code: Win32 exception occurred releasing IUnknown at 0x03210eb8 You need to give us a bit more of a clue as to what your code does. My guess is that you're using the

Re: [Tutor] Need help with python keyboard press/navigation commands

2013-03-12 Thread Danny Yoo
On Mon, Mar 11, 2013 at 8:59 PM, akuma ukpo johnnyu...@gmail.com wrote: This is the problem Implement a function called get_direction which, on a particular character , gives the direction corresponding to that character. Do you know how to write a test case for this function? You had test

Re: [Tutor] Need help with python keyboard press/navigation commands

2013-03-12 Thread Alan Gauld
On 12/03/13 03:59, akuma ukpo wrote: I have tried def get_direction(self): whenever a key is pressed the character moves to the direction corresponding to the key 'North':w 'South': s 'East' : d 'West' : a What did

Re: [Tutor] Need help with python keyboard press/navigation commands

2013-03-12 Thread Robert Sjoblom
Finally, from a user experience point of view, it might be more logical to make the keys w,a,s,z North, West,East and South respectively since its a more logical correspondence to the compass points (assuming a standard QWERTY keyboard layout). Most games use WASD, so user experience would be

Re: [Tutor] Need help with python keyboard press/navigation commands

2013-03-12 Thread ALAN GAULD
Finally, from a user experience point of view, it might be more logical to make the keys w,a,s,z North, West,East and South respectively  Most games use WASD, so user experience would be in favour of it compared to WASZ. There are a couple of reasons for this:  You live and learn! :-) You

[Tutor] Need help with python keyboard press/navigation commands

2013-03-11 Thread akuma ukpo
This is the problem Implement a function called get_direction which, on a particular character , gives the direction corresponding to that character. The correspondences are as follows:  The character ’w’ corresponds to the direction ’North’  The character ’a’ corresponds to the direction

<    1   2   3   4   5   >