Problem while building Python 3.6 from source.

2017-01-13 Thread Michael S
Hello,
I am new to this mailing-list and I really don't know whether this
mail should belong to python-dev. Please tell me, if so.


Unfortunately, I have got the following problem: I wanted to build and
install Python 3.6 from source but did not succeed.
To clarify my situation, I got as an operating system Debian jessie
8.6 and I used the xz compressed source tarball from
https://www.python.org/downloads/release/python-360/.
Concerning the build dependencies: I just executed:
$ sudo apt-get build-dep python3.4 (since 3.6 and 3.5 did not work).
Then I executed ./configure --enable-optimizations and make -j4 (I got 4 cores).
The output of make ended like:
'make: *** [profile-opt] Error 2'.
I had redirected the output and error of the configure and make commands via
$ make -j4 &> /home/username/make_output.txt.
Nevertheless I got an error to the console:
'*** Error in ./python'" free(): invalid next size (normal):
0x015bdf90 ***'.
Due to these error messages (this one and the one at the end of make)
I think the build was not successful.

How to solve this problem?

Of course I could send you the output and error files.

I'd be glad at any help.
-MichaelS
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Problem while building Python 3.6 from source.

2017-01-15 Thread Michael S
Thanks Thomas and ChrisA!

@Thomas: I don't know.. Unfortunately I am not as skilled as to be
able to find out..

@ChrisA: I tried your advice and think it worked. So, I just used $
./configure and then $ make. Then I was not sure, whether it had
worked so I used $ make test and got a fairly long result. At the end
there was a line like "test successful". Nevertheless not all of the
tests were successful.

So, now I got some questions:

1) Why did not all of the tests in $ make test succeed? But the end
line was "test successful". That confuses me.

2) This is more general. In order to get the build-dependencies I used
# apt-get build-dep python3.4. I also googled for the build
dependencies but did not find anything. So, how could I actually
figure out the build dependencies for Python3.6?


On Fri, Jan 13, 2017 at 7:19 PM, Chris Angelico  wrote:
> On Sat, Jan 14, 2017 at 5:00 AM, Michael S  wrote:
>> Hello,
>> I am new to this mailing-list and I really don't know whether this
>> mail should belong to python-dev. Please tell me, if so.
>
> Hi and welcome! This kind of thing is best on this list initially.
>
>> Unfortunately, I have got the following problem: I wanted to build and
>> install Python 3.6 from source but did not succeed.
>> To clarify my situation, I got as an operating system Debian jessie
>> 8.6 and I used the xz compressed source tarball from
>> https://www.python.org/downloads/release/python-360/.
>> Concerning the build dependencies: I just executed:
>> $ sudo apt-get build-dep python3.4 (since 3.6 and 3.5 did not work).
>
> That should be fine; the build dependencies of Python don't tend to
> change frequently. Jessie shipped with Python 3.4 but nothing newer,
> so there won't be packages for python3.5 or python3.6.
>
>> Then I executed ./configure --enable-optimizations and make -j4 (I got 4 
>> cores).
>> The output of make ended like:
>> 'make: *** [profile-opt] Error 2'.
>
> That just means that something went wrong. You'd have to scroll up to
> find the actual cause of the error.
>
>> I had redirected the output and error of the configure and make commands via
>> $ make -j4 &> /home/username/make_output.txt.
>> Nevertheless I got an error to the console:
>> '*** Error in ./python'" free(): invalid next size (normal):
>> 0x015bdf90 ***'.
>> Due to these error messages (this one and the one at the end of make)
>> I think the build was not successful.
>>
>> How to solve this problem?
>>
>> Of course I could send you the output and error files.
>
> The first thing I'd do would be to try a non-optimized build. Set your
> current build tree aside and re-extract into a new directory (that
> way, when you go back to playing with optimized builds, you don't have
> to redo the work), and run configure with no arguments. I'd also be
> inclined to run make with no arguments; there've been issues with
> parallel builds in enough projects that I've gotten into the habit of
> "problem? do it the slow way". If that build also fails, scroll up a
> bit and find where stuff failed.
>
> Are you familiar with building programs from source? If not, the best
> solution might be to post the entire log, but ideally, you should be
> able to skim through the last part of the log and report the actual
> problem that's cropping up.
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


implementing pyshark

2015-04-06 Thread Michael S.

