Try python-dateutil - I found it to be one of the better python modules
for dealing with dates. You may have to replace or strip some of the
string.
Johnf
On 7/19/19 7:44 PM, C W wrote:
Hello all,
I have a date time string that looks like the following.
02015-07-01 00:01:44.538420-08
tempt to do create the
comprehension. But after seeing your code I realized that I had the '['
and the '{' confused. I believed I had to use '{'. I just reviewed a
tutorial off the net and that was what they were using.
Thanks again,
Johnf
Just because this
many
of these loops I thought it might be best if I tried using comprehensions.
Johnf
On 6/24/19 10:48 AM, Mats Wichmann wrote:
On 6/24/19 10:15 AM, johnf wrote:
.
Since I use a lot of similar loops to populate many dropdown controls I
started investigating the use of list comprehensions.
and wonder if it will improve
the performance. The data is not very big - about a thousand rows -
give or take.
So what do you guys think?
Johnf
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
e end (all I need is a
good editor to make the changes) but I was hoping to find something that
would work in a more universal way.
Johnf
On 05/31/2017 12:03 PM, Peter Otten wrote:
john wrote:
Hi folks,
In the past I used a simple "import filename" for sub-modules in python
2.
On Sunday 14 June 2009 07:31:53 pm Michael Powe wrote:
>
> However, I will say that while following this thread, it occurred to
> me that the one feature that VS and even the VBA editor in MS Office
> has, is the ability to pop you into the debugger on error. This
> feature is so useful that it s
On Saturday 13 June 2009 02:44:53 am Eddie wrote:
> Hi guys,
>
> What would you regard as the best free Python editor to use on Windows
> for a new guy? Searching Google i see that there is quite a few out
> there and is "VIM" the best one to go with?
>
> Regards
> Eddie
> _
On Thursday 23 April 2009 08:44:07 am Emile van Sebille wrote:
> johnf wrote:
>
>
> > But if I attempt this
> > urllib.urlopen( "http://maps.google.com?q='18 Tadlock Place Woodland CA'"
> > ) it always fails.
>
&
I'm trying to comfirm an address is a good address via google. Meaning does
google report that the address exist.
If I do
urllib.urlopen( "http://maps.google.com/maps/geo?%s"; % params )
with the address in params. I get the longitude and latitude correctly.
If I use the following in the addr
On Tuesday 21 April 2009 11:05:32 am Dinesh B Vadhia wrote:
> Hi Robert
>
> I don't have an answer but can have my sympathy. I've been looking for a
> quality pdf to text convertor for months and not turned up anything useful.
> I've tried many free programs which are poor. I too wanted a Python
On Tuesday 21 April 2009 10:36:59 am Robert Berman wrote:
> Bob,
>
> Thank you for the quick reply. I am acquainted with that method, and
> that will certainly work to do some really serious testing; but, the
> data collection is an ongoing process and the users are requesting that
> every month t
On Thursday 16 April 2009 05:04:39 pm Alan Gauld wrote:
> "johnf" wrote
>
> >> I want to save the list to the field and when I retrieve the string
> >> convert
> >> it back to a list.
> >>
> >> But this does NOT work.
> >>
On Thursday 16 April 2009 03:52:02 pm johnf wrote:
> I am dealing with a database field that can only store strings.
> I want to save the list to the field and when I retrieve the string convert
> it back to a list.
>
> But this does NOT work.
> mylist=[1,2,3,4]
> mystr=st
I am dealing with a database field that can only store strings.
I want to save the list to the field and when I retrieve the string convert it
back to a list.
But this does NOT work.
mylist=[1,2,3,4]
mystr=str(mylist)
newlist= list(mystr)
I keep thinking there must be a simple way of get this d
On Friday 10 April 2009 09:41:13 am johnf wrote:
> On Friday 10 April 2009 08:35:13 am johnf wrote:
> > I can get the following to work:
> > os.system('lp -d printer invoice.pdf')
> >
> > but what I think is the correct way for the future is:
> >
On Friday 10 April 2009 08:35:13 am johnf wrote:
> I can get the following to work:
> os.system('lp -d printer invoice.pdf')
>
> but what I think is the correct way for the future is:
> subprocess.Popen('lp -d printer invoice.pdf')
> and it does not work???
I can get the following to work:
os.system('lp -d printer invoice.pdf')
but what I think is the correct way for the future is:
subprocess.Popen('lp -d printer invoice.pdf')
and it does not work???
Can someone explain what I'm doing wrong?
Traceback (most recent call l
On Wednesday 04 March 2009 04:56:37 pm Alan Gauld wrote:
> "Kent Johnson" wrote
>
> > I've heard good things about Dabo, never tried it myself though.
> > http://dabodev.com/
>
> I looked at Dabo but decided not to try it since it was yet another
> framework. Although it's based on wxPython they h
On Wednesday 18 February 2009 03:10:41 pm johnf wrote:
> Hi,
>
> I need to develope a routine that will provide the some dates between a
> starting date and an ending date. The dates will be used to schedule
> instructors for specific class dates from the list of available da
Hi,
I need to develope a routine that will provide the some dates between a
starting date and an ending date. The dates will be used to schedule
instructors for specific class dates from the list of available dates.
Class is normally on Monday, Wedesday, and Friday (or any days of the week
Hi,
How silly of me to think I understood the import command. I'm trying to learn
how to automate printing documents from OpenOffice using python. I found
several ways and I was able to get some of them to work. But I found the
Danny.OOo.OOoLib.py tools (kind of old 2005 but still on the wiki
On Monday 22 December 2008 10:34:12 am Alan Gauld wrote:
> "johnf" wrote
>
> > So I ask you guys is there a link to a practical tutorial that
> > provides hands
> > on information on the use of a python parser.
>
> One place to loook for all things to
On Monday 22 December 2008 09:15:13 am bob gailer wrote:
> johnf wrote:
> > I've been in the programming business for over 20 years and I have never
> > had a need for a parser. But recently I have need to convert code from
> > one language to a my new language python.
I've been in the programming business for over 20 years and I have never had a
need for a parser. But recently I have need to convert code from one
language to a my new language python. What a better way to learn the new
language python than a new project. I decided it might be time to learn
On Monday 15 December 2008 11:31:12 am Andreas Kostyrka wrote:
> Am Mon, 15 Dec 2008 10:18:28 -0800
>
> schrieb johnf :
> > Hi,
> > I have a string that I need to extract just the sql
> > statement. The following is the string
> > \000\000\000\000\000\000\00
Hi,
I have a string that I need to extract just the sql statement.
The following is the string
\000\000\000\000\000\000\000\000.\000\000\000\\000\000\000
\000$\000\000\000\000\000(\000\000\000\000X\000\000\000\000\000,
\000\000\000\000P\000\000\000\000\000Q\000\00
On Friday 12 September 2008 06:34:53 pm wesley chun wrote:
> On Fri, Sep 12, 2008 at 5:59 PM, Wayne Watson
>
> <[EMAIL PROTECTED]> wrote:
> > Interesting. I've been quite surprised that some community college in the
> > Bay Area hasn't offered Python recently. However, I'm long gone from
> > there
On Friday 12 September 2008 03:30:13 pm Patrick wrote:
> I guess I am a Python framework burnout. I have tried so many of them
> over the past two months, they are just not right for me right now. I am
> trying to put together a program to generate my website offline via the
> MVC paradigm, all I n
On Saturday 06 September 2008 06:49:39 pm johnf wrote:
> Hi,
> I'm currently using ftplib.storbinary() to upload a file to a FTP server.
> However, I would like to inform the user of the progress being made during
> the file transfer (it could be a very long transfer). But
&g
Hi,
I'm currently using ftplib.storbinary() to upload a file to a FTP server.
However, I would like to inform the user of the progress being made during
the file transfer (it could be a very long transfer). But
ftplib.storbinary() has no callback like retrbinary() so does anyone have a
though
On Friday 05 September 2008 05:03:30 pm Ted Roche wrote:
> On Fri, Sep 5, 2008 at 6:42 PM, Tim Johnson <[EMAIL PROTECTED]> wrote:
> > I've been using smtplib for years to send plain text emails
> > programmatically. Now I have a customer who is requesting that I (at
> > least) investigate sending i
On Tuesday 12 August 2008 11:31:44 am Jaggo wrote:
> Hello.
>
> I haven't much experience with programming.
>
> I'd like to point this question to programmers who write in editors other
> than the default PyWin32:
>
> Why do you use your editor rather than using Pywin? What feature has editor
> X g
I have been attempting to research the web on how python-pam works. Does
anyone have example code?
--
John Fabiani
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
a for Linux but I haven't found anything for windows. Hopefully,
someone has had to do this in the past and knows what has to be done.
Thanks in Advance,
Johnf
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Wednesday 16 January 2008 02:44:25 pm Alan Gauld wrote:
> > It is, almost, (19 January 2008)GS cookie time in
> > CA.
>
> Coming from Scotland I have no idea what that means!
What no Girl Scout cookies in Scotland???:-)
--
John Fabiani
___
Tutor m
On Friday 11 January 2008 11:19:43 am you wrote:
> johnf wrote:
> > I spoke to soon. Where can I find the DB-API for postgres? Because the
> > only way I can get this to work is using ('%s') and it does not work with
> > (%s).
>
> What module are you usin
On Friday 11 January 2008 10:20:13 am Alan Gauld wrote:
> "johnf" <[EMAIL PROTECTED]> wrote
>
> > and should be doing
> > tempCursor.execute ( "Select pg_get_serial_sequence ( %s, %s ) as
> > seq", ( 'public.arcust', 'pkid' )
On Friday 11 January 2008 09:14:25 am Simone wrote:
> johnf ha scritto:
> > But the above does not work when I use variables instead of strings as in
> >
> > tempCursor.execute ( "Select pg_get_serial_sequence ( %s, %s ) as
> > seq", ( tableName, fieldNa
On Friday 11 January 2008 10:20:13 am Alan Gauld wrote:
> "johnf" <[EMAIL PROTECTED]> wrote
>
> > and should be doing
> > tempCursor.execute ( "Select pg_get_serial_sequence ( %s, %s ) as
> > seq", ( 'public.arcust', 'pkid' )
Hi,
I was recently told I was doing something wrong with my python sql statements.
I was doing
tempCursor.execute("Select pg_get_serial_sequence('%s','%s') as seq
" % ('public.arcust','pkid'))
and should be doing
tempCursor.execute ( "Select pg_get_serial_sequence ( %s, %s ) as
seq", ( 'publi
On Thursday 03 January 2008 10:13:18 am Alan Gauld wrote:
> "johnf" <[EMAIL PROTECTED]> wrote
>
> > If the user types in a partial of the key then the dialog
> > appears and the user picks from the list. The details of the dialog
> > are
> >
On Thursday 03 January 2008 12:22:25 am Alan Gauld wrote:
> Are you sure you made it a modal dialog?
> Any dialog will do that if it is opened modelessly, you need to
> use the modal version to make it block the app.
Yes. I believe the way I have coded the dialog causes a bug. If I create a
sta
On Wednesday 02 January 2008 09:31:19 pm you wrote:
> johnf wrote:
> > def someMethod():
> >class MyClass(object):
> >.
> > if something:
> > .
> > return someval
>
> Legal? Well the police won't come after y
def someMethod():
class MyClass(object):
.
if something:
.
return someval
--
John Fabiani
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Wednesday 02 January 2008 06:08:10 am Roy Chen wrote:
> Hello all,
>
> I've been using PythonCard to build a GUI for a simple program I'm trying
> to write. It's simple and easy to use, and rather intuitive.
>
> However, it seems that it hasn't been updated in some time, and so I would
> like a
On Wednesday 02 January 2008 09:41:46 am Alan Gauld wrote:
> I tried to fined a decent GUI builder for wxPython but failed.
> There are two or three available but none of them really worked
> all that well. SPE seemed the best of a poor bunch.
>
> However...
>
> > Take a look at Dabo
> > www.dabod
On Wednesday 02 January 2008 06:56:54 am Michael Langford wrote:
> While some people are Adobe haters("They hate the web...etc"), I think
> a slick alternative available now is Flex2 calling python via XMLRPC.
>
> I've been doing so lately. It is fast to pick up and makes slick
> looking GUI's rath
On Thursday 13 December 2007 03:28:46 pm ALAN GAULD wrote:
> Terry Carroll wrote:
>
> On Thu, 13 Dec 2007, Alan Gauld wrote:
> >> > if self._inFlush:
> >> > return
> >> > self._inFlush = True
> >> >
> >> >
> >> > I can not see the difference but the second one acts differently
>
> in
>
if self._inFlush:
return
self._inFlush = True
AND
if not self._inFlush:
...
self._inFlush = True
else:
return
I can not see the difference but the second one acts differently in my code.
--
John Fabiani
___
Tutor m
On Friday 26 October 2007 03:17:47 pm Alan Gauld wrote:
> "Allen Fowler" <[EMAIL PROTECTED]> wrote
>
> > I have a block of code buried deep in a module
> > that I expect to fail periodically.
> > (Calls to other machines over slow network, and such.)
> >
> > Generally, though, trying it a second /
On Saturday 04 August 2007 08:34, Tony Noyeaux wrote:
> I've been using Python IDLE,.. tried DrPython,.. had a try of ActiveState
> Komodo IDE, Active Python,...
>
> What is a good python editor to use. I've seen good and bad with all of the
> above from my newcomer perspective.. wondering what oth
On Friday 27 July 2007 14:29, scott wrote:
> Hi,
>
> now that I have a very basic understanding of Python I would like to
> take a look at programming in a GUI. Which GUI is generally the easiest
> to learn?
You might want to check out Dabo (www.dabodev.com) which uses wxPython but
provide
On Monday 11 June 2007 13:01, scott wrote:
> Hi,
>
> I have been using Kdevelop so far to develop and a few bugs it inherits
> from Kate/Kwrite are really annoying me. It does not collapse quotes
> properly and there are other graphical glitches as well.
>
> Could someone suggest a few
On Monday 04 June 2007 03:10, you wrote:
> johnf wrote:
> > I have the following
> > pattern='^([0-9]{0,%s})(\.[0-9]{0,%s})?$' % (self.IntegerWidth,
> > self.DecimalWidth)
>
> You should use a raw string (prefix with r) to define pattern, though
> that is
I have the following
pattern='^([0-9]{0,%s})(\.[0-9]{0,%s})?$' % (self.IntegerWidth,
self.DecimalWidth)
)
if re.match(pattern, self.GetValue())==None:
self.BackColor == "pink"
else:
self.BackColor == "white"
self.IntegerWidth = 2
self.DecimalWidth=2
the pr
On Tuesday 22 May 2007 06:35, Leon Keylin wrote:
> Hi John,
>
> Here's the code (I do have permissions to truncate, works manually under
> the same user.
>
>
> import pymssql
>
> con = pymssql.connect
> (host='server',user='user',password='pwd',database='DB_QA')
> cur = con.cursor()
>
>
> query="tr
On Monday 21 May 2007 16:21, Leon Keylin wrote:
> Thanks Mike, unfortunately that's the mod I had problems with before. The
> one that
> can't do truncate. I've written about it before here and it was easier to
> look for
> another solution.
>
> Is there any other way? Should I be looking for a dif
On Tuesday 20 February 2007 06:49, Don Taylor wrote:
> Asrarahmed Kadri wrote:
> > I want to develop an application which uses a database and some forms to
> > enter/modify the database.
> > The application should also generate reports based on some fields.
> >
> > What should I be using? Python or
On Friday 09 February 2007 10:56, Christopher Arndt wrote:
> Rikard Bosnjakovic schrieb:
> > On 2/9/07, johnf <[EMAIL PROTECTED]> wrote:
> >> Is there a Python tool/document that is similar? Just a simple way to
> >> help understand.
> >
> > Yes, use
Hi,
In the Visual Fox Pro world there is a help file that allows look ups /
searchs for functions, etc... just plain reference infomation. I.e. if I
were interested in the MAX() function I would just type Max() and get a page
that contained a description of how to use MAX() and what it returned
On Friday 26 January 2007 00:40, Alan Gauld wrote:
> "Shadab Sayani" <[EMAIL PROTECTED]> wrote
>
> > I got your point.But before inserting data I need to store it
> > into a file in a format supported by postgresql.Wont this
> > operation incur a performance hit as it includes writing
> > to a fi
On Thursday 25 January 2007 14:36, Eric Walstad wrote:
> Alan Gauld wrote:
> > "Shadab Sayani" <[EMAIL PROTECTED]> wrote
> >
> >> The data I need to deal with is in 100s of GB.
> >> I am using postgresql backend and SQLALCHEMY ORM.
> >
> > All ORMs will introduce a significant performance hit.
> >
On Wednesday 24 January 2007 19:22, Shadab Sayani wrote:
> Hi,
> I am working in a biodatabases project.The data I need to deal with is
> in 100s of GB.I am using postgresql backend and SQLALCHEMY ORM.I need to
> read the bio datafiles and parse them and then store them in database.I am
> in t
On Wednesday 24 January 2007 14:34, Michael Key wrote:
> I am trying to develop a project tracking program that would allow you to
> track hours and minutes spent on several different projects and store he
> data in a database for printing. Any help would be appreciated.
>
> Mike
Take a good look
On Sunday 21 January 2007 10:30, you wrote:
> johnf wrote:
> > Hi,
> > I want to find a item within a large tuple that contains tuples.
> > mytuple = (('name',123,'value'),('first',345,'newvalue'))
> > so a 'for loop' w
Hi,
I want to find a item within a large tuple that contains tuples.
mytuple = (('name',123,'value'),('first',345,'newvalue'))
so a 'for loop' works
istrue = False
for i in range(len(mytuple)):
if 'first' in mytuple[i]:
istrue = True
break
if istrue:
print " true"
Is possible to us
Hi,
if there is a pyc and a py file within a module and the py file has a later
date which file will python run?
John
--
John Fabiani
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Thursday 30 November 2006 00:13, Jia Lu wrote:
> import wx
>
> ComboList = ['Akari', 'Aika', 'Alice']
>
> class MyApp(wx.App):
> def OnInit(self):
> frame = wx.Frame(None, -1, "ARIA", size=(250, 100))
> frame.Show()
>
> self.CBox = wx.ComboBox(frame, -1, "Alicia", pos
On Thursday 30 November 2006 00:13, Jia Lu wrote:
> Hi all
>
> I am using wx Py with FC6. I ran the program below but I found the method
> SelectAll() cannot work well.(The last letter didnot be selected.!!)
> --
> import wx
>
> ComboList = ['Akari', 'Aika', 'Alice']
>
> class MyApp
On Sunday 26 November 2006 16:17, John Fouhy wrote:
> On 27/11/06, johnf <[EMAIL PROTECTED]> wrote:
> > I can but it's not the issue - I think? I want to know how it works -
> > exceptions not handled by python that is. Are there exception handled
> > outside of p
On Sunday 26 November 2006 15:43, Alan Gauld wrote:
> "johnf" <[EMAIL PROTECTED]> wrote
>
> > My debugger comes up with lots of exceptions (builtin with my IDE
> > wing) when I
> > run code I have obtained from others. This is not a formating
> > e
My debugger comes up with lots of exceptions (builtin with my IDE wing) when I
run code I have obtained from others. This is not a formating error - but
real unhandled exceptions. But the when the program/programs is/are run from
the command line they work as expected.
So does this mean tha
Hi,
Is it possible to a single that contains two classes:
Myclass.py file contains:
Class one(object):
def needsomething(self):
Class two (object):
def dosomething(self):
I want Class one's methods to access Class two methods?
Class one(object):
def needsomething(self):
return dosom
Hi,
I'm using FreeTDS (MS SQL database access lib) and for datetime fields it
returns a type 'DateTimeType'. I need it in type 'datetime.datetime'. There
is very little in the form of a tutorial that explains what I need to do.
Can someone help me with this issue.
John
Hi
I'm working on a python interface to freetds. And freetds can access MS SQL
database engines. But I'm having trouble with datatime datatypes.
The python module I'm using is MSSQL.py written back in 2003. After getting
it compiled access to MS SQL works if I stay with simple datatypes (in
On Tuesday 07 November 2006 03:20, Andreas Kostyrka wrote:
> That's bullshit. Python and Ruby are quite comparable
Gee Andreas tell us how you really feel! BTW I agree that Python and Ruby are
very close.
John
___
Tutor maillist - Tutor@python.org
h
On Sunday 29 October 2006 18:25, jhl wrote:
> Hi-
>
> How is the 1st import of a module removed so that new edits on the module
> can be re-imported?
>
> DETAIL:
>
> I am working on a module/file and importing it into a python shell, trying
> it out and then tweaking/editing the module. Then to se
On Sunday 22 October 2006 20:03, Luke Paireepinart wrote:
> > """Create the Second ListBox"""
> >
> > self.lbRSSItems = Listbox(self, exportselection=0
> > ,command=self.reveal
> > , relief=SUNKEN)
>
> Because whitespace is
On Thursday 19 October 2006 02:41, [EMAIL PROTECTED] wrote:
> Hi
>
> just starting to get to grips with writing GUIs in Python using wxPython
> and not being a computer scientist, have a philosophical question about the
> "best" way to pass data between various modules. For example, I anticipate
>
On Friday 13 October 2006 12:33, Alfonso wrote:
Could be wrong but can't you use file associations? I do on my SUSE system.
John
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Thursday 12 October 2006 07:14, Jason Massey wrote:
> On 10/12/06, johnf <[EMAIL PROTECTED]> wrote:
> > On Thursday 12 October 2006 00:31, Alan Gauld wrote:
> > > > query = "SELECT * FROM DB WHERE NAME = %s" % (name)
> > > > cursor.execute(que
On Thursday 12 October 2006 00:31, Alan Gauld wrote:
> > query = "SELECT * FROM DB WHERE NAME = %s" % (name)
> > cursor.execute(query)
>
> There can be security issues with this style, especially
> if the parameters can be modified by users - for example
> you read the values from a web page.
>
>
Hi,
Is there a location (web link) that explains the inner workings of setuptools,
etc
John
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
Hi,
I was wondering if there is a pyqt list like the
[EMAIL PROTECTED] list?
Thanks
John
___
Tutor maillist - Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor
On Tuesday 06 June 2006 09:22, Smith, Jeff wrote:
> I'm looking for a truly generic database API in that the underlying DB
> could be text, XML, SQL engine, etc.
>
> For instance, initially, the underlying database will probably be text
> files but we may at some point want to move to a real databa
Hi,
For some reason I have lost qt. I'd like to know what I have to re-install to
get python qt lib for SUSE 10.0. When I use YAST I see nothing like
python-qt
Right now I do
import qt
I get
seg fault
John
___
Tutor maillist - Tutor@python.org
ht
On Thursday 18 May 2006 16:19, Chris Delgado wrote:
> import random
>
> heads = 0
> tails = 0
> flips = 0
>
> if flips <= 100:
>
> coin = random.randrange(2)
>
> if coin = 0:
> heads +=
> elif coin = 1:
> tails +=
>
> flips +=1
>
> print "The coin was flipped 100 tim
87 matches
Mail list logo