Re: Cheat sheet

2007-12-28 Thread c james
Riccardo T. wrote: > I wrote a little cheat sheet for this wonderful language, but because of > my still little experience with it, I would like to have a feedback > Could you have a look at it and tell me what do you think about, please? > > http://greyfox.imente.org/index.php?id=73 > > -- > Gre

Tkinter variable trace problem

2008-01-07 Thread C Martin
ight away, and the exception occurs when you type in the entry widget: >test.py PY_VAR0 callback called with name='PY_VAR0', index='', mode='w' and variable value = 'test' callback called with name='PY_VAR0', index='', mode='w&#

Re: Tkinter variable trace problem

2008-01-09 Thread C Martin
Thank you for your replies. I understand there are better ways to handle 'normal' UI behavior, but I was curious about the trace feature and wanted to understand how it worked. I may not actually need it in my project, but I wanted to see what my options were. Thanks again.

Re: alternating string replace

2008-01-09 Thread Gordon C
This is very cool stuff but I suspect that the code is unreadable to many readers, including me. Just for fun here is a complete program, written in Turbo Pascal, circa 1982, that does the job. Readable n'est pas? Program dash; var str: string[80]; n: integer; odd: boolean; begin

keyword 'in' not returning a bool?

2008-02-08 Thread c james
Try this >>> sample = {'t':True, 'f':False} >>> 't' in sample True >>> type('t' in sample) >>> 't' in sample == True False Why is this? Now try >>> bool('t' in sample) == True True Can someone explain what is going on? -- http://mail.python.org/mailman/listinfo/python-list

Re: Recursive generator

2008-02-12 Thread Ben C
On 2008-02-12, Paul Rubin <> wrote: > Paul Hankin <[EMAIL PROTECTED]> writes: >> def genDescendants(self): >> return chain([self], *[child.genDescendants() >> for child in self.children]) > > That is scary. It generates an in-memory list the size of the > whole subtree, at every level.

Re: Recursive generator

2008-02-12 Thread Ben C
On 2008-02-12, Paul Hankin <[EMAIL PROTECTED]> wrote: > On Feb 12, 11:15 am, Ben C <[EMAIL PROTECTED]> wrote: >> Suppose I have an object containing an array called children. I can >> therefore build a tree out of such objects. >> The best I came up with so far

Recursive generator

2008-02-12 Thread Ben C
Suppose I have an object containing an array called children. I can therefore build a tree out of such objects. I thought it might be useful to have a descendent generator, so I could write: for thing in self.genDescendents(): foo(thing) expecting foo to be called for each descendent

Re: Recursive generator