Hi everyone. while trying to implement pyshark, i am getting this error:
   import pyshark
  capture = pyshark.LiveCapture(interface='wlan0')
  capture.sniff(timeout=50)
  capture
i have tried also to run it through interpreter yet, i got this error:
import pyshark
---
ImportError   Traceback (most recent call last)
 in ()
> 1 import pyshark

/usr/local/lib/python2.7/dist-packages/pyshark-0.3.4-py2.7.egg/pyshark/__init__.py 
in ()

> 1 from pyshark.capture.live_capture import LiveCapture
  2 from pyshark.capture.file_capture import FileCapture
  3 from pyshark.capture.remote_capture import RemoteCapture
  4 from pyshark.capture.inmem_capture import InMemCapture

/usr/local/lib/python2.7/dist-packages/pyshark-0.3.4-py2.7.egg/pyshark/capture/live_capture.py 
in ()

> 1 from pyshark.capture.capture import Capture
  2 from pyshark.tshark.tshark import get_tshark_interfaces
  3
  4
  5 class LiveCapture(Capture):

/usr/local/lib/python2.7/dist-packages/pyshark-0.3.4-py2.7.egg/pyshark/capture/capture.py 
in ()

  1 from __future__ import unicode_literals
  2 import os
> 3 import logbook
  4 import sys
  5

/usr/local/lib/python2.7/dist-packages/logbook/__init__.py in ()
 12
 13
---> 14 from logbook.base import LogRecord, Logger, LoggerGroup, 
NestedSetup, \
 15  Processor, Flags, get_level_name, lookup_level, 
dispatch_record, \

 16  CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG, NOTSET, \

/usr/local/lib/python2.7/dist-packages/logbook/base.py in ()
 16 from datetime import datetime
 17 from logbook import helpers
---> 18 from logbook.concurrency import thread_get_name, 
thread_get_ident, greenlet_get_ident

 19
 20 from logbook.helpers import to_safe_json, parse_iso8601, 
cached_property, \


/usr/local/lib/python2.7/dist-packages/logbook/concurrency.py in ()
 29
 30 if has_gevent:
---> 31 from gevent._threading import (Lock as ThreadLock,
 32RLock as ThreadRLock,
 33get_ident as thread_get_ident,

ImportError: No module named _threading

i tried importing threading first and importing pyshark, but the answer 
was the same.

any suggestions?
--
https://mail.python.org/mailman/listinfo/python-list


Re: implementing pyshark

2015-04-06 Thread Michael S.
I am using kali-linux(debian based). i have installed all from 
repository. i haven't tried yet to use the source but i don't think it 
was compiled incorrectly. Kali's developers are quite precise in terms 
of OS development.


On 04/06/2015 03:05 PM, Steven D'Aprano wrote:

On Mon, 6 Apr 2015 06:40 pm, Michael S. wrote:


Hi everyone. while trying to implement pyshark, i am getting this error:

[...]


ImportError: No module named _threading


Well that's awesome. I don't think I've seen that in Python 2.7 before.
Apparently, you are using a version of Python compiled without support for
threading. I didn't think that was still possible.

How did you install Python? Did you build it from source?

My guess is that you did build from source, but you were missing some
packages needed for threading support so the Python interpreter was built
without threading. That means you'll have to re-install to fix this
problem.

But first you'll need to install the necessary dependencies. What operating
system and/or distro are you using? It looks like Linux or Unix, or maybe
Mac OS X.




--
https://mail.python.org/mailman/listinfo/python-list


Re: implementing pyshark

2015-04-06 Thread Michael S.

import gevent --->  successful
import gevent._threading ---> fails
 output :
In [2]: import gevent._threading
---
ImportError   Traceback (most recent call last)
 in ()
> 1 import gevent._threading

ImportError: No module named _threading

In [3]: import gevent_threading
---
ImportError   Traceback (most recent call last)
 in ()
> 1 import gevent_threading

ImportError: No module named gevent_threading



On 04/06/2015 03:11 PM, Peter Otten wrote:

Michael S. wrote:


Hi everyone. while trying to implement pyshark, i am getting this error:
 import pyshark
capture = pyshark.LiveCapture(interface='wlan0')
capture.sniff(timeout=50)
capture
i have tried also to run it through interpreter yet, i got this error:
import pyshark


---

ImportError   Traceback (most recent call
last)  in ()
> 1 import pyshark

/usr/local/lib/python2.7/dist-packages/pyshark-0.3.4-

py2.7.egg/pyshark/__init__.py

in ()
> 1 from pyshark.capture.live_capture import LiveCapture
2 from pyshark.capture.file_capture import FileCapture
3 from pyshark.capture.remote_capture import RemoteCapture
4 from pyshark.capture.inmem_capture import InMemCapture

/usr/local/lib/python2.7/dist-packages/pyshark-0.3.4-

py2.7.egg/pyshark/capture/live_capture.py

in ()
> 1 from pyshark.capture.capture import Capture
2 from pyshark.tshark.tshark import get_tshark_interfaces
3
4
5 class LiveCapture(Capture):

/usr/local/lib/python2.7/dist-packages/pyshark-0.3.4-

py2.7.egg/pyshark/capture/capture.py

in ()
1 from __future__ import unicode_literals
2 import os
> 3 import logbook
4 import sys
5

/usr/local/lib/python2.7/dist-packages/logbook/__init__.py in ()
   12
   13
---> 14 from logbook.base import LogRecord, Logger, LoggerGroup,
NestedSetup, \
   15  Processor, Flags, get_level_name, lookup_level,
dispatch_record, \
   16  CRITICAL, ERROR, WARNING, NOTICE, INFO, DEBUG, NOTSET, \

/usr/local/lib/python2.7/dist-packages/logbook/base.py in ()
   16 from datetime import datetime
   17 from logbook import helpers
---> 18 from logbook.concurrency import thread_get_name,
thread_get_ident, greenlet_get_ident
   19
   20 from logbook.helpers import to_safe_json, parse_iso8601,
cached_property, \

/usr/local/lib/python2.7/dist-packages/logbook/concurrency.py in
()
   29
   30 if has_gevent:
---> 31 from gevent._threading import (Lock as ThreadLock,
   32RLock as ThreadRLock,
   33get_ident as thread_get_ident,

ImportError: No module named _threading

i tried importing threading first and importing pyshark, but the answer
was the same.
any suggestions?

Line 30 suggests that pyshark assumes that gevent is installed while line 31
indicates that gevent is not installed correctly.

So do you have an incomplete install of gevent? Either remove it or replace
it with a working one, i. e.

import gevent
import gevent._threading

should either both fail or both succeed.



-- 
https://mail.python.org/mailman/listinfo/python-list


Re: implementing pyshark

2015-04-06 Thread Michael S.



On 04/07/2015 03:55 AM, Steven D'Aprano wrote:

On Mon, 6 Apr 2015 10:45 pm, Michael S. wrote:


I am using kali-linux(debian based). i have installed all from
repository. i haven't tried yet to use the source but i don't think it
was compiled incorrectly. Kali's developers are quite precise in terms
of OS development.

What happens if you import threading?


If it returns without failure, then your Python interpreter is built
correctly with support for threading, and my guess was wrong.

If you get an error about no module _threading (or possibly _thread, I
forget which) then it is built without support for threading.

But, I'm now leaning towards thinking that Peter Otten's answer is more
likely. It seems to be gevent._threading that is missing. It wasn't
entirely clear from your original post, but in looking back I think Peter
is correct.

You should check whether you are accidentally shadowing gevent:

import gevent
print(gevent.__file__)


If that prints the file name of the actual gevent library, then it is
possible that you have a broken or outdated version of the library.

But if it is a file you have created, then you are shadowing the gevent
library, blocking Python from importing the library, it imports your
version instead. Rename your gevent.py file and the problem will hopefully
go away.




 Hi ,
i tried your suggestion: it did print the lib directory. - i tried 
removing the gevent deb-package and then installing  from src but got 
the same error.

I'll download other OS and will test it there.
--
https://mail.python.org/mailman/listinfo/python-list


[no subject]

2006-10-24 Thread Michael S
Good day all.

I extended part of my program in C, since that part
was too involved for Python. Now when I import the
module I created and call its functions, I am trying
to feedback some information bac to my wxPython
program. The function runs for a while and I wanted to
update a progress bar, but when I call the function of
my new module, wxPython doesn't respond when wx.Timer
is supposed to fire.

Any suggestions?

Michael
-- 
http://mail.python.org/mailman/listinfo/python-list


Re:

2006-10-25 Thread Michael S
Thanks Gabriel.
I think I'll try calling my module from a separate
thread as calling wxPython or even Python code from C
would be a bit complicated. My extension calls simple
 functions, but the issue was that the files
I operate on are huge in size and Python was taking a
long time and/or choking.

--- Gabriel Genellina <[EMAIL PROTECTED]> wrote:

> At Tuesday 24/10/2006 23:25, Michael S wrote:
> 
> >I extended part of my program in C, since that part
> >was too involved for Python. Now when I import the
> >module I created and call its functions, I am
> trying
> >to feedback some information bac to my wxPython
> >program. The function runs for a while and I wanted
> to
> >update a progress bar, but when I call the function
> of
> >my new module, wxPython doesn't respond when
> wx.Timer
> >is supposed to fire.
> 
> Does your extension run on a separate thread? I
> guess not. So the 
> wxPython code does not have a chance to run.
> Do it the other way: from your C code, call a Python
> function which 
> in turn updates the progress bar (and keep it
> simple!)
> 
> 
> -- 
> Gabriel Genellina
> Softlab SRL 
> 
> __
> Correo Yahoo!
> Espacio para todos tus mensajes, antivirus y
> antispam �gratis! 
> �Abr� tu cuenta ya! - http://correo.yahoo.com.ar
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: [wxPython-users] Re:

2006-10-25 Thread Michael S
If I create a threading.Thread derived class, and run
the wxPython code in the main thread; using a lock,
will I be able to suspend the Thread, even though it
will run the C code, which is essentially a while loop
looping through millions of lines of a text file?

Thanks in advance.
Michael

--- Josiah Carlson <[EMAIL PROTECTED]> wrote:

> 
> Gabriel Genellina <[EMAIL PROTECTED]> wrote:
> > At Tuesday 24/10/2006 23:25, Michael S wrote:
> > 
> > >I extended part of my program in C, since that
> part
> > >was too involved for Python. Now when I import
> the
> > >module I created and call its functions, I am
> trying
> > >to feedback some information bac to my wxPython
> > >program. The function runs for a while and I
> wanted to
> > >update a progress bar, but when I call the
> function of
> > >my new module, wxPython doesn't respond when
> wx.Timer
> > >is supposed to fire.
> > 
> > Does your extension run on a separate thread? I
> guess not. So the 
> > wxPython code does not have a chance to run.
> > Do it the other way: from your C code, call a
> Python function which 
> > in turn updates the progress bar (and keep it
> simple!)
> 
> Unless the GUI thread has a chance to take passes
> through the wxPython
> mainloop, the progress bar, etc., may not actually
> be updated on some
> platforms.
> 
> Mr. Sherman would likely be better off creating a
> new thread which
> handles processing, which could update a C global
> variable, which the
> GUI thread can poll to update its progress bar, etc.
>  Alternatively, if
> the processing can be broken down into smaller
> pieces, the secondary
> thread can call the pieces and post events back to
> the GUI thread to
> update the progress bar (via explicit wx.PostEvent
> or implicit
> wx.CallAfter).
> 
> 
>  - Josiah
> 
> 
>
-
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
> 
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: cleaner way to write this?

2006-10-25 Thread Michael S
How about this?
def create_db_name(self):
dlg = wx.TextEntryDialog(self.frame, 'Enter a
database name:',
  'Create New
Database')
db_name = None #or db_name = ""
if dlg.ShowModal() == wx.ID_OK:
 db_name = dlg.GetValue() 
dlg.Destroy()
return db_name
--- John Salerno <[EMAIL PROTECTED]> wrote:

> Hi guys. I'm looking for a nicer, more compact way
> of writing this code. 
> It doesn't have to be anything fancy, just something
> without the 
> duplication and preferably only one return
> statement.
> 
>  def create_db_name(self):
>  dlg = wx.TextEntryDialog(self.frame, 'Enter
> a database name:',
>   'Create New
> Database')
>  if dlg.ShowModal() == wx.ID_OK:
>  db_name = dlg.GetValue()
>  dlg.Destroy()
>  return db_name
>  else:
>  dlg.Destroy()
>  return
> 
> One problem is that if "Cancel" is pressed, I can't
> return anything. 
> Another problem is that the dialog must be
> destroyed, so that has to 
> come before any return statements.
> 
> Thanks.
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: looping through two list simultenously

2006-10-29 Thread Michael S
What if you do it in 2 separate threads?

--- CSUIDL PROGRAMMEr <[EMAIL PROTECTED]> wrote:

> folks
> I have two lists
> 
>  i am trying to loop thorough them simultenously.
> 
> Here is the code i am using
> 
> f1 = os.popen('ls  chatlog*.out')
> data1=f1.readlines()
> f1.close()
> 
> data1=[x.strip() for x in data1]
> f1 = os.popen('ls  chatlog*.txt')
> data=f1.readlines()
> f1.close()
> for eachline in data1 and line in data:
> 
> filename='/root/Desktop/project/'+ eachline
> print filename
> outfile=open(filename,'r')
> filename1='/root/Desktop/project/' + line
> print filename1
> 
> I get the error that line is not defined.
> Traceback (most recent call last):
>   File "list.py", line 16, in ?
> for eachline in data1 and line in data:
> NameError: name 'line' is not defined
> 
> Is there any efficient doing this
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: best way to check if a file exists?

2006-10-31 Thread Michael S
If you want to open the file for writing just open it
with append mode. open(¨filename", "a"). If it
doesn't exist - it'll create it, and if it does it'll
start appending to the file

For reading - os.path.exists("filename"). Or (doesn't
make much sense, but still) try to open it for reading
and python will throw an IOException which you can
catch and handle.

Michael

--- John Salerno <[EMAIL PROTECTED]> wrote:

> What is the best way to check if a file already
> exists in the current 
> directory? I saw os.path.isfile(), but I'm not sure
> if that does more 
> than what I need.
> 
> I just want to check if a file of a certain name
> exists before the user 
> creates a new file of that name.
> 
> Thanks.
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


report progress from C function

2006-10-31 Thread Michael S
Good day all.

I rewrote part of my program in C, it's a usually a
long task. I wanted to be able to report the progress
back to my python program. In  my module (in addition
to the function that performs the above-mentioned
task) there is a function that returns the variable,
indicating the progress. However I am not sure how to
call it. Once I call the C function that does the work
(it's a while loop that takes minutes sometimes) I
can't call that progress function.  
Any ideas?

Thanks in advance,
Michael
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: report progress from C function

2006-10-31 Thread Michael S
> BTW, why did you rewrite in C rarher than using
> Pyrex?
I was not aware of pyrex. I didn't really mind doing
some C, it made me remember the syntax.

Thanks a lot. I did think that I could pack a function
address as a parameter.

--- John Machin <[EMAIL PROTECTED]> wrote:

> Michael S wrote:
> > Good day all.
> >
> > I rewrote part of my program in C, it's a usually
> a
> > long task. I wanted to be able to report the
> progress
> > back to my python program. In  my module (in
> addition
> > to the function that performs the above-mentioned
> > task) there is a function that returns the
> variable,
> > indicating the progress. However I am not sure how
> to
> > call it. Once I call the C function that does the
> work
> > (it's a while loop that takes minutes sometimes) I
> > can't call that progress function.
> > Any ideas?
> >
> 
> What do you expect your "python program" to be doing
> between calls to
> the get_progress function?
> 
> Here's a sketch of one possible way of doing
> something useful: add the
> following 2 args to your C "does the work function":
> (1) Python function object to be called every n
> times around the while
> loop or every nth other event or every n
> milliseconds or whatever
> (2) n
> 
> BTW, why did you rewrite in C rarher than using
> Pyrex?
> 
> Cheers,
> John
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: report progress from C function

2006-11-01 Thread Michael S
I downloaded Pyrex and ran it through their own
example. The code looks quite messy, and I even saw a
few "goto"s. 
I think I will stick with my own code for now.
Thanks in any case.

--- John Machin <[EMAIL PROTECTED]> wrote:

> Michael S wrote:
> > Good day all.
> >
> > I rewrote part of my program in C, it's a usually
> a
> > long task. I wanted to be able to report the
> progress
> > back to my python program. In  my module (in
> addition
> > to the function that performs the above-mentioned
> > task) there is a function that returns the
> variable,
> > indicating the progress. However I am not sure how
> to
> > call it. Once I call the C function that does the
> work
> > (it's a while loop that takes minutes sometimes) I
> > can't call that progress function.
> > Any ideas?
> >
> 
> What do you expect your "python program" to be doing
> between calls to
> the get_progress function?
> 
> Here's a sketch of one possible way of doing
> something useful: add the
> following 2 args to your C "does the work function":
> (1) Python function object to be called every n
> times around the while
> loop or every nth other event or every n
> milliseconds or whatever
> (2) n
> 
> BTW, why did you rewrite in C rarher than using
> Pyrex?
> 
> Cheers,
> John
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: report progress from C function

2006-11-01 Thread Michael S
My assembler is very basic, so it wouldn't help, while
my C is OK, well sort of.

BTW. Neither have I looked at the machine code that
the assembler produces. 

--- Fredrik Lundh <[EMAIL PROTECTED]> wrote:

> Michael S wrote:
> 
> > I downloaded Pyrex and ran it through their own
> > example. The code looks quite messy, and I even
> saw a
> > few "goto"s. 
> 
> looked at the assembler output from your C compiler
> lately?
> 
> 
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: report progress from C function

2006-11-01 Thread Michael S
What if it doesn't do exactly what you need to? How do
you debug through that code?

--- Fredrik Lundh <[EMAIL PROTECTED]> wrote:

> Michael S wrote:
> 
> > My assembler is very basic, so it wouldn't help,
> while
> > my C is OK, well sort of.
> > 
> > BTW. Neither have I looked at the machine code
> that
> > the assembler produces. 
> 
> so why does the output from Pyrex worry you?  it's a
> compiler, after all.
> 
> 
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: is mod_python borked?

2006-11-02 Thread Michael S
I used it for various projects. It's alright.
The only problem I had, was that I was unable to get
mod_python and pysqlite to work together.
Other than that it was pretty good.

--- walterbyrd <[EMAIL PROTECTED]> wrote:

> I am considering python, instead of php, for
> web-application
> development. I often see mod_python.criticisized as
> being borked,
> broken, or just plain sucking.
> 
> Any truth to any of that?
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PythonWin And Excel Problem

2006-12-01 Thread Michael S
First of all you should call the random.seed()
function. That was at least what I´ve always done.
seed([x])
Initialize the basic random number generator. 
Second of all, calling random.random() will give you
this: 
random()
Return the next random floating point number in
the range [0.0, 1.0).

In your loop try to call random.randit() and call the
random.seed() beforehand.

HTH,
Michael
--- Andrea Gavana <[EMAIL PROTECTED]> wrote:

> Hi All,
> 
> I am having some problems in running a very
> simple python script,
> which prints some numbers in an Excel spreadsheet.
> The numbers are
> stored in a list. I know that the numbers are
> different (random
> generated), but when I open the Excel file I get a
> column of data with
> all the numbers equal to the first item in the
> python list.
> I attach a very simple script that reproduces the
> problem.
> 
> I am using Python 2.5, PythonWin build 210, Windows
> XP. Am I missing
> something? Thank you for every hint.
> 
> import os
> import random
> 
> from win32com.client import Dispatch
> 
> therand = []
> for ii in xrange(10):
> therand.append(random.random())
> 
> xlsapp = Dispatch("Excel.Application")
> wb = xlsapp.Workbooks.Add()
> 
> xlsapp.Worksheets.Item(2).Delete()
> xlsapp.Worksheets.Item(1).Delete()
> sheet = wb.Sheets[0]
> sheet.Name = "Data"
> sheet.Range("A1:A10").Value = therand
> 
> excelfile = "C:/HelloWin32.xls"
> 
> wb.SaveAs(excelfile)
> wb.Close()
> xlsapp.Quit()
> 
> os.startfile(excelfile)
> 
> 
> Andrea.
> 
> "Imagination Is The Only Weapon In The War Against
> Reality."
> http://xoomer.virgilio.it/infinity77/
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PythonWin And Excel Problem

2006-12-01 Thread Michael S
Andrea,

Also, could it be that when you do the following:
sheet.Range("A1:A10").Value = therand

you actually initialize all 10 cells to the first
element of the array? Try to iterate and initialize
every cell separately.

Michael
--- Andrea Gavana <[EMAIL PROTECTED]> wrote:

> Hi All,
> 
> I am having some problems in running a very
> simple python script,
> which prints some numbers in an Excel spreadsheet.
> The numbers are
> stored in a list. I know that the numbers are
> different (random
> generated), but when I open the Excel file I get a
> column of data with
> all the numbers equal to the first item in the
> python list.
> I attach a very simple script that reproduces the
> problem.
> 
> I am using Python 2.5, PythonWin build 210, Windows
> XP. Am I missing
> something? Thank you for every hint.
> 
> import os
> import random
> 
> from win32com.client import Dispatch
> 
> therand = []
> for ii in xrange(10):
> therand.append(random.random())
> 
> xlsapp = Dispatch("Excel.Application")
> wb = xlsapp.Workbooks.Add()
> 
> xlsapp.Worksheets.Item(2).Delete()
> xlsapp.Worksheets.Item(1).Delete()
> sheet = wb.Sheets[0]
> sheet.Name = "Data"
> sheet.Range("A1:A10").Value = therand
> 
> excelfile = "C:/HelloWin32.xls"
> 
> wb.SaveAs(excelfile)
> wb.Close()
> xlsapp.Quit()
> 
> os.startfile(excelfile)
> 
> 
> Andrea.
> 
> "Imagination Is The Only Weapon In The War Against
> Reality."
> http://xoomer.virgilio.it/infinity77/
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Inheritance doesn't work

2006-12-04 Thread Michael S
How about calling base class __init__ and then the
pass statement?

--- zefciu <[EMAIL PROTECTED]> wrote:

> I have a problem with inheritance under python.  The
> class definition is  
> longer, but the troublesome thing is:
> 
>  from PIL import Image
> class MandelbrotImage (Image):
>   pass
> 
> I am getting the following error:
> Traceback (most recent call last):
>File "", line 1, in ?
>File "mandelimage.py", line 3, in ?
>  class MandelImage (Image):
> TypeError: Error when calling the metaclass bases
>  module.__init__() takes at most 2 arguments (3
> given)
> 
> 
> I am using python 2.4 from the Debian (Sid)
> packages.
> 
> Is it a bug, or am I doing something wrong?
> zefciu
> 
> -- 
> -BEGIN zefciu's GEEK CODE BLOCK-
> Version: 3.12
> GS d-(+) s+++:-- a-- C++ UL P- L++(+++) E--- W+ N++
> o?
> K? w-- M- V? PS-(--) PE++(+) Y PGP+ t 5 X R tv- b++
> DI D- G e>+++ h!>-- y? UF+
> --END zefciu's GEEK CODE BLOCK--
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


python & MS Office

2007-08-14 Thread Michael S
http://msherman77.blogspot.com/2007/08/python-com.html
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Python for web development ...

2007-08-22 Thread Michael S
Check out http://www.modpython.org/, you can also use
python with CGI
http://docs.python.org/lib/module-cgi.html
or fastcgi 
http://www.fastcgi.com/

--- [EMAIL PROTECTED] wrote:

> 
> Hi everyone,
> 
> I have to do a web based application for my final
> year project. Since,
> i am only familiar with basic HTML and Java Script,
> i am totally new
> to this one. My friends are using LAMP (P->PHP). But
> i want to use
> Python. Is it possible to use Python with Apache and
> MySQL. Is it
> possible ? Any websites/books ?
> 
> Thank you
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 

-- 
http://mail.python.org/mailman/listinfo/python-list


wxpython on FreeBSD 6.2 broken

2007-08-26 Thread Michael S
Good day all,

I was wondering if anyone was using the latest
wxpython on FreeBSD 6. I just installed it yesterday
as well as wxGlade. wxGlade doesn't function properly
- it does not display any controls. I then tried some
simple examples from the web and half of them don't
work.

Anyone aware of this?
Michael
-- 
http://mail.python.org/mailman/listinfo/python-list


python plotting with greek symbols within labels recommendations?

2005-10-04 Thread michael . s . gilbert
hello all,

this message is geared toward those of you in the scientific community.
i'm looking for a python plotting library that can support rendering
greek symbols and other various characters on plot axes labels, etc. I
would prefer something that adheres to tex formatting (as implemented
in latex, matlab, etc and has the form $\alpha$ to represent the greek
character alpha for example).

thus far, i've found that matplotlib
(http://matplotlib.sourceforge.net/) can do this, albeit the
implementation is so poor that you cannot mix standard text with
symbols on the same plot element.

pygrace (http://www.its.caltech.edu/~mmckerns/software.html) seems to
be able to inherently support symbols, but it doesn't follow the tex
formatting.  it has its own (seemingly arbitrary) syntax.

any thoughts on plotting libraries would be much appreciated.

mike

-- 
http://mail.python.org/mailman/listinfo/python-list