Re: Python Noob, open file dialog

2014-06-18 Thread cutey Love
No it's still paused after selection and only excutes when the window is closed. On Tuesday, June 17, 2014 6:34:41 PM UTC+1, MRAB wrote: > On 2014-06-17 17:49, cutey Love wrote: > > > My first attempt at Python, > > > > > > I'm using Tkinter and all is going well except when I'm using > > > >

Re: Python Noob, open file dialog

2014-06-18 Thread Chris Angelico
On Wed, Jun 18, 2014 at 5:36 PM, cutey Love wrote: > No it's still paused after selection and only excutes when the window is > closed. Treat the file dialog exactly the way you would in a text editor or word processor. Does your program continue as normal then? If not, please be really specific

Re: Python Noob, open file dialog

2014-06-18 Thread alister
On Wed, 18 Jun 2014 00:36:29 -0700, cutey Love wrote: > No it's still paused after selection and only excutes when the window is > closed. > > On Tuesday, June 17, 2014 6:34:41 PM UTC+1, MRAB wrote: >> On 2014-06-17 17:49, cutey Love wrote: >> >> > My first attempt at Python, >> > I'm using Tkin

Re: Python Noob, open file dialog

2014-06-18 Thread cutey Love
I'm on windows, I'm going to uninstall python and reinstall On Wednesday, June 18, 2014 9:32:40 AM UTC+1, alister wrote: > On Wed, 18 Jun 2014 00:36:29 -0700, cutey Love wrote: > > > > > No it's still paused after selection and only excutes when the window is > > > closed. > > > > > > On Tu

Under what kind of situation, time.sleep(n) would sleep much longer than n seconds?

2014-06-18 Thread crow
Hi. I'm writing some scripts with python, and I found sometimes, when I try to use time.sleep(1) to sleep 1 sec, it would actually sleep for 9 secs or even longer. >From python document, I saw this: time.sleep(secs) Also, the suspension time may be longer than requested by an arbitrary amo

Re: Create flowcharts from Python

2014-06-18 Thread Nagy László Zsolt
Is there a library for Python that can easily create flowcharts using a simple API? Maybe https://code.google.com/p/pydot/ ? Found another one: http://pygraphviz.github.io/ - this one seems to have better documentation. pydot may be functional but I could not find documentation on it. -- ht

celery errors in eclipse

2014-06-18 Thread xeon Mailinglist
I am using celery in my program to invoke remote functions using a message queueing service (RabbitMQ). I call my function with celery with this: myfunc.apply_async(queue=cluster, args=(chain, cluster, )), but although the call is correct and it works, in eclipse I get the error that "undefin

Re: Under what kind of situation, time.sleep(n) would sleep much longer than n seconds?

2014-06-18 Thread Chris Angelico
On Wed, Jun 18, 2014 at 7:52 PM, crow wrote: > So, my question: under what kind of condition, time.sleep would suspend > longer time than expected? > > Anybody got interested? There are several reasons the sleep time is always described as "at least" that long. Firstly, your process will always

Re: Under what kind of situation, time.sleep(n) would sleep much longer than n seconds?

2014-06-18 Thread Marko Rauhamaa
crow : > I'm writing some scripts with python, and I found sometimes, when I > try to use time.sleep(1) to sleep 1 sec, it would actually sleep for 9 > secs or even longer. > > [...] > > So, my question: under what kind of condition, time.sleep would > suspend longer time than expected? That coul

python newbie

2014-06-18 Thread Maura E Monville
My supervisor has palmed me off with a python code, written by a collaborator, which implements an algorithm aimed at denoising the dose distribution (energy per unit mass) output from a radiation transport Monte Carlo code. My task is to translate the python code into a MatLab code. A colleague

Re: python newbie

2014-06-18 Thread Steven D'Aprano
On Wed, 18 Jun 2014 05:10:03 -0700, Maura E Monville wrote: > My supervisor has palmed me off with a python code, written by a > collaborator, which implements an algorithm aimed at denoising the dose > distribution (energy per unit mass) output from a radiation transport > Monte Carlo code. My ta

Re: python newbie

2014-06-18 Thread Maura E Monville
On Wednesday, June 18, 2014 1:50:54 PM UTC+1, Steven D'Aprano wrote: > On Wed, 18 Jun 2014 05:10:03 -0700, Maura E Monville wrote: > > > > > My supervisor has palmed me off with a python code, written by a > > > collaborator, which implements an algorithm aimed at denoising the dose > > > dist

Re: Python Noob, open file dialog

2014-06-18 Thread Mark Lawrence
On 18/06/2014 10:03, cutey Love wrote: I'm on windows, I'm going to uninstall python and reinstall On Wednesday, June 18, 2014 9:32:40 AM UTC+1, alister wrote: Please also see the various comments regarding top posting & google groups Please note that if you carry on top posting and (mis)us

Re: Under what kind of situation, time.sleep(n) would sleep much longer than n seconds?

2014-06-18 Thread crow
Hi, Chris & Marko Thanks for your reply. I find the reason why my time.sleep take longer time. In my script, I use wxPython to build up my GUI, and I open another thread to do network communications. It turned out that if you create a wx.Frame & make it show up, then your time.sleep may sleep l