2008-02-13 Thread Ben C
On 2008-02-12, Paul Hankin <[EMAIL PROTECTED]> wrote: > On Feb 12, 10:17 pm, Ben C <[EMAIL PROTECTED]> wrote: >> On 2008-02-12, Paul Rubin <> wrote: >> >> > Paul Hankin <[EMAIL PROTECTED]> writes: >> >> def genDescendants(

Re: Recursive generator

2008-02-13 Thread Ben C
On 2008-02-13, Erich <[EMAIL PROTECTED]> wrote: > On Feb 12, 5:15 am, Ben C <[EMAIL PROTECTED]> wrote: >> I think this works OK, but it seems a bit odd. Is there something more >> "Pythonic" I should be doing? > > I have a similar tree to the one

Re: How to manipulate elements of a list in a single line of code?

2008-02-25 Thread Ben C
On 2008-02-25, mrstephengross <[EMAIL PROTECTED]> wrote: > I would like to translate the contents of a list. For instance, let's > say I've got a list of strings and I want to append "foo" to each > element. I might do the following; > > list1 = ['

Re: SV: SV: Regarding coding style

2008-03-08 Thread Ben C
rhaps we're > talking about different things, here? > Usually, in the header file (C++), there > won't be any source code, except for > method declarations. A common example: > > /** Projects an object from 3D to 2D using > the method of Alexander The Great. >

Re: About reading Python code

2008-03-17 Thread Ben C
On 2008-03-17, WaterWalk <[EMAIL PROTECTED]> wrote: > Hello. I wonder what's the effective way of figuring out how a piece > of python code works. With C I often find it very useful to be able to > run the code in step mode and set breakpoints in a debugger so I can > wa

Re: Do any of you recommend Python as a first programming language?

2008-03-23 Thread Ben C
On 2008-03-22, bsoist <[EMAIL PROTECTED]> wrote: > On Mar 22, 12:40 pm, jmDesktop <[EMAIL PROTECTED]> wrote: >> For students 9th - 12th grade, with at least Algebra I. Do you think >> Python is a good first programming language for someone with zero >> programming experience? Using Linux and Pyth

Re: How to Delete a Cookie?

2009-01-08 Thread Jose C
> c["mycook"]["expires"] = 0 Set ["expires"] using the following format to any time less than current (which causes the browser to delete the cookie). Here's a function I use to return a cookie expiry timestamp, negative values passed in result in cookie

Re: How to Delete a Cookie?

2009-01-08 Thread Jose C
On Jan 8, 10:33 am, tryg.ol...@gmail.com wrote: > On Jan 8, 1:16 pm, Jose C wrote: > > > > > > c["mycook"]["expires"] = 0 > > > Set ["expires"] using the following format to any time less than > > current (which causes the brow

Re: How to Delete a Cookie?

2009-01-08 Thread Jose C
> To kill the cookie, simply set a cookie with the same name (and path) Actually you may not even need to specify the path. Just the name and expires param should do the trick. Haven't played with cookies in a while so try with and without the path. -- http://mail.python.org/mailman/listinfo/pyt

Re: Tuple parameter unpacking in 3.x

2008-10-07 Thread Brett C.
On Oct 5, 9:13 am, Terry Reedy <[EMAIL PROTECTED]> wrote: > Martin Geisler wrote: > > Steven D'Aprano <[EMAIL PROTECTED]> writes: > >>> From reading the PEP-3113 I got the impression that the author > >>> thought that this feature was unused and didn't matter. > > And that there were good alternati

Re: php vs python

2008-05-21 Thread Baris-C
with php?  What do I know?  Not > much.  I can setup mysql and apache,, but don't know how to use 'em, really. > I use emacs and run slackware and can fumble my way through bash scripts, > but I can't really write them or do lisp.  I've taken basic basic and basic >

Re: Books for learning how to write "big" programs

2008-05-27 Thread c james
duli wrote: Hi: I would like recommendations for books (in any language, not necessarily C++, C, python) which have walkthroughs for developing a big software project ? So starting from inception, problem definition, design, coding and final delivery on a single theme or application. Most of

Re: Python is slow

2008-06-08 Thread Baris-C
On May 22, 7:14 pm, cm_gui <[EMAIL PROTECTED]> wrote: > Python is slow.    Almost all of the web applications written in > Python are slow.   Zope/Plone is slow, sloow, so very slooow.  Even > Google Apps is not faster.   Neither is Youtube. > Facebook and Wikipedia (Mediawiki), written in PHP, are

Dynamically Changing the Base Class

2008-07-07 Thread Adam C.
We have a situation where we want a Swig-generated Python class to have a different base (not object). It doesn't appear that we can coerce Swig into generating the class we want at present (but we are still enquiring). Is it possible to dynamically change the base class to something else? Initial

Re: Dynamically Changing the Base Class

2008-07-07 Thread Adam C.
On Jul 7, 9:11 am, George Sakkis <[EMAIL PROTECTED]> wrote: > On Jul 7, 9:31 am, "Adam C." <[EMAIL PROTECTED]> wrote: > > > > > We have a situation where we want a Swig-generated Python class to > > have a different base (not object). It doesn't

Re: Dynamically Changing the Base Class

2008-07-08 Thread Adam C.
On Jul 7, 4:04 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Jul 7, 9:31 am, "Adam C." <[EMAIL PROTECTED]> wrote: > > > > > We have a situation where we want a Swig-generated Python class to > > have a different base (not object). It doesn't app

Re: Dynamically Changing the Base Class

2008-07-08 Thread Adam C.
On Jul 7, 10:44 pm, Michele Simionato <[EMAIL PROTECTED]> wrote: > On Jul 7, 8:08 pm, "Adam C." <[EMAIL PROTECTED]> wrote: > > > Thanks. I think we would want new-style classes, and 6-year-old > > patches strike me as maybe a little out of the desired path

Using Tcl extensions with Python?

2008-07-17 Thread C Martin
How do you setup a Tcl extension to be accessible through Python? I understand that I'll have to use native Tcl calls to use it (tk.call() etc), but I can't figure out where to put the files or how to initialize them so I can call them. The package I would like to use is TkPNG: http://www.muonics

Re: Using Tcl extensions with Python?

2008-07-18 Thread C Martin
On Jul 17, 5:18 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: [snip] > And.. for tkpng specifically, you won't need tk.call to use it, you > just need to create your images using Tkinter.PhotoImage with a "png" > type. Thank you Guilherme, that's all great info. > Thomas Troeger <[EMAIL PROTECT

Tkinter fullscreen with Mac OS X

2008-07-28 Thread C Martin
Is there a way to create a full screen app using Tkinter with Mac OS X?? On windows, this is relatively easy with overrideredirect(1). However, on the Mac, the top menu bar and dock are still displayed over the app. Is there a way to get rid of them? Thanks. -- http://mail.python.org/mailman/listi

Re: Tkinter fullscreen with Mac OS X

2008-08-06 Thread C Martin
On Jul 28, 6:43 pm, "Guilherme Polo" <[EMAIL PROTECTED]> wrote: > > You could try this, supposing tl is a toplevel: > > tl.tk.call("::tk::unsupported::MacWindowStyle", "style", tl._w, "plain", > "none") > I tried this (although, my tl is actually a tk instance): self.tk.call("::tk::unsupported::

Re: Problems with psycopg2

2008-05-05 Thread c james
David Anderson wrote: The thing is this query works fine on the console through psql, but not in my code? can anyone explain me why? On Thu, May 1, 2008 at 9:31 PM, David Anderson <[EMAIL PROTECTED] > wrote: Hi all I have this function: def checkName(sel

Re: sum up numbers in a list

2008-08-26 Thread c james
>>> L=['10','15','20'] >>> sum(int(x) for x in L) 45 or >>> sum(map(int,L)) 45 sharon kim wrote: hi all, i have a list, for example; >>> L=[] >>> L.append('10') >>> L.append('15') >>> L.append('20') >>> len(L) 3 >>> print L ['10', '15', '20'] is there a way to sum up all the numbers in

Re: Dictionary project

2006-03-11 Thread Ben C
;s not homework; just for fun). >> For it, I need to make a list of words, starting with 1 character in length, >> up to 15 or so. >> It would look like: >> >> A B C d E F G ... Z Aa Ab Ac Ad Ae Aaa Aab Aac This is really "permutations" you're try

Re: Dictionary project

2006-03-11 Thread Ben C
> So here's a different approach, which I think does meet the spec: > > from itertools import tee > def allwords2(alphabet="abcd", maxlen = 4): > def wordgen(): > for char in alphabet: > yield char > for partial in allwordstee[1]: > if len(partial) =

Re: calling another python file within python

2006-03-14 Thread Ben C
On 2006-03-14, Kevin <[EMAIL PROTECTED]> wrote: > i have a python file called pyq which outputs stock quotes, currently i > also have a html file that takes stock ticker inputs, i would like to > bridge the two by building another program that takes the html inputs > and uses them to call the py

Re: Writing web bots in python

2006-03-19 Thread Ben C
On 2006-03-18, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello, > I hav a question..How do I write a webbot that logs onto some website, > fills text into a textbox and submit that form, Sorry I am a novice in > python, apparently I have to use urllib, but I hav a few queries on > this, What h

Code convertion from JSP to Python

2006-03-20 Thread - C Saha -
Hi Python Veterans I need to convert a code from JSP (Java Tags are also there inside JSP) to PYTHON. I have OK kind of knowledge in PYTHON, but dont have a muck knowledge in JAVA/JSP. Any idea how to approach?Thanks in advance to allC SahaThanks a lot to all in advance Thanks

Re: how to capture os.execvp into variable

2006-03-29 Thread Ben C
On 2006-03-28, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > hi > i am using this code to run a ps command in unix > > def run(program, *args): > pid = os.fork() > if not pid: > os.execvp(program, (program,) + args) > return os.wait()[0] > > run("ps", "-eo pid,ppid,args") > >

Re: wxPython and SuSE 10.0

2006-04-05 Thread Ben C
On 2006-04-05, Steve <[EMAIL PROTECTED]> wrote: > Hello, > > I was wondering if there is a wxPython RPM for SuSE 10.0 available. I > Googled for it with no luck, but I'm hopeful that there is one out > there. http://www.novell.com/products/linuxpackages/professional/python-wxgtk.html is th

Re: how to convert string

2006-04-05 Thread Ben C
On 2006-04-05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I want to print number 0 to 9 in one line like this > 0 1 2 3 4 5 6 7 8 9 > > if I do like this, it prints in different lines > > for i in xrange(10): > print i for i in xrange(10): print i, should work (comma after the i). >

Re: how to convert string

2006-04-05 Thread Ben C
On 2006-04-05, Scott David Daniels <[EMAIL PROTECTED]> wrote: > Ben C wrote: >> ... But this puts an extra space on the end (so did the print i, >> version above). > Actually, no (the trailing-comma prints do a funny dance). > Check it out: [...] You're right, I tr

Re: UnicodeDecodeError help please?

2006-04-07 Thread Ben C
On 2006-04-07, Robin Haswell <[EMAIL PROTECTED]> wrote: > Okay I'm getting really frustrated with Python's Unicode handling, I'm > trying everything I can think of an I can't escape Unicode(En|De)codeError > no matter what I try. > > Could someone explain to me what I'm doing wrong here, so I can h

Re: About classes and OOP in Python

2006-04-11 Thread Ben C
can bypass this if you really want to, but then >> again, you can bypass private in C++ too. > Wrong, _foo is a *private* name (in the sense "don't touch me!"), __foo > on the contrary is a *protected* name ("touch me, touch me, don't worry > I am protecte

Re: RegExp question

2006-04-11 Thread Ben C
On 2006-04-11, Michael McGarry <[EMAIL PROTECTED]> wrote: > Hi, > > I would like to form a regular expression to find a few different > tokens (and, or, xor) followed by some variable number of whitespace > (i.e., tabs and spaces) followed by a hash mark (i.e., #). What would > be the regular expre

Re: RegExp question

2006-04-11 Thread Ben C
On 2006-04-11, Michael McGarry <[EMAIL PROTECTED]> wrote: > Tim, > > for some reason that does not seem to do the trick. > > I am testing it with grep. (i.e., grep -e '(and|or|xor)\s*#' myfile) Try with grep -P, which means use perl-compatible regexes as opposed to POSIX ones. I only know for sure

Re: Python2CPP ?

2006-04-12 Thread Ben C
On 2006-04-12, Michael Yanowitz <[EMAIL PROTECTED]> wrote: > Hello: > >One topic that has always interested me are the Language translators. > Are there any that convert between Python and C++ or Python and Java? > I remember seeing one that converts from Python to or f

Re: new-style classes and len method

2006-04-13 Thread Ben C
On 2006-04-13, Thomas Girod <[EMAIL PROTECTED]> wrote: > Hi there. > > I'm trying to use new-style classes, but there is something i'm > obviously missing > > here it is : > > class Data(list): > __slots__ = ["width", "height", "label"] > > def __init__(self,width,height,label=None): >

Re: trying to grasp OO : newbie Q?

2006-04-13 Thread Ben C
hat you get. The myVar that you define in __init__ is not an instance variable, but a local variable (local to the function __init__). To make an instance variable you have to use "self" explicitly: def __init__(self): self.myVar = 2 If you write it like this, your program will print

Re: list.clear() missing?!?

2006-04-14 Thread Ben C
On 2006-04-14, Sergei Organov <[EMAIL PROTECTED]> wrote: > Dennis Lee Bieber <[EMAIL PROTECTED]> writes: >> It always means bind... But if the LHS is a mutable object, AND you >> have specified a component of that object, it is the component that is >> being rebound... >> >> lst[:] = []

ReverseProxy

2009-11-16 Thread Fred C
I have to write a quick and dirty ReverseProxy with Twisted, for one of our internal project. I never used Twisted before, and I was wondering of someone have an handy example of a ReverseProxy with Twisted to help that I can use as bootstrap. Many thanks. Fred-- http://mail.python.org/m

Re: Truoble With A Search Script for ImageBin.org

2010-03-19 Thread Brandon C
*grumble* *grumble* *grumble* oops, sorry ... my mistake it turns out that i misspelled one of the values and left another one out. here's the working script now for anyone who may care: import urllib import urllib2 url = 'http://imagebin.org/index.php?page=search' values = {'search_for' : 'bla

script to upload file using POST form

2010-03-19 Thread Brandon C
got another question for yall wonderful minds; how can i upload a file to a server that uses a POST form? here's the link to the form that i'd like to be able to upload a file: http://imagebin.org/index.php?page=add tks -- http://mail.python.org/mailman/listinfo/python-list

Automatic import ?

2010-03-25 Thread C. B.
Hi everyone, I'm currently coding a C library which provides several modules and objects. Let's say that some of these objects are classes called AAA and BBB. The constructor of AAA needs to get BBB as argument. So I can run the following code : from mymodule import AAA from mymod

Re: Automatic import ?

2010-03-26 Thread C. B.
> > What is the behaviour of the __init__.py file? > Not yet used, but I read this file is run by Python when a module of a package is imported. So you can insert default importations in it. -- http://mail.python.org/mailman/listinfo/python-list

Re: Automatic import ?

2010-03-26 Thread C. B.
At first, thank you all for your answers. Some more details about what I'm coding and what I need... The classes AAA and BBB are just given as examples. In fact, BBB's constructor accepts several parameters, meaning it can be different for each creation of AAA. So it can't be simply skipped from

Re: Automatic import ?

2010-03-27 Thread C. B.
> In that particular case, replace automatic by implicit, and you got the > reason why it is not a good idea. > Maybe in your case the C habits clashes to the python habits. > You're right ! As a C developer, I appreciate to only include to deal with strings, without wond

Bind C++ program for use with both Python 2.x and 3.x

2010-12-11 Thread Peter C.
Hello, I am looking at the possibility of making a program in C++. The catch is it will require the ability to work with binding for use with scripting in both Python 2.x and 3.x for various tool plugins. Is there any way to bind a C++ app to work with both Python 2.x and 3.x using the Python C

Re: Syntax help

2011-01-26 Thread c...@thansen.de
On 26.01.2011 09:08, sl33k_ wrote: How to read syntax like this given in the documentation of python? (Newbie) defparameter ::= parameter ["=" expression] http://en.wikipedia.org/wiki/Backus-Naur_Form -- http://mail.python.org/mailman/listinfo/python-list

Re: print executed query

2010-05-03 Thread Fred C
On Apr 29, 2010, at 9:49 AM, Philip Semanchuk wrote: > > On Apr 29, 2010, at 12:01 PM, someone wrote: > >> Hello! >> >> Is there a way to print a query for logging purpose as it was or will >> be sent to database, if I don't escape values of query by myself? >> >> cursor.execute(query, [id, s

Re: print executed query

2010-05-03 Thread Fred C
On Apr 29, 2010, at 9:49 AM, Philip Semanchuk wrote: > > On Apr 29, 2010, at 12:01 PM, someone wrote: > >> Hello! >> >> Is there a way to print a query for logging purpose as it was or will >> be sent to database, if I don't escape values of query by myself? >> >> cursor.execute(query, [id, s

Re: launch a .py file from a batch file

2009-06-22 Thread C M
ve spaces in the path). With quotes it just opens a console and does nothing (does not launch the app). Any ideas? Thanks. Che > > Your batch file itself will still display a cmd window while it's running, > but it'll finish quickly. This is the same as when using one to st

pythonware.com down?

2009-06-29 Thread C. Feldmann
Hi, I am trying to get a hold of PIL, but pythonware.com seems to be down. Are there mirrors out there? I get a 502 Error "Bad Gateway - The proxy server received an invalid response from an upstream server." Does anyone else get that error? Thanks Casper -- http://mail.python.org/mailman/listin

Re: pythonware.com down?

2009-06-29 Thread C. Feldmann
On 29 Jun., 11:07, Tim Harig wrote: > On 2009-06-29, C. Feldmann wrote: > > > I am trying to get a hold of PIL, but pythonware.com seems to be down. > > Are there mirrors out there? > > I get a 502 Error "Bad Gateway - The proxy server received an invalid > &g

Re: MySQLdb + SSH Tunnel

2009-07-14 Thread R C
Got it working. Thanks for your help 1) login to B 2) setup a tunnel in the shell machine-B> ssh -L B_ip_address:B_port:C_ip_address:C_port u...@c_ip_address for example: machine-B has ip 1.1.1.1 machine-C has ip 2.2.2.2 then I would type: machine-B> ssh -L 1.1.1.

setuptools question.

2009-07-21 Thread Fred C
I have a python program and when I install this program from the module home directory using setup.py everything works fine. But easy_install fails with the following error, because I am trying to install some start up shell scripts into /etc/init.d > The package setup script has attempte

memory access ordering between processes in python 3.6

2017-02-14 Thread c . curtit
Hi everyone, I'm looking at building an application that allows lockless interprocess data passing using a ring buffer style (sorta) shared memory zone. My initial plan is to create a shared memory zone (probably using C functions thru ctypes), then write data to it with a writer process,

How to create a Python 3.6 traceroute without SOCK RAW?

2017-02-23 Thread Juan C.
I need to implement a traceroute inside my script but I can't escalate privileges.  Unix uses UDP for traceroute, but I didn't find any material regarding UDP traceroute in Python. -- https://mail.python.org/mailman/listinfo/python-list

Re: How to create a Python 3.6 traceroute without SOCK RAW?

2017-02-23 Thread Juan C.
On Thu, Feb 23, 2017 at 7:42 PM, Irmen de Jong wrote: > > import os > os.system("traceroute www.google.com") Indeed, that would work, but it isn't a great approach in my opinion because I would rely on a system command, in this case Windows uses tracert while UNIX uses traceroute, one could fix t

How to run self-contained Python scripts who don't need Python installation?

2017-06-08 Thread Juan C.
I need to run some Python 3.6.0 scripts on the users' machines (W7 and W10) in an enterprise environment, but I can't install Python on those machines. I tried looking for those "py to exe", but sadly they don't support Python 3.6.0. Then I found out about "Windows x86/x86-64 embeddable zip file" t

Re: Best practice for config files?

2025-05-23 Thread c . buhtz
Hello Michael, thank you for your important question. On GNU/Linux (and maybe for POSIX?) systems there is a standard about it. Look for $XDG_CONFIG_HOME. To drive it further, you might distinguish between config data (related and

Newbie question about evaluating raw_input() responses

2013-05-21 Thread C. N. Desrosiers
Hi, I'm just starting out with Python and to practice I am trying to write a script that can have a simple conversation with the user. When I run the below code, it always ends up printing response to "if age > 18:" -- even if I enter a value below 18. Can anyone point me to what I am doing wr

Re: Newbie question about evaluating raw_input() responses

2013-05-21 Thread C. N. Desrosiers
Muchas gracias! On Wednesday, May 22, 2013 2:35:18 AM UTC-4, Fábio Santos wrote: > You have to convert `age` to an integer. Use int() to do it. Then you can > compare it to other numbers and obtain the expected results. > > On 22 May 2013 07:29, "C. N. Desrosiers

Total Beginner - Extracting Data from a Database Online (Screenshot)

2013-05-24 Thread logan . c . graham
Hey guys, I'm learning Python and I'm experimenting with different projects -- I like learning by doing. I'm wondering if you can help me here: http://i.imgur.com/KgvSKWk.jpg What this is is a publicly-accessible webpage that's a simple database of people who have used the website. Ideally wha

Re: Total Beginner - Extracting Data from a Database Online (Screenshot)

2013-05-25 Thread logan . c . graham
Sorry to be unclear -- it's a screenshot of the webpage, which is publicly accessible, but it contains sensitive information. A bad combination, admittedly, and something that'll be soon fixed. -- http://mail.python.org/mailman/listinfo/python-list

Re: Total Beginner - Extracting Data from a Database Online (Screenshot)

2013-05-27 Thread logan . c . graham
On Saturday, May 25, 2013 6:33:25 PM UTC-7, John Ladasky wrote: > On Friday, May 24, 2013 4:36:35 PM UTC-7, Carlos Nepomuceno wrote: > > > #to create the tables list > > > tables=[[re.findall('(.*?)',r,re.S) for r in > > re.findall('(.*?)',t,re.S)] for t in > > re.findall('(.*?)',page,re.S)] >

Using Python to automatically boot my computer at a specific time and play a podcast

2013-06-16 Thread C. N. Desrosiers
Hi, I'm planning to buy a Macbook Air and I want to use it as a sort of alarm. I'd like to write a program that boots my computer at a specific time, loads iTunes, and starts playing a podcast. Is this sort of thing possible in Python? Thanks in advance. CND -- http://mail.python.org/mailma

Re: Using Python to automatically boot my computer at a specific time and play a podcast

2013-06-16 Thread C. N. Desrosiers
Thank you! On Sun, Jun 16, 2013 at 3:49 PM, Jason Swails wrote: > > > > On Sun, Jun 16, 2013 at 3:06 PM, C. N. Desrosiers > wrote: > >> Hi, >> >> I'm planning to buy a Macbook Air and I want to use it as a sort of >> alarm. I'd like to

Re: [ANN]:JSONStream

2013-07-17 Thread Clark C. Evans
Looks interesting. In YAML we used three dashes as the "stream separator". So already a YAML processor could handle a JSON stream ... >>> for doc in yaml.load_all(""" ... --- {"one": "value"} ... --- {"two": "another"} ... --- ... {"three": "a third item in the stream", ... "with": "more

Python equivalent to the "A" or "a" output conversions in C

2012-06-19 Thread Edward C. Jones
Consider the following line in C: printf('%a\n', x); where x is a float or double. This outputs a hexadecimal representation of x. Can I do this in Python? -- http://mail.python.org/mailman/listinfo/python-list

Re: Python equivalent to the "A" or "a" output conversions in C

2012-06-19 Thread Edward C. Jones
On 06/19/2012 12:41 PM, Hemanth H.M wrote: >>> float.hex(x) '0x1.5p+3' Some days I don't ask the brightest questions. Suppose x was a numpy floating scalar (types numpy.float16, numpy.float32, numpy.float64, or numpy.float128). Is there an easy way to write x in binary or hex?

Re: adding a simulation mode

2012-07-04 Thread Mike C. Fletcher
the thing should return globalsub.subs( shutil.copytree, fake_copytree ) $ pip install globalsub HTH, Mike -- Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com -- http://mail.python.org

Re: pygame - importing GL - very bad...

2013-01-03 Thread Mike C. Fletcher
gl. or glu. or glut. added to the front. OpenGL/GLU/GLUT is already namespaced, but using C-style prefix namespacing (that is gl* glu* glut* and GL_*, GLU_*, GLUT_*), so adding Python style namespacing to the front of that makes it very verbose. OpenGL-using code is *littered* with OpenGL entr

Re: pylint, was Re: pygame - importing GL - very bad...

2013-01-03 Thread Mike C. Fletcher
one: Does not match PEP8 recommended style" making it clear that this is *not* an error, it is a *style* related *warning*. HTH, Mike -- Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com -- http://mail.python.org/mailman/listinfo/python-list

Re: handling return codes from CTYPES

2013-01-21 Thread Mike C. Fletcher
at's because you've just discarded the object you created. What you wanted was, I believe: initScanLib = sLib.InitScanLib initScanLib.restype = c_short initResult = initScanLib( ... ) i.e. you tell the initScanLib function how to coerce its result-type. *Some* C functions

Re: handling return codes from CTYPES

2013-01-21 Thread Mike C. Fletcher
On 13-01-21 11:52 AM, Steve Simmons wrote: Mike, Thanks for your response - I was puzzled by one part of it though... On 21/01/2013 15:14, Mike C. Fletcher wrote: That's because you've just discarded the object you created I (mis?)understood from the ctypes document

Re: XSLT to Python script conversion?

2012-02-13 Thread Mike C. Fletcher
rate.py, model.py and templates/section.kid files are all you need to look at to understand the docbook processing. HTH, Mike -- ____ Mike C. Fletcher Designer, VR Plumber, Coder http://www.vrplumber.com http://blog.vrplumber.com -- http://ma

Using modules from Debian "python3-..." packages with locally compiled Python 3.3

2012-05-08 Thread Edward C. Jones
I use up-to-date Debian testing (wheezy), amd64 architecture. I downloaded, compiled and installed Python 3.3.0 alpha 3 (from python.org) using "altinstall". Debian wheezy comes with python3.2 (and 2.6 and 2.7). I installed the Debian package "python3-bs4" (BeautifulSoup4 for Python3). Note: De

Re: Using modules from Debian "python3-..." packages with locally compiled Python 3.3

2012-05-08 Thread Edward C. Jones
Terry Reedy said: > Question 1: if you use the .pth method, do you get the same result? (I expect you will, but good to > check.) Recompiled Pyhton 3.3 without the SITEPATH change. Same result: > python3.3 Python 3.3.0a3 (default, May 8 2012, 19:57:45) [GCC 4.6.3] on linux Type "help", "cop

strptime format string nasty default

2012-05-09 Thread Javier Novoa C.
better way... To say that the month is the optional one-two digit part is just a default, isn't it? Why can't I specify that the day part is the one with one-or-two digits on the input string...? Or is there a way out that I don't know yet? -- Javier Novoa C. --- Posted via ne

Re: strptime format string nasty default

2012-05-09 Thread Javier Novoa C.
ime, or perhaps use your parsed (day, month, year) tuple > directly. Ok, I'll do that. > > /Jorgen > Thanks! -- Javier Novoa C. --- Posted via news://freenews.netfront.net/ - Complaints to n...@netfront.net --- -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Book for a C Programmer?

2012-05-24 Thread Javier Novoa C.
n what an if..then..else statement is? >> >> Thanks. > > Dive into python seems to be quite popular & can be read online fro free > > Learning Python by Mark Lutz, from O'Reilly is a good one, I've been reading it and it also enforces a comparison between C pro

Re: Python Book for a C Programmer?

2012-05-24 Thread Javier Novoa C.
On Thu, May 24, 2012 at 08:34:24AM -0500, boB Stepp wrote: > On Thu, May 24, 2012 at 8:28 AM, Javier Novoa C. > wrote: > > On 2012-05-24, alister wrote: > >> On Wed, 23 May 2012 16:45:05 -0700, hsaziz wrote: > >> > >>> I am trying to join an online

Hashable object with self references OR how to create a tuple that refers to itself

2012-06-15 Thread Edward C. Jones
I am trying to create a collection of hashable objects, where each object contains references to other objects in the collection. The references may be circular. To simplify, one can define x= list() x.append(x) which satisfies x == [x]. Can I create a similar object for tuples which sa

Automatic placement of a text box? ie empty legend [matplotlib]

2011-04-26 Thread C Barrington-Leigh
The automatic placement functionality of legend() is nice. I'd like to make use of it to place a box with just a title or title and comment (ie, some text) but no lines or legend entries. Does anyone know a way to do this? -- http://mail.python.org/mailman/listinfo/python-list

make test on Centos 7.4 fails

2017-10-19 Thread Decker, Ryan C.
56\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"}, 88) = 0 accept4(3, NULL, NULL, SOCK_CLOEXEC)= 4 sendto(4, "abc", 3, 0, NULL, 0) = -1 ENOKEY (Required key not available) +++ exited with 2 +++ Any

I have anaconda, but Pycharm can't find it

2017-11-27 Thread nospam . C W
Hello all, I am a first time PyCharm user. I have Python 3 and Anaconda installed. They work together on Sublime Text, but not on Pycharm. Pycharm tells me it cannot find modules numpy, matplotlib, etc. What should I do? I tried to set the interpreter environment, and a few other options, none s

Re: Bloody rubbish

2021-05-08 Thread Jason C. McDonald
on turns out to >> be something other than python? > > And it's bizarre that the OP, since he despises Python so much, and > finds its syntax absurd, would even bother to make any sort of > implementation of it. > -- Jason C. McDonald (CodeMouse92) Author | Speaker | Hacker | Time Lord -- https://mail.python.org/mailman/listinfo/python-list

Re: for the installation of pycharm

2021-05-08 Thread Jason C. McDonald
t; > > > >Sent from [1]Mail for Windows 10 > > > > References > >Visible links > 1. https://go.microsoft.com/fwlink/?LinkId=550986 -- Jason C. McDonald (CodeMouse92) Author | Speaker | Hacker | Time Lord -- https://mail.python.org/mailman/listinfo/python-list

Re: Bloody rubbish

2021-05-08 Thread Jason C. McDonald
s open > source on github. > > Claim #2, "he invented smartphones": > > Yes, he did (as part of a team) create the first smartphone, > the Ericsson R380: > > https://en.wikipedia.org/wiki/Ericsson_R380 > > /Toaster -- Jason C. McDonald (CodeMouse92) Author | Speaker | Hacker | Time Lord -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: Autism in discussion groups (was: Re: Proposal: Disconnect comp.lang.python from python-list)

2021-05-08 Thread Jason C. McDonald
SS > person is ever called for any possibly disrespecting words or > behavior. A fluffy cloud echo chamber where everybody just accepts > and respects you for what you are. Does the concept sound familiar? > > > P.S.: *NOT* among the core symptoms of (the high-functioning levels) > of ASS is the inability to learn. Mind that! (And that includes > social norms.) -- Jason C. McDonald (CodeMouse92) Author | Speaker | Hacker | Time Lord -- https://mail.python.org/mailman/listinfo/python-list

Re: OT: Autism in discussion groups (was: Re: Proposal: Disconnect comp.lang.python from python-list)

2021-05-09 Thread Jason C. McDonald
e the aforementioned on further inspection. (But I don't know all cases either.) > I do agree asking people to simply not be stupid doesn't seem to work > these days for whatever reason. I hadn't noticed. ;) -- Jason C. McDonald (CodeMouse92) Author | Speaker | Hacker | Time Lord -- https://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >