syed khalid wrote:
> I am trying to do a "import shogun" in my python script. I can invoke
> shogun with a command line with no problem. But I cannot with a python
> import statement.
>
>>invoking python from a command line...
>
> Syedk@syedk-ThinkPad-T410:~/shogun-2.0.0/src/interfac
On Sun, Jul 28, 2013 at 12:15 AM, syed khalid wrote:
> Syedk@syedk-ThinkPad-T410:~/shogun-2.0.0/src/interfaces/cmdline_static$
> shogun | more
This implies that you have something called 'shogun', without an
extension, in your $PATH. Where is the actual script? You may need to
install it by a qu
I am trying to do a "import shogun" in my python script. I can invoke shogun
with a command line with no problem. But I cannot with a python import
statement.
>invoking python from a command line...
Syedk@syedk-ThinkPad-T410:~/shogun-2.0.0/src/interfaces/cmdline_static$ shogun
| mo
On 17/02/13 18:40, James Griffin wrote:
- Phil [2013-02-17 17:47:15 +1000] - :
Thank you for reading this.
My adventures with Python have just begun and during the few weeks I
have tried many IDEs. The following piece of code fails under all
IDEs, and the interpreter, except under the
- Phil [2013-02-17 17:47:15 +1000] - :
> Thank you for reading this.
>
> My adventures with Python have just begun and during the few weeks I
> have tried many IDEs. The following piece of code fails under all
> IDEs, and the interpreter, except under the Wing IDE.
>
> Why would this co
On 17/02/13 18:01, Andrew Berg wrote:
On 2013.02.17 01:47, Phil wrote:
Why would this code work under the Wing IDE and nowhere else? Could
there be a different calendar module included with Wing?
import calendar
cal = calendar.prcal(2013)
print cal
Traceback (most recent call last):
File
On Saturday, February 16, 2013, Phil wrote:
> Thank you for reading this.
>
> My adventures with Python have just begun and during the few weeks I have
> tried many IDEs. The following piece of code fails under all IDEs, and the
> interpreter, except under the Wing IDE.
>
> Why would this code wor
On 2013.02.17 01:47, Phil wrote:
> Why would this code work under the Wing IDE and nowhere else? Could
> there be a different calendar module included with Wing?
>
> import calendar
>
> cal = calendar.prcal(2013)
> print cal
>
> Traceback (most recent call last):
>File "calendar.py", line 1
Thank you for reading this.
My adventures with Python have just begun and during the few weeks I
have tried many IDEs. The following piece of code fails under all IDEs,
and the interpreter, except under the Wing IDE.
Why would this code work under the Wing IDE and nowhere else? Could
there b
Evan Driscoll, 15.01.2012 08:37:
> As I hinted at in an earlier email, I'm working on a module which will
> allow calling readdir() (and FindFirstFile on Windows, hopefully pretty
> uniformly) from Python. The responses I got convinced me that it was a
> good idea to write a C-to-Python bridge as a
As I hinted at in an earlier email, I'm working on a module which will
allow calling readdir() (and FindFirstFile on Windows, hopefully pretty
uniformly) from Python. The responses I got convinced me that it was a
good idea to write a C-to-Python bridge as an extension module.
What I'm not sure ab
hi all,
suppose I have a func F, list [args1,args2,args3,...,argsN] and want
to obtain r_i = F(args_i) in parallel mode. My difficulty is: if F
returns not None, than I should break calculations, and I can't dig in
multiprocessing module documentation how to do it. Order doesn't
matter for me (I ha
On Dec 24, 4:42 pm, Stefan Sonnenberg-Carstens
wrote:
> You could as an alternative just use byte arrays. These are changeable.
thanks, that's exactly what I need. I have completely missed those
things since they're pretty new.
--
http://mail.python.org/mailman/listinfo/python-list
Am 24.12.2010 13:31, schrieb Oleg Leschov:
Hi,
I am writing an extension module in which I want to do some heavy
number crunching on large amount of data.
The input data is prepared using Python code and passed to this
extension module via strings containing binary data, and the result is
also
Hi,
I am writing an extension module in which I want to do some heavy
number crunching on large amount of data.
The input data is prepared using Python code and passed to this
extension module via strings containing binary data, and the result is
also passed back as a list of pretty large strings
On Wed, Nov 17, 2010 at 7:42 PM, Terry Reedy wrote:
> On 11/17/2010 7:25 PM, Mark Crispin wrote:
>
> Have you looked at ctypes? It's not suitable for all libraries, but
>>> it can often obviate the need to write any C code:
>>> http://docs.python.org/release/2.6.6/library/ctypes.html#module-ctyp
On 11/17/2010 7:25 PM, Mark Crispin wrote:
Have you looked at ctypes? It's not suitable for all libraries, but
it can often obviate the need to write any C code:
http://docs.python.org/release/2.6.6/library/ctypes.html#module-ctypes
Hmm. I don't think that it helps, especially as I don't reall
On Thu, 18 Nov 2010, Mark Wooding posted:
[snip]
Whoo-hoo! That's exactly what I was looking for.
If we ever meet in person, I owe you a beer, sir. And by that I mean real
beer (from what we call a "microbrew"), not Budweiser... :)
-- Mark --
http://panda.com/mrc
Democracy is two wolves
Mark Crispin writes:
> I have a Python module written in C that interfaces with an external C
> library. Basically, the project is to make it possible to use that
> library from Python scripts. If you know who I am, you can guess
> which library. :)
You have your very own Wikipedia page, so o
On Wed, 17 Nov 2010, Grant Edwards posted:
Hey, it's the IMAP guy! Get 'im!
Busted! :p
Alright, here's the full story.
As may be obvious to some, the module is to be a Python interface into
c-client. What may not be obvious is that this is for QA automation. The
consumers of this module
On Wed, Nov 17, 2010 at 3:35 PM, Grant Edwards wrote:
> On 2010-11-17, Mark Crispin wrote:
>
> Hey, it's the IMAP guy! Get 'im!
>
>> I have a Python module written in C that interfaces with an external
>> C library. Basically, the project is to make it possible to use that
>> library from Pytho
On Wed, Nov 17, 2010 at 3:18 PM, Mark Crispin wrote:
> I have a Python module written in C that interfaces with an external C
> library. Basically, the project is to make it possible to use that library
> from Python scripts. If you know who I am, you can guess which library. :)
>
> I have got
On 2010-11-17, Mark Crispin wrote:
Hey, it's the IMAP guy! Get 'im!
> I have a Python module written in C that interfaces with an external
> C library. Basically, the project is to make it possible to use that
> library from Python scripts. If you know who I am, you can guess
> which library.
This is something that ought to be simple, but going through the
documentation hasn't come up with the answer. Hopefully someone can
answer it faster than I can figure it out from the documentation.
I am using Python 2.6 for a project. I do not have a choice in the
matter, so telling me to u
jorma kala gmail.com> writes:
>
>
> Hi,I've created a logger like this:
> LOG_FILENAME = 'test.txt'
> fh=logging.FileHandler(LOG_FILENAME,'w')
> logger1 = logging.getLogger('myLogger1')
> logger1.addHandler(fh)
> logger1.setLevel(logging.INFO)logger1.info('message from logger1')
>
> and wa
On Fri, 04 Sep 2009 12:34:32 +0100, jorma kala wrote:
> Hi,
> I've created a logger like this:
>
>
> LOG_FILENAME = 'test.txt'
> fh=logging.FileHandler(LOG_FILENAME,'w') logger1 =
> logging.getLogger('myLogger1') logger1.addHandler(fh)
> logger1.setLevel(logging.INFO)
> logger1.info('message fro
Hi,
I've created a logger like this:
LOG_FILENAME = 'test.txt'
fh=logging.FileHandler(LOG_FILENAME,'w')
logger1 = logging.getLogger('myLogger1')
logger1.addHandler(fh)
logger1.setLevel(logging.INFO)
logger1.info('message from logger1')
and was hoping to get log messages in this format in my log
En Mon, 10 Nov 2008 11:44:44 -0200, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> escribió:
On Nov 10, 2:23 pm, Floris Bruynooghe <[EMAIL PROTECTED]>
wrote:
Sorry, I probably should have mentioned you want to cast the object to
PyFileObject and then use the PyFile_AsFile() function to get the
FILE*
[EMAIL PROTECTED] wrote:
Sadly this doesn't work on "file-like"
objects like those that are created by opening bz2 files (using the
bz2 lib).
If the C code you're calling requires a FILE *, then you're
out of luck. There's no way of getting a FILE * from an object
that's not based on an actual
On Nov 11, 12:55 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Mon, 10 Nov 2008 05:44:44 -0800, [EMAIL PROTECTED] wrote:
> > All in all I must say that implementing a C extension is a piece of
> > cake. Had I known that it was this straightforward I wouldn't have asked
> > my questio
On Mon, 10 Nov 2008 05:44:44 -0800, [EMAIL PROTECTED] wrote:
> All in all I must say that implementing a C extension is a piece of
> cake. Had I known that it was this straightforward I wouldn't have asked
> my questions in the first place. Making the whole thing more robust will
> be a bit more d
On Mon, 10 Nov 2008 05:36:58 -0800, [EMAIL PROTECTED] wrote:
> On Nov 10, 1:16 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
>> On Mon, 10 Nov 2008 03:11:06 -0800, [EMAIL PROTECTED] wrote:
>> > 1. How can I pass a file-like object into the C part? The PyArg_*
>> > functions can convert o
On Nov 10, 2:23 pm, Floris Bruynooghe <[EMAIL PROTECTED]>
wrote:
> Sorry, I probably should have mentioned you want to cast the object to
> PyFileObject and then use the PyFile_AsFile() function to get the
> FILE* handle.
Yes, I figured that out by now. Sadly this doesn't work on "file-like"
obje
On Nov 10, 1:16 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Mon, 10 Nov 2008 03:11:06 -0800, [EMAIL PROTECTED] wrote:
> > 1. How can I pass a file-like object into the C part? The PyArg_*
> > functions can convert objects to all sort of types, but not FILE*.
>
> http://docs.python.
On Nov 10, 1:18 pm, Floris Bruynooghe <[EMAIL PROTECTED]>
wrote:
> On Nov 10, 11:11 am, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > 1. How can I pass a file-like object into the C part? The PyArg_*
> > functions can convert objects to all sort of types, but not FILE*.
>
> Parse it as a g
Hi
On Nov 10, 11:11 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> 1. How can I pass a file-like object into the C part? The PyArg_*
> functions can convert objects to all sort of types, but not FILE*.
Parse it as a generic PyObject object (format string of "O" in
PyArg_*), check the type a
On Mon, 10 Nov 2008 03:11:06 -0800, [EMAIL PROTECTED] wrote:
> 1. How can I pass a file-like object into the C part? The PyArg_*
> functions can convert objects to all sort of types, but not FILE*.
http://docs.python.org/c-api/file.html#PyFile_AsFile
> 2. How can I preserve information needed in
[EMAIL PROTECTED] wrote:
Hello,
I'm trying to write a Python extension module in C for the first time.
I have two questions:
I have a much better suggestion:
Use Cython!
Although I'm pretty experienced with the Python C API, I prefer Cython
over hand written C code for most stuff. It's s
Hello,
I'm trying to write a Python extension module in C for the first time.
I have two questions:
1. How can I pass a file-like object into the C part? The PyArg_*
functions can convert objects to all sort of types, but not FILE*.
2. How can I preserve information needed in the C part between
En Fri, 03 Oct 2008 03:59:18 -0300, aditya shukla
<[EMAIL PROTECTED]> escribió:
Hello folks :
i have a string "-bin-ulockmgr_server:0.99[&&NHX:C=0.195.0]" from which i
want to delete [&&NHX:C=0.195.0] .
I wrote a regular expression for [&&NHX:C=0.195.0] as
\[&&(\w)+:\w=((-)?(\d|\d\d|\d\d\d)\.
Hello folks :
i have a string "-bin-ulockmgr_server:0.99[&&NHX:C=0.195.0]" from which i
want to delete [&&NHX:C=0.195.0] .
I wrote a regular expression for [&&NHX:C=0.195.0] as
\[&&(\w)+:\w=((-)?(\d|\d\d|\d\d\d)\.)+\d\]
now when i do
p = re.compile('\[&&(\w)+:\w=((-)?(\d|\d\d|\d\d\d)\.)+\d\]')
m
En Tue, 19 Aug 2008 22:06:13 -0300, aditya shukla
<[EMAIL PROTECTED]> escribi�:
I am using windows vista and i am trying to communicate with various
processes.
so when i do
import subprocess
proc=subprocess.Popen('cmd.exe')
--This opens the command prompt
But when i do
proc=subprocess.Popen(
Hello folks,
I am using windows vista and i am trying to communicate with various
processes.
so when i do
import subprocess
proc=subprocess.Popen('cmd.exe')
--This opens the command prompt
But when i do
proc=subprocess.Popen('netscan.exe')
it gives an error
Traceback (most recent call last):
Sorry, my time zone is +4, not minus 4, which means that something
else is causing my source data to be in the future. I still do need
to understand where the time routines determine the time zone offset,
so I can be sure I'm passing around the neutral value.
Thanks!
On Wed, May 21, 2008 at 12:
I tend to deal with dates a lot in different formats and places...
typically I'll convert them to a time tuple with strptime(), and pass
them around like that before I need to write them back out.
One set of time/dates I'm getting are in UTC, but the string doesn't
say that specifically. So I do
En Mon, 05 Feb 2007 16:43:54 -0300, Rodolfo S. Carvalho
<[EMAIL PROTECTED]> escribió:
> My question is: can I code a method __getattr__() to change the behavior
> of
> the 'import' command?
You can play with __import__, imp and ihooks, but could you explain better
what you need?
Perhaps you
Hi folks
I have a question for this mailing list.
When I'm writing a class, I can rewrite the method __getattr__() to modify
the object's method/attribute access behavior.
My question is: can I code a method __getattr__() to change the behavior of
the 'import' command?
--
Rodolfo Carvalho
Am Thu, 29 Jun 2006 20:22:28 -0700 schrieb ss2003:
> hi
> i have defined a function
> def logger(logfile,msg):
> import logging
>
> logging.basicConfig(level=logging.DEBUG,
>format='%(asctime)s %(levelname)-8s
> %(message)s',
>
hi
i have defined a function
def logger(logfile,msg):
import logging
logging.basicConfig(level=logging.DEBUG,
format='%(asctime)s %(levelname)-8s
%(message)s',
datefmt='%a, %d %b %Y %H:%M:%S',
Ahhh. Actually, I realized my problem was the fact that not everything
had been loaded yet. Circular loading can be a bit difficult I can
see... I guess I need to import the new module after x has been
declared? Ei, I need this.
Mod1.py
x=1
from mod2.py import *
=
Mod2.py
from mod1
Tuvas wrote:
>Could I just do this then?
>
>from foo import x?
>
>
Yes, you can do it that way. (f you have your modules importing each
other in a circular fashion, then this can cause trouble as x may not be
defined yet, so best to avoid that case.)
>One more question now that I've tried th
Most of these are indeed independed of Tkinter, except for a status
report message that is often sent in response. I' have a few small
files already that do this, however, I would ike to be able to put
several that do in fact need to post status messages as well. There are
about 2400 lines of code
Tuvas wrote:
> I know this is probably a very simple question, but I am building a
> program that is now at about 2400 lines of code in the main module. I
> need to break it up, however, there are certain variables that I would
> like to use among all of them, namely the TKinter background. It's
>
Could I just do this then?
from foo import x?
One more question now that I've tried this. In my main function, I have
alot of init code. I don't want this code to be re-ran when the second
module imports the first. Is there any way around this? Thanks!
--
http://mail.python.org/mailman/listinfo
Tuvas wrote:
> I know this is probably a very simple question, but I am building a
> program that is now at about 2400 lines of code in the main module. I
> need to break it up, however, there are certain variables that I would
> like to use among all of them, namely the TKinter background. It's
>
I know this is probably a very simple question, but I am building a
program that is now at about 2400 lines of code in the main module. I
need to break it up, however, there are certain variables that I would
like to use among all of them, namely the TKinter background. It's
build using tkinter, so
> but now I'd like to understand the design rational behind having each
> logger in the object hierarchy log the same output by default. Anyone?
Loggers are different to handlers. Loggers map to areas of the
application, handlers map to output destinations. Loggers form a
hierarchy based on names
Ok, so I've figured this out (see below),
mail = logging.handlers.SMTPHandler('mail.vw.com',
'[EMAIL PROTECTED]',
'[EMAIL PROTECTED]',
'Data Processing Error at
location: %s' %
I want to create two different loggers so that users see one output
(e.g. no exception/stack traces) and others (e.g support staff) that
does see stack traces via email. The code below is close but I still
get console output on the email logger from the "root" logger. How do
I get rid of it?
im
>> Is Mersenne Twister currently available at all in Jython, for example?
Googling for "java mersenne twister" provides multiple hits including:
http://www.axlradius.com/freestuff/Free.htm#MT
Raymond
--
http://mail.python.org/mailman/listinfo/python-list
Raymond Hettinger wrote:
> The answer is a qualified Yes. While the core generator (currently
Thanks! That is the answer I'm looking for.
And to Paul Rubin, it is a good point that Jython might not support it, but
at this point it doesn't interest me. The program is only for myself
anyway.
"Raymond Hettinger" <[EMAIL PROTECTED]> writes:
> >> Can I rely on the random.py module to produce the same series of
> >> numbers for future/past versions of Python, given the same seed?
>
> The answer is a qualified Yes. While the core generator (currently the
> Mersenne Twister algorithm) is s
>> Can I rely on the random.py module to produce the same series of
>> numbers for future/past versions of Python, given the same seed?
The answer is a qualified Yes. While the core generator (currently the
Mersenne Twister algorithm) is subject to change across versions,
whenever we've updated t
"Roose" <[EMAIL PROTECTED]> writes:
> Can I rely on the random.py module to produce the same series of numbers for
> future/past versions of Python, given the same seed? Can I rely on it
> across different architectures and operating systems?
>
> I looked at the docs and couldn't find this stat
Can I rely on the random.py module to produce the same series of numbers for
future/past versions of Python, given the same seed? Can I rely on it
across different architectures and operating systems?
I looked at the docs and couldn't find this stated anywhere. My feeling is
yes, but it's a f
JRCondon wrote:
> Sean, if you are asking what I think you are asking (I don't
> think name hiding is the issue), you can use
>
> from module_name import *
Sshh! We're obviously going to great lengths to not tell him about
*.
;)
Robert Brewer
MIS
Amor Ministries
[EMAIL PROTECTED]
--
http:
Sean, if you are asking what I think you are asking (I don't think name
hiding is the issue), you can use
from module_name import *
and you will end up with all of the functions at session scope. You can
use the 'as' to alias the function names if you wish
from module_name import fn1 as myfn1,
Sean wrote:
So what if I have a whole bunch of functions - say 25 of them.
Is there a way to do this without naming each function?
Yes [1], but it's basically deprecated and you shouldn't use it. Consider
refactoring your code.
Refactoring my code? Sorry, I am not sure what you mean here.
'Refact
Sean wrote:
Sean wrote:
Then I would have a script that uses the
print_this function defined in the module
without using the module name in the call.
from module_name import print_this
or, even:
from module_name import print_this as other_nice_name
So what if I have a whole bunch of functions -
"Sean" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> import module_name.py
leave off the .py
Irmen answered your main question.
Terry J. Reedy
--
http://mail.python.org/mailman/listinfo/python-list
Sean wrote:
from module_name import print_this
or, even:
from module_name import print_this as other_nice_name
So what if I have a whole bunch of functions - say 25 of them.
Is there a way to do this without naming each function?
Yes [1], but it's basically deprecated and you shouldn't use it. Co
>>>from module_name import print_this
>>>
>>>or, even:
>>>
>>>from module_name import print_this as other_nice_name
>>
>> So what if I have a whole bunch of functions - say 25 of them.
>> Is there a way to do this without naming each function?
>
> Yes [1], but it's basically deprecated and you shou
Sean wrote:
Sean wrote:
Then I would have a script that uses the
print_this function defined in the module
without using the module name in the call.
from module_name import print_this
or, even:
from module_name import print_this as other_nice_name
So what if I have a whole bunch of functions - say
> Sean wrote:
>
>> Then I would have a script that uses the
>> print_this function defined in the module
>> without using the module name in the call.
>
>
>
> from module_name import print_this
>
> or, even:
>
> from module_name import print_this as other_nice_name
>
So what if I have a whole bunc
Sean wrote:
Then I would have a script that uses the
print_this function defined in the module
without using the module name in the call.
from module_name import print_this
or, even:
from module_name import print_this as other_nice_name
--Irmen
--
http://mail.python.org/mailman/listinfo/python-lis
Is there any way I could have the following work?
First I would have a module define a function to do
something like print some data.
- module_name.py -
[snip]
def print_this(data):
print "This is the data: %s" %data
[/snip]
-
Then I would have a scri
Simon Brunning wrote:
On Wed, 15 Dec 2004 18:10:40 -0800, Jeff Shannon <[EMAIL PROTECTED]> wrote:
The difference being that when Excel opens up a *.CSV, it goes through
the import wizard.
Are you sure that's true? When I open a *.csv file, Excel *appears* to
open it without running any kind
Thanks to everyone for the prompt reply, I now have several options to
explore.
Thanks again,
Bill
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 15 Dec 2004 18:10:40 -0800, Jeff Shannon <[EMAIL PROTECTED]> wrote:
> The difference being that when Excel opens up a *.CSV, it goes through
> the import wizard.
Are you sure that's true? When I open a *.csv file, Excel *appears* to
open it without running any kind of wizard. Certainly I
Mike Meyer wrote:
Grumman <[EMAIL PROTECTED]> writes:
Bill Turczyn wrote:
Does python have a module similiar to the perl Spreadsheet::WriteExcel
In a pinch, you can output an HTML table, give the file an .xls
extension, and Excel will read it just fine.
Welll, someone pointed ou
Grumman <[EMAIL PROTECTED]> writes:
> Bill Turczyn wrote:
>> Does python have a module similiar to the perl Spreadsheet::WriteExcel
>> Thanks,
>> Bill
>>
> In a pinch, you can output an HTML table, give the file an .xls
> extension, and Excel will read it just fine.
Welll, someone pointed out a t
Bill Turczyn wrote:
Does python have a module similiar to the perl Spreadsheet::WriteExcel
Thanks,
Bill
In a pinch, you can output an HTML table, give the file an .xls
extension, and Excel will read it just fine.
There's probably a better option in python (under win32, you
could use win32com and
Goggle: keyword pyXLWriter - ported from Perl. Does not support newer
exel files. F.e. if you create a table and write headers (names) they
will be in the table as row 0. But it is fast and it works. Has a lot
of examples.
--
http://mail.python.org/mailman/listinfo/python-list
Does python have a module similiar to the perl Spreadsheet::WriteExcel
Thanks,
Bill
--
http://mail.python.org/mailman/listinfo/python-list
84 matches
Mail list logo