Understanding Python Code

2014-06-18 Thread subhabangalore
Dear Group, I have a Python code taken from Wikipedia.("http://en.wikipedia.org/wiki/Forward%E2%80%93backward_algorithm";) The code is pasted below. >>> states = ('Healthy', 'Fever') >>> end_state = 'E' >>> observations = ('normal', 'cold', 'dizzy') >>> start_probability = {'Healthy': 0.6, 'Fe

Not Responding When Dealing with Large Data

2014-06-18 Thread cutey Love
I'm trying to read in 10 lines of text, use some functions to edit them and then return a new list. The problem is my program always goes not responding when the amount of lines are a high number. I don't care how long the program takes to work, just need it to stop crashing? -- https://ma

Re: Not Responding When Dealing with Large Data

2014-06-18 Thread Philip Dexter
On Wed, Jun 18, 2014 at 1:20 PM, cutey Love wrote: > I'm trying to read in 10 lines of text, use some functions to edit them > and then return a new list. > > The problem is my program always goes not responding when the amount of lines > are a high number. > > I don't care how long the prog

Re: Not Responding When Dealing with Large Data

2014-06-18 Thread Tim
On Wednesday, June 18, 2014 1:20:13 PM UTC-4, cutey Love wrote: > I'm trying to read in 10 lines of text, use some functions to edit them > and then return a new list. > The problem is my program always goes not responding when the amount of lines > are a high number. > I don't care how long

Re: Not Responding When Dealing with Large Data

2014-06-18 Thread John Gordon
In <00d330e3-fc8a-4b7e-b2bd-f1a48bc33...@googlegroups.com> cutey Love writes: > The problem is my program always goes not responding when the amount of > lines are a high number. > I don't care how long the program takes to work, just need it to stop > crashing? How long have you tried waiting

Re: python newbie

2014-06-18 Thread Jim Gibson
In article , Maura E Monville wrote: > My supervisor has palmed me off with a python code, written by a > collaborator, which implements an algorithm aimed at denoising the dose > distribution (energy per unit mass) output from a radiation transport Monte > Carlo code. > My task is to translate t

Re: Understanding Python Code

2014-06-18 Thread Ian Kelly
On Wed, Jun 18, 2014 at 10:36 AM, wrote: > The questions are, > i) prev_f_sum = sum(f_prev[k]*a[k][st] for k in states) > here f_prev is called, > f_prev is assigned to f_curr ["f_prev = f_curr"] > f_curr[st] is again being calculated as, ["f_curr[st] = e[st][x_i] * > prev_f_sum"] which again

Re: pypi - package metdata

2014-06-18 Thread Maciej Dziardziel
On Wednesday, June 18, 2014 8:21:12 PM UTC+1, Maciej Dziardziel wrote: > I wasn't quiet happy with the way search on pypi works, > > so I've got an idea of getting all package metadata from pypi > > and do search locally. The only problem is that I can't figure out > > where to get the data from

pypi - package metdata

2014-06-18 Thread Maciej Dziardziel
I wasn't quiet happy with the way search on pypi works, so I've got an idea of getting all package metadata from pypi and do search locally. The only problem is that I can't figure out where to get the data from. I tried to use bandersnatch to set up mirror, but all I've got was a mixture of egg,

Re: Not Responding When Dealing with Large Data

2014-06-18 Thread Michael Torrie
On 06/18/2014 11:20 AM, cutey Love wrote: > I'm trying to read in 10 lines of text, use some functions to > edit them and then return a new list. > > The problem is my program always goes not responding when the amount > of lines are a high number. > > I don't care how long the program takes

Re: Not Responding When Dealing with Large Data

2014-06-18 Thread Paul McNett
On 6/18/14, 10:20 AM, cutey Love wrote: I'm trying to read in 10 lines of text, use some functions to edit them and then return a new list. How is it that you are opening the file, and iterating the contents? The problem is my program always goes not responding when the amount of lines

Re: pypi - package metdata

2014-06-18 Thread Mark Lawrence
On 18/06/2014 20:24, Maciej Dziardziel wrote: On Wednesday, June 18, 2014 8:21:12 PM UTC+1, Maciej Dziardziel wrote: I wasn't quiet happy with the way search on pypi works, so I've got an idea of getting all package metadata from pypi and do search locally. The only problem is that I can't fig

Re: Generate Single PowerPoint from two powerpoints using pywin32(python)

2014-06-18 Thread Paul McNett
On 6/16/14, 11:20 PM, Jaydeep Patil wrote: I have two powerpoints, which consists of images in each slide. I need to read each powerpoint, copy images from both powerpoint & paste these images into output powerpoint side by side. How should i do thism using python? The repoisition of shapes see

Re: pypi - package metdata

2014-06-18 Thread Terry Reedy
On 6/18/2014 3:24 PM, Maciej Dziardziel wrote: On Wednesday, June 18, 2014 8:21:12 PM UTC+1, Maciej Dziardziel wrote: I wasn't quiet happy with the way search on pypi works, so I've got an idea of getting all package metadata from pypi and do search locally. The only problem is that I can't fi

Re: pypi - package metdata

2014-06-18 Thread Maciej Dziardziel
On Wednesday, June 18, 2014 9:12:46 PM UTC+1, Mark Lawrence wrote: > Why not use google and do a site specific search of pypi? I am looking for good use of elasticsearch I have there, rather then quick way of finding something once quickly. Neither pypi nor google provide faceting for example. I'

Re: Not Responding When Dealing with Large Data

2014-06-18 Thread cutey Love
Hi, thanks for the replies, I mean windows displays "Not responding close the program now" How can I do it asynconistrically? It's simple code just open file, loop through line by line and do some comparons with the string. On Wednesday, June 18, 2014 6:20:13 PM UTC+1, cutey Love wrote: > I'm

Re: Not Responding When Dealing with Large Data

2014-06-18 Thread Paul McNett
On 6/18/14, 3:32 PM, cutey Love wrote: Hi, thanks for the replies, I mean windows displays "Not responding close the program now" How can I do it asynconistrically? It's simple code just open file, loop through line by line and do some comparons with the string. To get anything better from

Python Fails to Write to File

2014-06-18 Thread cutey Love
I'm trying to write data to a text file But I'm getting the error: TypeError: invalid file: <_io.TextIOWrapper Code is def saveFile(): file_path = filedialog.asksaveasfile(mode='w', filetypes=[('text files', '.txt')], defaultextension=".txt") fo = open(file_path, 'w') for e

Re: Python Fails to Write to File

2014-06-18 Thread Ian Kelly
On Wed, Jun 18, 2014 at 5:03 PM, cutey Love wrote: > I'm trying to write data to a text file > > But I'm getting the error: > > TypeError: invalid file: <_io.TextIOWrapper Post the full traceback. By posting only the error message you're removing useful information. -- https://mail.python.org/m

Re: Python Fails to Write to File

2014-06-18 Thread Paul McNett
On 6/18/14, 4:03 PM, cutey Love wrote: I'm trying to write data to a text file But I'm getting the error: TypeError: invalid file: <_io.TextIOWrapper Always better to err on posting too much context (the entire traceback) than too little. Code is def saveFile(): file_path = filedia

Re: Not Responding When Dealing with Large Data

2014-06-18 Thread Ian Kelly
On Wed, Jun 18, 2014 at 4:32 PM, cutey Love wrote: > Hi, thanks for the replies, > > I mean windows displays "Not responding close the program now" > > How can I do it asynconistrically? > > It's simple code just open file, loop through line by line and do some > comparons with the string. If al

Re: Under what kind of situation, time.sleep(n) would sleep much longer than n seconds?

2014-06-18 Thread Chris Angelico
On Thu, Jun 19, 2014 at 1:24 AM, crow wrote: > Here is a sample code that can reproduce this issue, you need to wait for it > to run for a while. > ** > import time > import threading > import wx > > def sleep(): > while True: > t = time.time() > time.sleep(1)

Re: Under what kind of situation, time.sleep(n) would sleep much longer than n seconds?

2014-06-18 Thread crow
Hi, Chris Thanks for the suggestion. For my script, I want to download a picture from internet & show it in a window, that's why I use wxPython. Well, I think I may can avoid sleep in wxPython in 2 ways: 1. Use web.py, let python do backend work, let browser show me everything. As you suggeste

Re: Under what kind of situation, time.sleep(n) would sleep much longer than n seconds?

2014-06-18 Thread Chris Angelico
On Thu, Jun 19, 2014 at 11:41 AM, crow wrote: > Thanks for the suggestion. > For my script, I want to download a picture from internet & show it in a > window, that's why I use wxPython. > > Well, I think I may can avoid sleep in wxPython in 2 ways: > 1. Use web.py, let python do backend work, le

Re: Understanding Python Code

2014-06-18 Thread subhabangalore
On Thursday, June 19, 2014 12:45:49 AM UTC+5:30, Ian wrote: > > > > The questions are, > > > i) prev_f_sum = sum(f_prev[k]*a[k][st] for k in states) > > > here f_prev is called, > > > f_prev is assigned to f_curr ["f_prev = f_curr"] > > > f_curr[st] is again being calculated as, ["f_curr[st

how to check if a value is a floating point or not

2014-06-18 Thread nicholascannon1
I am making a calculator and i need it to support floating point values but i am using the function isnumeric to check if the user has entered an int value. I need the same for floating point types so i could implement an or in the if statement that checks the values the user has entered and all

Re: how to check if a value is a floating point or not

2014-06-18 Thread Gary Herron
On 06/18/2014 10:53 PM, nicholascann...@gmail.com wrote: I am making a calculator and i need it to support floating point values but i am using the function isnumeric to check if the user has entered an int value. I need the same for floating point types so i could implement an or in the if st

Re: how to check if a value is a floating point or not

2014-06-18 Thread Nicholas Cannon
On Thursday, June 19, 2014 1:53:31 PM UTC+8, Nicholas Cannon wrote: > I am making a calculator and i need it to support floating point values but i > am using the function isnumeric to check if the user has entered an int > value. I need the same for floating point types so i could implement an o